9
0
Fork 0
barebox/drivers/video
Sascha Hauer 3bd69ad077 driver: replace dev_request_mem_region with dev_request_mem_resource
dev_request_mem_region doesn't work properly one some SoCs on which
PTR_ERR() values clash with valid return values from dev_request_mem_region.
Replace them with dev_request_mem_resource where possible.

This patch has been generated with the following semantic patch:

// <smpl>
@@
expression d;
expression n;
expression io;
identifier func;
@@
func(...) {
+struct resource *iores;
<+...
-io = dev_request_mem_region(d, n);
-if (IS_ERR(io)) {
+iores = dev_request_mem_resource(d, n);
+if (IS_ERR(iores)) {
...
-	return PTR_ERR(io);
-}
+	return PTR_ERR(iores);
+}
+io = IOMEM(iores->start);
...+>
}

@@
expression d;
expression n;
expression io;
identifier func;
@@
func(...) {
+struct resource *iores;
<+...
-io = dev_request_mem_region(d, n);
-if (IS_ERR(io)) {
+iores = dev_request_mem_resource(d, n);
+if (IS_ERR(iores))
-	return PTR_ERR(io);
-}
+	return PTR_ERR(iores);
+io = IOMEM(iores->start);
...+>
}

@@
expression d;
expression n;
expression io;
identifier func;
@@
func(...) {
+struct resource *iores;
<+...
-io = dev_request_mem_region(d, n);
-if (IS_ERR(io)) {
-	ret = PTR_ERR(io);
+iores = dev_request_mem_resource(d, n);
+if (IS_ERR(iores)) {
+	ret = PTR_ERR(iores);
...
}
+io = IOMEM(iores->start);
...+>
}

@@
expression d;
expression n;
expression io;
identifier func;
@@
func(...) {
+struct resource *iores;
<+...
-io = dev_request_mem_region(d, n);
+iores = dev_request_mem_resource(d, n);
+if (IS_ERR(iores))
+	return PTR_ERR(iores);
+io = IOMEM(iores->start);
...+>
}

@@
identifier func;
@@
func(...) {
<+...
struct resource *iores;
-struct resource *iores;
...+>
}
// </smpl>

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-03-07 08:57:56 +01:00
..
imx-ipu-v3 driver: replace dev_request_mem_region with dev_request_mem_resource 2016-03-07 08:57:56 +01:00
Kconfig bcm2835: introduce mach-bcm283x 2016-01-04 09:38:12 +01:00
Makefile bcm2835: introduce mach-bcm283x 2016-01-04 09:38:12 +01:00
atmel_hlcdfb.c ARM: move DMA alloc functions to dma.h 2015-03-06 07:52:02 +01:00
atmel_lcdfb.c ARM: move DMA alloc functions to dma.h 2015-03-06 07:52:02 +01:00
atmel_lcdfb.h video: add Atmel HLCD support 2013-01-31 19:05:50 +01:00
atmel_lcdfb_core.c driver: replace dev_request_mem_region with dev_request_mem_resource 2016-03-07 08:57:56 +01:00
backlight-pwm.c video: pwm-backlight: Honour discrete brightness levels from dt 2015-11-23 09:46:27 +01:00
backlight.c video: Add backlight support 2015-06-12 11:52:58 +02:00
bcm2835.c video: add a BCM2835 framebuffer driver 2013-11-06 09:59:05 +01:00
edid.c video: Add edid support 2014-03-29 07:57:53 +01:00
edid.h video: Add edid support 2014-03-29 07:57:53 +01:00
fb.c drivers: video: fb: make locally used fb_set_shadowfb() static 2016-02-08 08:28:39 +01:00
fbconsole.c font: fbconsole: add custom font supports 2015-11-23 08:21:08 +01:00
imx-ipu-fb.c driver: replace dev_request_mem_region with dev_request_mem_resource 2016-03-07 08:57:56 +01:00
imx.c driver: replace dev_request_mem_region with dev_request_mem_resource 2016-03-07 08:57:56 +01:00
mtl017.c video: Add MTL017 LVDS encoder support 2015-07-13 08:38:19 +02:00
of_display_timing.c drivers: video: drop unused of_get_display_timing() 2016-02-08 08:30:02 +01:00
omap.c rework remap_range 2015-11-03 07:27:44 +01:00
omap.h omap-fb: add driver 2013-06-24 21:47:07 +02:00
pxa.c driver: replace dev_request_mem_region with dev_request_mem_resource 2016-03-07 08:57:56 +01:00
s3c24xx.c driver: replace dev_request_mem_region with dev_request_mem_resource 2016-03-07 08:57:56 +01:00
sdl.c fb: sdl: create graphics window on enabling 2015-07-20 07:11:21 +02:00
simple-panel.c video: simple-panel: Add support for device tree provided nodes 2015-10-01 08:26:07 +02:00
simplefb.c video: simplefb: Add a8r8g8b8 support 2013-12-20 11:32:08 +01:00
stm.c driver: replace dev_request_mem_region with dev_request_mem_resource 2016-03-07 08:57:56 +01:00
vpl.c video: Add Video Pipeline (VPL) support 2015-07-13 08:38:19 +02:00