aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2016-02-17 06:58:20 -0500
committerTejun Heo <tj@kernel.org>2016-02-18 11:26:27 -0500
commit018361767a21fb2d5ebd3ac182c04baf8a8b4e08 (patch)
tree29226abd8e2b760b5b236c83a935fd01a4a0324a
parent287e6611ab1eac76c2c5ebf6e345e04c80ca9c61 (diff)
pata-rb532-cf: get rid of the irq_to_gpio() call
The RB532 platform specific irq_to_gpio() implementation has been removed with commit 832f5dacfa0b ("MIPS: Remove all the uses of custom gpio.h"). Now the platform uses the generic stub which causes the following error: pata-rb532-cf pata-rb532-cf: no GPIO found for irq149 pata-rb532-cf: probe of pata-rb532-cf failed with error -2 Drop the irq_to_gpio() call and get the GPIO number from platform data instead. After this change, the driver works again: scsi host0: pata-rb532-cf ata1: PATA max PIO4 irq 149 ata1.00: CFA: CF 1GB, 20080820, max MWDMA4 ata1.00: 1989792 sectors, multi 0: LBA ata1.00: configured for PIO4 scsi 0:0:0:0: Direct-Access ATA CF 1GB 0820 PQ: 0\ ANSI: 5 sd 0:0:0:0: [sda] 1989792 512-byte logical blocks: (1.01 GB/971 MiB) sd 0:0:0:0: [sda] Write Protect is off sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't\ support DPO or FUA sda: sda1 sda2 sd 0:0:0:0: [sda] Attached SCSI disk Fixes: 832f5dacfa0b ("MIPS: Remove all the uses of custom gpio.h") Cc: Alban Bedel <albeu@free.fr> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Arnd Bergmann <arnd@arndb.de> Cc: <stable@vger.kernel.org> #v4.3+ Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: Tejun Heo <tj@kernel.org>
-rw-r--r--drivers/ata/pata_rb532_cf.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/ata/pata_rb532_cf.c b/drivers/ata/pata_rb532_cf.c
index 12fe0f3bb7e9..c8b6a780a290 100644
--- a/drivers/ata/pata_rb532_cf.c
+++ b/drivers/ata/pata_rb532_cf.c
@@ -32,6 +32,8 @@
32#include <linux/libata.h> 32#include <linux/libata.h>
33#include <scsi/scsi_host.h> 33#include <scsi/scsi_host.h>
34 34
35#include <asm/mach-rc32434/rb.h>
36
35#define DRV_NAME "pata-rb532-cf" 37#define DRV_NAME "pata-rb532-cf"
36#define DRV_VERSION "0.1.0" 38#define DRV_VERSION "0.1.0"
37#define DRV_DESC "PATA driver for RouterBOARD 532 Compact Flash" 39#define DRV_DESC "PATA driver for RouterBOARD 532 Compact Flash"
@@ -107,6 +109,7 @@ static int rb532_pata_driver_probe(struct platform_device *pdev)
107 int gpio; 109 int gpio;
108 struct resource *res; 110 struct resource *res;
109 struct ata_host *ah; 111 struct ata_host *ah;
112 struct cf_device *pdata;
110 struct rb532_cf_info *info; 113 struct rb532_cf_info *info;
111 int ret; 114 int ret;
112 115
@@ -122,7 +125,13 @@ static int rb532_pata_driver_probe(struct platform_device *pdev)
122 return -ENOENT; 125 return -ENOENT;
123 } 126 }
124 127
125 gpio = irq_to_gpio(irq); 128 pdata = dev_get_platdata(&pdev->dev);
129 if (!pdata) {
130 dev_err(&pdev->dev, "no platform data specified\n");
131 return -EINVAL;
132 }
133
134 gpio = pdata->gpio_pin;
126 if (gpio < 0) { 135 if (gpio < 0) {
127 dev_err(&pdev->dev, "no GPIO found for irq%d\n", irq); 136 dev_err(&pdev->dev, "no GPIO found for irq%d\n", irq);
128 return -ENOENT; 137 return -ENOENT;