Commit b5d4190f authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Florian Tobias Schandinat

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: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
parent c88452f1
...@@ -632,23 +632,10 @@ static int __devinit jzfb_probe(struct platform_device *pdev) ...@@ -632,23 +632,10 @@ static int __devinit jzfb_probe(struct platform_device *pdev)
return -ENXIO; return -ENXIO;
} }
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!mem) {
dev_err(&pdev->dev, "Failed to get register memory resource\n");
return -ENXIO;
}
mem = request_mem_region(mem->start, resource_size(mem), pdev->name);
if (!mem) {
dev_err(&pdev->dev, "Failed to request register memory region\n");
return -EBUSY;
}
fb = framebuffer_alloc(sizeof(struct jzfb), &pdev->dev); fb = framebuffer_alloc(sizeof(struct jzfb), &pdev->dev);
if (!fb) { if (!fb) {
dev_err(&pdev->dev, "Failed to allocate framebuffer device\n"); dev_err(&pdev->dev, "Failed to allocate framebuffer device\n");
ret = -ENOMEM; return -ENOMEM;
goto err_release_mem_region;
} }
fb->fbops = &jzfb_ops; fb->fbops = &jzfb_ops;
...@@ -657,7 +644,6 @@ static int __devinit jzfb_probe(struct platform_device *pdev) ...@@ -657,7 +644,6 @@ static int __devinit jzfb_probe(struct platform_device *pdev)
jzfb = fb->par; jzfb = fb->par;
jzfb->pdev = pdev; jzfb->pdev = pdev;
jzfb->pdata = pdata; jzfb->pdata = pdata;
jzfb->mem = mem;
jzfb->ldclk = devm_clk_get(&pdev->dev, "lcd"); jzfb->ldclk = devm_clk_get(&pdev->dev, "lcd");
if (IS_ERR(jzfb->ldclk)) { if (IS_ERR(jzfb->ldclk)) {
...@@ -673,9 +659,9 @@ static int __devinit jzfb_probe(struct platform_device *pdev) ...@@ -673,9 +659,9 @@ static int __devinit jzfb_probe(struct platform_device *pdev)
goto err_framebuffer_release; goto err_framebuffer_release;
} }
jzfb->base = devm_ioremap(&pdev->dev, mem->start, resource_size(mem)); mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
jzfb->base = devm_request_and_ioremap(&pdev->dev, mem);
if (!jzfb->base) { if (!jzfb->base) {
dev_err(&pdev->dev, "Failed to ioremap register memory region\n");
ret = -EBUSY; ret = -EBUSY;
goto err_framebuffer_release; goto err_framebuffer_release;
} }
...@@ -736,8 +722,6 @@ static int __devinit jzfb_probe(struct platform_device *pdev) ...@@ -736,8 +722,6 @@ static int __devinit jzfb_probe(struct platform_device *pdev)
jzfb_free_devmem(jzfb); jzfb_free_devmem(jzfb);
err_framebuffer_release: err_framebuffer_release:
framebuffer_release(fb); framebuffer_release(fb);
err_release_mem_region:
release_mem_region(mem->start, resource_size(mem));
return ret; return ret;
} }
...@@ -750,8 +734,6 @@ static int __devexit jzfb_remove(struct platform_device *pdev) ...@@ -750,8 +734,6 @@ static int __devexit jzfb_remove(struct platform_device *pdev)
jz_gpio_bulk_free(jz_lcd_ctrl_pins, jzfb_num_ctrl_pins(jzfb)); jz_gpio_bulk_free(jz_lcd_ctrl_pins, jzfb_num_ctrl_pins(jzfb));
jz_gpio_bulk_free(jz_lcd_data_pins, jzfb_num_data_pins(jzfb)); jz_gpio_bulk_free(jz_lcd_data_pins, jzfb_num_data_pins(jzfb));
release_mem_region(jzfb->mem->start, resource_size(jzfb->mem));
fb_dealloc_cmap(&jzfb->fb->cmap); fb_dealloc_cmap(&jzfb->fb->cmap);
jzfb_free_devmem(jzfb); jzfb_free_devmem(jzfb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment