aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_ixp4xx_cf.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/pata_ixp4xx_cf.c')
-rw-r--r--drivers/ata/pata_ixp4xx_cf.c50
1 files changed, 21 insertions, 29 deletions
diff --git a/drivers/ata/pata_ixp4xx_cf.c b/drivers/ata/pata_ixp4xx_cf.c
index 23b8aab3ebd8..3222ac7b945d 100644
--- a/drivers/ata/pata_ixp4xx_cf.c
+++ b/drivers/ata/pata_ixp4xx_cf.c
@@ -95,14 +95,6 @@ static void ixp4xx_irq_clear(struct ata_port *ap)
95{ 95{
96} 96}
97 97
98static void ixp4xx_host_stop (struct ata_host *host)
99{
100 struct ixp4xx_pata_data *data = host->dev->platform_data;
101
102 iounmap(data->cs0);
103 iounmap(data->cs1);
104}
105
106static struct scsi_host_template ixp4xx_sht = { 98static struct scsi_host_template ixp4xx_sht = {
107 .module = THIS_MODULE, 99 .module = THIS_MODULE,
108 .name = DRV_NAME, 100 .name = DRV_NAME,
@@ -139,10 +131,10 @@ static struct ata_port_operations ixp4xx_port_ops = {
139 131
140 .irq_handler = ata_interrupt, 132 .irq_handler = ata_interrupt,
141 .irq_clear = ixp4xx_irq_clear, 133 .irq_clear = ixp4xx_irq_clear,
134 .irq_on = ata_irq_on,
135 .irq_ack = ata_irq_ack,
142 136
143 .port_start = ata_port_start, 137 .port_start = ata_port_start,
144 .port_stop = ata_port_stop,
145 .host_stop = ixp4xx_host_stop,
146 138
147 .phy_reset = ixp4xx_phy_reset, 139 .phy_reset = ixp4xx_phy_reset,
148}; 140};
@@ -150,9 +142,9 @@ static struct ata_port_operations ixp4xx_port_ops = {
150static void ixp4xx_setup_port(struct ata_ioports *ioaddr, 142static void ixp4xx_setup_port(struct ata_ioports *ioaddr,
151 struct ixp4xx_pata_data *data) 143 struct ixp4xx_pata_data *data)
152{ 144{
153 ioaddr->cmd_addr = (unsigned long) data->cs0; 145 ioaddr->cmd_addr = data->cs0;
154 ioaddr->altstatus_addr = (unsigned long) data->cs1 + 0x06; 146 ioaddr->altstatus_addr = data->cs1 + 0x06;
155 ioaddr->ctl_addr = (unsigned long) data->cs1 + 0x06; 147 ioaddr->ctl_addr = data->cs1 + 0x06;
156 148
157 ata_std_ports(ioaddr); 149 ata_std_ports(ioaddr);
158 150
@@ -162,19 +154,19 @@ static void ixp4xx_setup_port(struct ata_ioports *ioaddr,
162 * ixp4xx in little endian mode. 154 * ixp4xx in little endian mode.
163 */ 155 */
164 156
165 ioaddr->data_addr ^= 0x02; 157 *(unsigned long *)&ioaddr->data_addr ^= 0x02;
166 ioaddr->cmd_addr ^= 0x03; 158 *(unsigned long *)&ioaddr->cmd_addr ^= 0x03;
167 ioaddr->altstatus_addr ^= 0x03; 159 *(unsigned long *)&ioaddr->altstatus_addr ^= 0x03;
168 ioaddr->ctl_addr ^= 0x03; 160 *(unsigned long *)&ioaddr->ctl_addr ^= 0x03;
169 ioaddr->error_addr ^= 0x03; 161 *(unsigned long *)&ioaddr->error_addr ^= 0x03;
170 ioaddr->feature_addr ^= 0x03; 162 *(unsigned long *)&ioaddr->feature_addr ^= 0x03;
171 ioaddr->nsect_addr ^= 0x03; 163 *(unsigned long *)&ioaddr->nsect_addr ^= 0x03;
172 ioaddr->lbal_addr ^= 0x03; 164 *(unsigned long *)&ioaddr->lbal_addr ^= 0x03;
173 ioaddr->lbam_addr ^= 0x03; 165 *(unsigned long *)&ioaddr->lbam_addr ^= 0x03;
174 ioaddr->lbah_addr ^= 0x03; 166 *(unsigned long *)&ioaddr->lbah_addr ^= 0x03;
175 ioaddr->device_addr ^= 0x03; 167 *(unsigned long *)&ioaddr->device_addr ^= 0x03;
176 ioaddr->status_addr ^= 0x03; 168 *(unsigned long *)&ioaddr->status_addr ^= 0x03;
177 ioaddr->command_addr ^= 0x03; 169 *(unsigned long *)&ioaddr->command_addr ^= 0x03;
178#endif 170#endif
179} 171}
180 172
@@ -195,8 +187,8 @@ static __devinit int ixp4xx_pata_probe(struct platform_device *pdev)
195 187
196 pdev->dev.coherent_dma_mask = DMA_32BIT_MASK; 188 pdev->dev.coherent_dma_mask = DMA_32BIT_MASK;
197 189
198 data->cs0 = ioremap(cs0->start, 0x1000); 190 data->cs0 = devm_ioremap(&pdev->dev, cs0->start, 0x1000);
199 data->cs1 = ioremap(cs1->start, 0x1000); 191 data->cs1 = devm_ioremap(&pdev->dev, cs1->start, 0x1000);
200 192
201 irq = platform_get_irq(pdev, 0); 193 irq = platform_get_irq(pdev, 0);
202 if (irq) 194 if (irq)
@@ -238,7 +230,7 @@ static __devexit int ixp4xx_pata_remove(struct platform_device *dev)
238{ 230{
239 struct ata_host *host = platform_get_drvdata(dev); 231 struct ata_host *host = platform_get_drvdata(dev);
240 232
241 ata_host_remove(host); 233 ata_host_detach(host);
242 platform_set_drvdata(dev, NULL); 234 platform_set_drvdata(dev, NULL);
243 235
244 return 0; 236 return 0;