aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_isapnp.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/pata_isapnp.c')
-rw-r--r--drivers/ata/pata_isapnp.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/ata/pata_isapnp.c b/drivers/ata/pata_isapnp.c
index 38a42eae598e..4d9ab268cf28 100644
--- a/drivers/ata/pata_isapnp.c
+++ b/drivers/ata/pata_isapnp.c
@@ -53,7 +53,7 @@ static struct ata_port_operations isapnp_port_ops = {
53 .qc_prep = ata_qc_prep, 53 .qc_prep = ata_qc_prep,
54 .qc_issue = ata_qc_issue_prot, 54 .qc_issue = ata_qc_issue_prot,
55 55
56 .data_xfer = ata_pio_data_xfer, 56 .data_xfer = ata_data_xfer,
57 57
58 .irq_handler = ata_interrupt, 58 .irq_handler = ata_interrupt,
59 .irq_clear = ata_bmdma_irq_clear, 59 .irq_clear = ata_bmdma_irq_clear,
@@ -73,6 +73,7 @@ static struct ata_port_operations isapnp_port_ops = {
73static int isapnp_init_one(struct pnp_dev *idev, const struct pnp_device_id *dev_id) 73static int isapnp_init_one(struct pnp_dev *idev, const struct pnp_device_id *dev_id)
74{ 74{
75 struct ata_probe_ent ae; 75 struct ata_probe_ent ae;
76 void __iomem *cmd_addr, *ctl_addr;
76 77
77 if (pnp_port_valid(idev, 0) == 0) 78 if (pnp_port_valid(idev, 0) == 0)
78 return -ENODEV; 79 return -ENODEV;
@@ -81,6 +82,10 @@ static int isapnp_init_one(struct pnp_dev *idev, const struct pnp_device_id *dev
81 if (pnp_irq_valid(idev, 0) == 0) 82 if (pnp_irq_valid(idev, 0) == 0)
82 return -ENODEV; 83 return -ENODEV;
83 84
85 cmd_addr = devm_ioport_map(&idev->dev, pnp_port_start(idev, 0), 8);
86 if (!cmd_addr)
87 return -ENOMEM;
88
84 memset(&ae, 0, sizeof(struct ata_probe_ent)); 89 memset(&ae, 0, sizeof(struct ata_probe_ent));
85 INIT_LIST_HEAD(&ae.node); 90 INIT_LIST_HEAD(&ae.node);
86 ae.dev = &idev->dev; 91 ae.dev = &idev->dev;
@@ -91,11 +96,13 @@ static int isapnp_init_one(struct pnp_dev *idev, const struct pnp_device_id *dev
91 ae.irq = pnp_irq(idev, 0); 96 ae.irq = pnp_irq(idev, 0);
92 ae.irq_flags = 0; 97 ae.irq_flags = 0;
93 ae.port_flags = ATA_FLAG_SLAVE_POSS; 98 ae.port_flags = ATA_FLAG_SLAVE_POSS;
94 ae.port[0].cmd_addr = pnp_port_start(idev, 0); 99 ae.port[0].cmd_addr = cmd_addr;
95 100
96 if (pnp_port_valid(idev, 1) == 0) { 101 if (pnp_port_valid(idev, 1) == 0) {
97 ae.port[0].altstatus_addr = pnp_port_start(idev, 1); 102 ctl_addr = devm_ioport_map(&idev->dev,
98 ae.port[0].ctl_addr = pnp_port_start(idev, 1); 103 pnp_port_start(idev, 1), 1);
104 ae.port[0].altstatus_addr = ctl_addr;
105 ae.port[0].ctl_addr = ctl_addr;
99 ae.port_flags |= ATA_FLAG_SRST; 106 ae.port_flags |= ATA_FLAG_SRST;
100 } 107 }
101 ata_std_ports(&ae.port[0]); 108 ata_std_ports(&ae.port[0]);