aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/jz4740_fb.c
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2012-09-09 11:38:41 -0400
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2012-09-22 17:36:48 -0400
commitb5d4190f7ec584a2860499f2721fd3421e41c187 (patch)
tree5991cbd06dac4bdf3a96226b15ad5cb241b90af9 /drivers/video/jz4740_fb.c
parentc88452f16d4d283c735117b953f9f2ab10218799 (diff)
fbdev: jz4740: Use devm_request_and_ioremap
Use devm_request_and_ioremap instead of request_mem_region + devm_ioremap. This also fixes the following compile error introduced in commit b2ca7f4d ("drivers/video/jz4740_fb.c: use devm_ functions"): drivers/video/jz4740_fb.c: In function 'jzfb_probe': drivers/video/jz4740_fb.c:676:2: error: implicit declaration of function 'devm_ioremap' drivers/video/jz4740_fb.c:676:13: warning: assignment makes pointer from integer without a cast Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Diffstat (limited to 'drivers/video/jz4740_fb.c')
-rw-r--r--drivers/video/jz4740_fb.c24
1 files changed, 3 insertions, 21 deletions
diff --git a/drivers/video/jz4740_fb.c b/drivers/video/jz4740_fb.c
index 7669770e41d5..b0df279cb011 100644
--- a/drivers/video/jz4740_fb.c
+++ b/drivers/video/jz4740_fb.c
@@ -632,23 +632,10 @@ static int __devinit jzfb_probe(struct platform_device *pdev)
632 return -ENXIO; 632 return -ENXIO;
633 } 633 }
634 634
635 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
636 if (!mem) {
637 dev_err(&pdev->dev, "Failed to get register memory resource\n");
638 return -ENXIO;
639 }
640
641 mem = request_mem_region(mem->start, resource_size(mem), pdev->name);
642 if (!mem) {
643 dev_err(&pdev->dev, "Failed to request register memory region\n");
644 return -EBUSY;
645 }
646
647 fb = framebuffer_alloc(sizeof(struct jzfb), &pdev->dev); 635 fb = framebuffer_alloc(sizeof(struct jzfb), &pdev->dev);
648 if (!fb) { 636 if (!fb) {
649 dev_err(&pdev->dev, "Failed to allocate framebuffer device\n"); 637 dev_err(&pdev->dev, "Failed to allocate framebuffer device\n");
650 ret = -ENOMEM; 638 return -ENOMEM;
651 goto err_release_mem_region;
652 } 639 }
653 640
654 fb->fbops = &jzfb_ops; 641 fb->fbops = &jzfb_ops;
@@ -657,7 +644,6 @@ static int __devinit jzfb_probe(struct platform_device *pdev)
657 jzfb = fb->par; 644 jzfb = fb->par;
658 jzfb->pdev = pdev; 645 jzfb->pdev = pdev;
659 jzfb->pdata = pdata; 646 jzfb->pdata = pdata;
660 jzfb->mem = mem;
661 647
662 jzfb->ldclk = devm_clk_get(&pdev->dev, "lcd"); 648 jzfb->ldclk = devm_clk_get(&pdev->dev, "lcd");
663 if (IS_ERR(jzfb->ldclk)) { 649 if (IS_ERR(jzfb->ldclk)) {
@@ -673,9 +659,9 @@ static int __devinit jzfb_probe(struct platform_device *pdev)
673 goto err_framebuffer_release; 659 goto err_framebuffer_release;
674 } 660 }
675 661
676 jzfb->base = devm_ioremap(&pdev->dev, mem->start, resource_size(mem)); 662 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
663 jzfb->base = devm_request_and_ioremap(&pdev->dev, mem);
677 if (!jzfb->base) { 664 if (!jzfb->base) {
678 dev_err(&pdev->dev, "Failed to ioremap register memory region\n");
679 ret = -EBUSY; 665 ret = -EBUSY;
680 goto err_framebuffer_release; 666 goto err_framebuffer_release;
681 } 667 }
@@ -736,8 +722,6 @@ err_free_devmem:
736 jzfb_free_devmem(jzfb); 722 jzfb_free_devmem(jzfb);
737err_framebuffer_release: 723err_framebuffer_release:
738 framebuffer_release(fb); 724 framebuffer_release(fb);
739err_release_mem_region:
740 release_mem_region(mem->start, resource_size(mem));
741 return ret; 725 return ret;
742} 726}
743 727
@@ -750,8 +734,6 @@ static int __devexit jzfb_remove(struct platform_device *pdev)
750 jz_gpio_bulk_free(jz_lcd_ctrl_pins, jzfb_num_ctrl_pins(jzfb)); 734 jz_gpio_bulk_free(jz_lcd_ctrl_pins, jzfb_num_ctrl_pins(jzfb));
751 jz_gpio_bulk_free(jz_lcd_data_pins, jzfb_num_data_pins(jzfb)); 735 jz_gpio_bulk_free(jz_lcd_data_pins, jzfb_num_data_pins(jzfb));
752 736
753 release_mem_region(jzfb->mem->start, resource_size(jzfb->mem));
754
755 fb_dealloc_cmap(&jzfb->fb->cmap); 737 fb_dealloc_cmap(&jzfb->fb->cmap);
756 jzfb_free_devmem(jzfb); 738 jzfb_free_devmem(jzfb);
757 739