diff options
Diffstat (limited to 'drivers/ata/pata_pcmcia.c')
-rw-r--r-- | drivers/ata/pata_pcmcia.c | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/drivers/ata/pata_pcmcia.c b/drivers/ata/pata_pcmcia.c index 76da55d27e08..954f43c512f1 100644 --- a/drivers/ata/pata_pcmcia.c +++ b/drivers/ata/pata_pcmcia.c @@ -169,34 +169,16 @@ static struct ata_port_operations pcmcia_8bit_port_ops = { struct pcmcia_config_check { unsigned long ctl_base; - int skip_vcc; int is_kme; }; static int pcmcia_check_one_config(struct pcmcia_device *pdev, cistpl_cftable_entry_t *cfg, cistpl_cftable_entry_t *dflt, - unsigned int vcc, void *priv_data) { struct pcmcia_config_check *stk = priv_data; - /* Check for matching Vcc, unless we're desperate */ - if (!stk->skip_vcc) { - if (cfg->vcc.present & (1 << CISTPL_POWER_VNOM)) { - if (vcc != cfg->vcc.param[CISTPL_POWER_VNOM] / 10000) - return -ENODEV; - } else if (dflt->vcc.present & (1 << CISTPL_POWER_VNOM)) { - if (vcc != dflt->vcc.param[CISTPL_POWER_VNOM] / 10000) - return -ENODEV; - } - } - - if (cfg->vpp1.present & (1 << CISTPL_POWER_VNOM)) - pdev->vpp = cfg->vpp1.param[CISTPL_POWER_VNOM] / 10000; - else if (dflt->vpp1.present & (1 << CISTPL_POWER_VNOM)) - pdev->vpp = dflt->vpp1.param[CISTPL_POWER_VNOM] / 10000; - if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; pdev->io_lines = io->flags & CISTPL_IO_LINES_MASK; @@ -249,6 +231,7 @@ static int pcmcia_init_one(struct pcmcia_device *pdev) pdev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO; pdev->resource[1]->flags |= IO_DATA_PATH_WIDTH_8; pdev->config_flags |= CONF_ENABLE_IRQ; + pdev->config_flags |= CONF_AUTO_SET_VPP | CONF_AUTO_CHECK_VCC; /* See if we have a manufacturer identifier. Use it to set is_kme for vendor quirks */ @@ -262,10 +245,10 @@ static int pcmcia_init_one(struct pcmcia_device *pdev) if (!stk) goto out1; stk->is_kme = is_kme; - stk->skip_vcc = io_base = ctl_base = 0; + io_base = ctl_base = 0; if (pcmcia_loop_config(pdev, pcmcia_check_one_config, stk)) { - stk->skip_vcc = 1; + pdev->config_flags &= ~CONF_AUTO_CHECK_VCC; if (pcmcia_loop_config(pdev, pcmcia_check_one_config, stk)) goto failed; /* No suitable config found */ } |