aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/pata_pcmcia.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/drivers/ata/pata_pcmcia.c b/drivers/ata/pata_pcmcia.c
index 1fcd0659b3f2..e944aa0c5517 100644
--- a/drivers/ata/pata_pcmcia.c
+++ b/drivers/ata/pata_pcmcia.c
@@ -200,21 +200,23 @@ static int pcmcia_check_one_config(struct pcmcia_device *pdev,
200 200
201 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 201 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
202 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; 202 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
203 pdev->io.BasePort1 = io->win[0].base; 203 pdev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
204 pdev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; 204 pdev->resource[0]->start = io->win[0].base;
205 if (!(io->flags & CISTPL_IO_16BIT)) 205 if (!(io->flags & CISTPL_IO_16BIT)) {
206 pdev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 206 pdev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
207 pdev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
208 }
207 if (io->nwin == 2) { 209 if (io->nwin == 2) {
208 pdev->io.NumPorts1 = 8; 210 pdev->resource[0]->end = 8;
209 pdev->io.BasePort2 = io->win[1].base; 211 pdev->resource[1]->start = io->win[1].base;
210 pdev->io.NumPorts2 = (stk->is_kme) ? 2 : 1; 212 pdev->resource[1]->end = (stk->is_kme) ? 2 : 1;
211 if (pcmcia_request_io(pdev, &pdev->io) != 0) 213 if (pcmcia_request_io(pdev) != 0)
212 return -ENODEV; 214 return -ENODEV;
213 stk->ctl_base = pdev->resource[1]->start; 215 stk->ctl_base = pdev->resource[1]->start;
214 } else if ((io->nwin == 1) && (io->win[0].len >= 16)) { 216 } else if ((io->nwin == 1) && (io->win[0].len >= 16)) {
215 pdev->io.NumPorts1 = io->win[0].len; 217 pdev->resource[0]->end = io->win[0].len;
216 pdev->io.NumPorts2 = 0; 218 pdev->resource[1]->end = 0;
217 if (pcmcia_request_io(pdev, &pdev->io) != 0) 219 if (pcmcia_request_io(pdev) != 0)
218 return -ENODEV; 220 return -ENODEV;
219 stk->ctl_base = pdev->resource[0]->start + 0x0e; 221 stk->ctl_base = pdev->resource[0]->start + 0x0e;
220 } else 222 } else
@@ -245,9 +247,8 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)
245 struct ata_port_operations *ops = &pcmcia_port_ops; 247 struct ata_port_operations *ops = &pcmcia_port_ops;
246 248
247 /* Set up attributes in order to probe card and get resources */ 249 /* Set up attributes in order to probe card and get resources */
248 pdev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 250 pdev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
249 pdev->io.Attributes2 = IO_DATA_PATH_WIDTH_8; 251 pdev->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
250 pdev->io.IOAddrLines = 3;
251 pdev->conf.Attributes = CONF_ENABLE_IRQ; 252 pdev->conf.Attributes = CONF_ENABLE_IRQ;
252 pdev->conf.IntType = INT_MEMORY_AND_IO; 253 pdev->conf.IntType = INT_MEMORY_AND_IO;
253 254