aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ata/pata_platform.c31
1 files changed, 7 insertions, 24 deletions
diff --git a/drivers/ata/pata_platform.c b/drivers/ata/pata_platform.c
index 40ae11cbfda4..8a261a3daeda 100644
--- a/drivers/ata/pata_platform.c
+++ b/drivers/ata/pata_platform.c
@@ -47,23 +47,6 @@ static int pata_platform_set_mode(struct ata_port *ap, struct ata_device **unuse
47 return 0; 47 return 0;
48} 48}
49 49
50static void pata_platform_host_stop(struct ata_host *host)
51{
52 int i;
53
54 /*
55 * Unmap the bases for MMIO
56 */
57 for (i = 0; i < host->n_ports; i++) {
58 struct ata_port *ap = host->ports[i];
59
60 if (ap->flags & ATA_FLAG_MMIO) {
61 iounmap((void __iomem *)ap->ioaddr.ctl_addr);
62 iounmap((void __iomem *)ap->ioaddr.cmd_addr);
63 }
64 }
65}
66
67static struct scsi_host_template pata_platform_sht = { 50static struct scsi_host_template pata_platform_sht = {
68 .module = THIS_MODULE, 51 .module = THIS_MODULE,
69 .name = DRV_NAME, 52 .name = DRV_NAME,
@@ -106,8 +89,6 @@ static struct ata_port_operations pata_platform_port_ops = {
106 .irq_clear = ata_bmdma_irq_clear, 89 .irq_clear = ata_bmdma_irq_clear,
107 90
108 .port_start = ata_port_start, 91 .port_start = ata_port_start,
109 .port_stop = ata_port_stop,
110 .host_stop = pata_platform_host_stop
111}; 92};
112 93
113static void pata_platform_setup_port(struct ata_ioports *ioaddr, 94static void pata_platform_setup_port(struct ata_ioports *ioaddr,
@@ -209,15 +190,17 @@ static int __devinit pata_platform_probe(struct platform_device *pdev)
209 if (mmio) { 190 if (mmio) {
210 ae.port_flags |= ATA_FLAG_MMIO; 191 ae.port_flags |= ATA_FLAG_MMIO;
211 192
212 ae.port[0].cmd_addr = (unsigned long)ioremap(io_res->start, 193 ae.port[0].cmd_addr = (unsigned long)
213 io_res->end - io_res->start + 1); 194 devm_ioremap(&pdev->dev, io_res->start,
195 io_res->end - io_res->start + 1);
214 if (unlikely(!ae.port[0].cmd_addr)) { 196 if (unlikely(!ae.port[0].cmd_addr)) {
215 dev_err(&pdev->dev, "failed to remap IO base\n"); 197 dev_err(&pdev->dev, "failed to remap IO base\n");
216 return -ENXIO; 198 return -ENXIO;
217 } 199 }
218 200
219 ae.port[0].ctl_addr = (unsigned long)ioremap(ctl_res->start, 201 ae.port[0].ctl_addr = (unsigned long)
220 ctl_res->end - ctl_res->start + 1); 202 devm_ioremap(&pdev->dev, ctl_res->start,
203 ctl_res->end - ctl_res->start + 1);
221 if (unlikely(!ae.port[0].ctl_addr)) { 204 if (unlikely(!ae.port[0].ctl_addr)) {
222 dev_err(&pdev->dev, "failed to remap CTL base\n"); 205 dev_err(&pdev->dev, "failed to remap CTL base\n");
223 ret = -ENXIO; 206 ret = -ENXIO;
@@ -261,7 +244,7 @@ static int __devexit pata_platform_remove(struct platform_device *pdev)
261 struct device *dev = &pdev->dev; 244 struct device *dev = &pdev->dev;
262 struct ata_host *host = dev_get_drvdata(dev); 245 struct ata_host *host = dev_get_drvdata(dev);
263 246
264 ata_host_remove(host); 247 ata_host_detach(host);
265 dev_set_drvdata(dev, NULL); 248 dev_set_drvdata(dev, NULL);
266 249
267 return 0; 250 return 0;