diff options
Diffstat (limited to 'drivers/ata/pata_pcmcia.c')
-rw-r--r-- | drivers/ata/pata_pcmcia.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/ata/pata_pcmcia.c b/drivers/ata/pata_pcmcia.c index 5a9b24950f99..1830e9166943 100644 --- a/drivers/ata/pata_pcmcia.c +++ b/drivers/ata/pata_pcmcia.c | |||
@@ -88,7 +88,7 @@ static struct ata_port_operations pcmcia_port_ops = { | |||
88 | .qc_prep = ata_qc_prep, | 88 | .qc_prep = ata_qc_prep, |
89 | .qc_issue = ata_qc_issue_prot, | 89 | .qc_issue = ata_qc_issue_prot, |
90 | 90 | ||
91 | .data_xfer = ata_pio_data_xfer_noirq, | 91 | .data_xfer = ata_data_xfer_noirq, |
92 | 92 | ||
93 | .irq_handler = ata_interrupt, | 93 | .irq_handler = ata_interrupt, |
94 | .irq_clear = ata_bmdma_irq_clear, | 94 | .irq_clear = ata_bmdma_irq_clear, |
@@ -121,6 +121,7 @@ static int pcmcia_init_one(struct pcmcia_device *pdev) | |||
121 | cistpl_cftable_entry_t *cfg; | 121 | cistpl_cftable_entry_t *cfg; |
122 | int pass, last_ret = 0, last_fn = 0, is_kme = 0, ret = -ENOMEM; | 122 | int pass, last_ret = 0, last_fn = 0, is_kme = 0, ret = -ENOMEM; |
123 | unsigned long io_base, ctl_base; | 123 | unsigned long io_base, ctl_base; |
124 | void __iomem *io_addr, *ctl_addr; | ||
124 | 125 | ||
125 | info = kzalloc(sizeof(*info), GFP_KERNEL); | 126 | info = kzalloc(sizeof(*info), GFP_KERNEL); |
126 | if (info == NULL) | 127 | if (info == NULL) |
@@ -231,10 +232,17 @@ next_entry: | |||
231 | CS_CHECK(RequestIRQ, pcmcia_request_irq(pdev, &pdev->irq)); | 232 | CS_CHECK(RequestIRQ, pcmcia_request_irq(pdev, &pdev->irq)); |
232 | CS_CHECK(RequestConfiguration, pcmcia_request_configuration(pdev, &pdev->conf)); | 233 | CS_CHECK(RequestConfiguration, pcmcia_request_configuration(pdev, &pdev->conf)); |
233 | 234 | ||
235 | /* iomap */ | ||
236 | ret = -ENOMEM; | ||
237 | io_addr = devm_ioport_map(&pdev->dev, io_base, 8); | ||
238 | ctl_addr = devm_ioport_map(&pdev->dev, ctl_base, 1); | ||
239 | if (!io_addr || !ctl_addr) | ||
240 | goto failed; | ||
241 | |||
234 | /* Success. Disable the IRQ nIEN line, do quirks */ | 242 | /* Success. Disable the IRQ nIEN line, do quirks */ |
235 | outb(0x02, ctl_base); | 243 | iowrite8(0x02, ctl_addr); |
236 | if (is_kme) | 244 | if (is_kme) |
237 | outb(0x81, ctl_base + 0x01); | 245 | iowrite8(0x81, ctl_addr + 0x01); |
238 | 246 | ||
239 | /* FIXME: Could be more ports at base + 0x10 but we only deal with | 247 | /* FIXME: Could be more ports at base + 0x10 but we only deal with |
240 | one right now */ | 248 | one right now */ |
@@ -256,11 +264,12 @@ next_entry: | |||
256 | ae.irq = pdev->irq.AssignedIRQ; | 264 | ae.irq = pdev->irq.AssignedIRQ; |
257 | ae.irq_flags = SA_SHIRQ; | 265 | ae.irq_flags = SA_SHIRQ; |
258 | ae.port_flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST; | 266 | ae.port_flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST; |
259 | ae.port[0].cmd_addr = io_base; | 267 | ae.port[0].cmd_addr = io_addr; |
260 | ae.port[0].altstatus_addr = ctl_base; | 268 | ae.port[0].altstatus_addr = ctl_addr; |
261 | ae.port[0].ctl_addr = ctl_base; | 269 | ae.port[0].ctl_addr = ctl_addr; |
262 | ata_std_ports(&ae.port[0]); | 270 | ata_std_ports(&ae.port[0]); |
263 | 271 | ||
272 | ret = -ENODEV; | ||
264 | if (ata_device_add(&ae) == 0) | 273 | if (ata_device_add(&ae) == 0) |
265 | goto failed; | 274 | goto failed; |
266 | 275 | ||