diff options
Diffstat (limited to 'drivers/ata/pata_ixp4xx_cf.c')
-rw-r--r-- | drivers/ata/pata_ixp4xx_cf.c | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/drivers/ata/pata_ixp4xx_cf.c b/drivers/ata/pata_ixp4xx_cf.c index c6f0e1927551..420c343e5711 100644 --- a/drivers/ata/pata_ixp4xx_cf.c +++ b/drivers/ata/pata_ixp4xx_cf.c | |||
@@ -129,8 +129,8 @@ static struct ata_port_operations ixp4xx_port_ops = { | |||
129 | .qc_issue = ata_qc_issue_prot, | 129 | .qc_issue = ata_qc_issue_prot, |
130 | .eng_timeout = ata_eng_timeout, | 130 | .eng_timeout = ata_eng_timeout, |
131 | .data_xfer = ixp4xx_mmio_data_xfer, | 131 | .data_xfer = ixp4xx_mmio_data_xfer, |
132 | .cable_detect = ata_cable_40wire, | ||
132 | 133 | ||
133 | .irq_handler = ata_interrupt, | ||
134 | .irq_clear = ixp4xx_irq_clear, | 134 | .irq_clear = ixp4xx_irq_clear, |
135 | .irq_on = ata_irq_on, | 135 | .irq_on = ata_irq_on, |
136 | .irq_ack = ata_irq_ack, | 136 | .irq_ack = ata_irq_ack, |
@@ -173,12 +173,12 @@ static void ixp4xx_setup_port(struct ata_ioports *ioaddr, | |||
173 | 173 | ||
174 | static __devinit int ixp4xx_pata_probe(struct platform_device *pdev) | 174 | static __devinit int ixp4xx_pata_probe(struct platform_device *pdev) |
175 | { | 175 | { |
176 | int ret; | ||
177 | unsigned int irq; | 176 | unsigned int irq; |
178 | struct resource *cs0, *cs1; | 177 | struct resource *cs0, *cs1; |
179 | struct ata_probe_ent ae; | 178 | struct ata_host *host; |
180 | 179 | struct ata_port *ap; | |
181 | struct ixp4xx_pata_data *data = pdev->dev.platform_data; | 180 | struct ixp4xx_pata_data *data = pdev->dev.platform_data; |
181 | int rc; | ||
182 | 182 | ||
183 | cs0 = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 183 | cs0 = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
184 | cs1 = platform_get_resource(pdev, IORESOURCE_MEM, 1); | 184 | cs1 = platform_get_resource(pdev, IORESOURCE_MEM, 1); |
@@ -186,6 +186,12 @@ static __devinit int ixp4xx_pata_probe(struct platform_device *pdev) | |||
186 | if (!cs0 || !cs1) | 186 | if (!cs0 || !cs1) |
187 | return -EINVAL; | 187 | return -EINVAL; |
188 | 188 | ||
189 | /* allocate host */ | ||
190 | host = ata_host_alloc(&pdev->dev, 1); | ||
191 | if (!host) | ||
192 | return -ENOMEM; | ||
193 | |||
194 | /* acquire resources and fill host */ | ||
189 | pdev->dev.coherent_dma_mask = DMA_32BIT_MASK; | 195 | pdev->dev.coherent_dma_mask = DMA_32BIT_MASK; |
190 | 196 | ||
191 | data->cs0 = devm_ioremap(&pdev->dev, cs0->start, 0x1000); | 197 | data->cs0 = devm_ioremap(&pdev->dev, cs0->start, 0x1000); |
@@ -199,32 +205,22 @@ static __devinit int ixp4xx_pata_probe(struct platform_device *pdev) | |||
199 | *data->cs0_cfg = data->cs0_bits; | 205 | *data->cs0_cfg = data->cs0_bits; |
200 | *data->cs1_cfg = data->cs1_bits; | 206 | *data->cs1_cfg = data->cs1_bits; |
201 | 207 | ||
202 | memset(&ae, 0, sizeof(struct ata_probe_ent)); | 208 | ap = host->ports[0]; |
203 | INIT_LIST_HEAD(&ae.node); | ||
204 | 209 | ||
205 | ae.dev = &pdev->dev; | 210 | ap->ops = &ixp4xx_port_ops; |
206 | ae.port_ops = &ixp4xx_port_ops; | 211 | ap->pio_mask = 0x1f; /* PIO4 */ |
207 | ae.sht = &ixp4xx_sht; | 212 | ap->flags |= ATA_FLAG_MMIO | ATA_FLAG_NO_LEGACY | ATA_FLAG_NO_ATAPI; |
208 | ae.n_ports = 1; | ||
209 | ae.pio_mask = 0x1f; /* PIO4 */ | ||
210 | ae.irq = irq; | ||
211 | ae.irq_flags = 0; | ||
212 | ae.port_flags = ATA_FLAG_MMIO | ATA_FLAG_NO_LEGACY | ||
213 | | ATA_FLAG_NO_ATAPI | ATA_FLAG_SRST; | ||
214 | 213 | ||
215 | /* run in polling mode if no irq has been assigned */ | 214 | /* run in polling mode if no irq has been assigned */ |
216 | if (!irq) | 215 | if (!irq) |
217 | ae.port_flags |= ATA_FLAG_PIO_POLLING; | 216 | ap->flags |= ATA_FLAG_PIO_POLLING; |
218 | 217 | ||
219 | ixp4xx_setup_port(&ae.port[0], data); | 218 | ixp4xx_setup_port(&ap->ioaddr, data); |
220 | 219 | ||
221 | dev_printk(KERN_INFO, &pdev->dev, "version " DRV_VERSION "\n"); | 220 | dev_printk(KERN_INFO, &pdev->dev, "version " DRV_VERSION "\n"); |
222 | 221 | ||
223 | ret = ata_device_add(&ae); | 222 | /* activate host */ |
224 | if (ret == 0) | 223 | return ata_host_activate(host, irq, ata_interrupt, 0, &ixp4xx_sht); |
225 | return -ENODEV; | ||
226 | |||
227 | return 0; | ||
228 | } | 224 | } |
229 | 225 | ||
230 | static __devexit int ixp4xx_pata_remove(struct platform_device *dev) | 226 | static __devexit int ixp4xx_pata_remove(struct platform_device *dev) |