9
0
Fork 0
barebox/drivers/ata
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 sandbox: allow "make ARCH=sandbox allyesconfig" 2014-07-22 21:29:57 +02:00
Makefile ata: Add i.MX AHCI driver 2012-12-07 12:19:45 +01:00
ahci.c driver: replace dev_request_mem_region with dev_request_mem_resource 2016-03-07 08:57:56 +01:00
ahci.h treewide: remove address of the Free Software Foundation 2014-06-11 08:35:25 +02:00
disk_ata_drive.c ata: disk_ata_drive: remove obsolete check for ID validity 2015-11-02 07:57:39 +01:00
disk_bios_drive.c switch all platform_bus device/driver registering to platform_driver/device_register 2012-10-04 15:19:12 +02:00
ide-sff.c ata: ide-sff: fix integer overflow in ata_wait_ready() 2015-09-04 07:38:57 +02:00
intf_platform_ide.c driver: replace dev_request_mem_region with dev_request_mem_resource 2016-03-07 08:57:56 +01:00
pata-imx.c driver: replace dev_request_mem_region with dev_request_mem_resource 2016-03-07 08:57:56 +01:00
sata-imx.c driver: replace dev_request_mem_region with dev_request_mem_resource 2016-03-07 08:57:56 +01:00