9
0
Fork 0
barebox/drivers/usb/musb
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
..
Kconfig usb: musb-dsps: select OFDEVICE 2015-01-19 08:47:13 +01:00
Makefile usb: musb: only build musb_barebox if host is enabled 2014-11-27 17:12:39 +01:00
am35x-phy-control.h USB: Add MUSB driver from Linux 2014-09-26 21:36:58 +02:00
musb_am335x.c USB: MUSB: Add barebox specific changes 2014-09-26 21:36:58 +02:00
musb_barebox.c usb: musb: set controller->priv pointer 2015-04-28 11:46:57 +02:00
musb_core.c usb: musb: Use proper timeout loop 2015-07-03 07:06:28 +02:00
musb_core.h Introduce include/linux/spinlock.h 2016-02-01 09:16:13 +01:00
musb_dma.h USB: MUSB: Add barebox specific changes 2014-09-26 21:36:58 +02:00
musb_dsps.c driver: replace dev_request_mem_region with dev_request_mem_resource 2016-03-07 08:57:56 +01:00
musb_gadget.c USB: MUSB: Add barebox specific changes 2014-09-26 21:36:58 +02:00
musb_gadget.h USB: MUSB: Add barebox specific changes 2014-09-26 21:36:58 +02:00
musb_gadget_ep0.c USB: MUSB: Add barebox specific changes 2014-09-26 21:36:58 +02:00
musb_host.c USB: MUSB: Add barebox specific changes 2014-09-26 21:36:58 +02:00
musb_host.h USB: MUSB: Add barebox specific changes 2014-09-26 21:36:58 +02:00
musb_io.h USB: MUSB: Add barebox specific changes 2014-09-26 21:36:58 +02:00
musb_regs.h USB: Add MUSB driver from Linux 2014-09-26 21:36:58 +02:00
phy-am335x-control.c driver: replace dev_request_mem_region with dev_request_mem_resource 2016-03-07 08:57:56 +01:00
phy-am335x.c driver: replace dev_request_mem_region with dev_request_mem_resource 2016-03-07 08:57:56 +01:00
phy-am335x.h USB: MUSB: Add barebox specific changes 2014-09-26 21:36:58 +02:00