ide: move ide_pci_setup_ports() call out from do_ide_setup_pci_device()
* Move ide_pci_setup_ports() call out from do_ide_setup_pci_device() to ide_setup_pci_device[s](). * Drop no longer needed idx argument from do_ide_setup_pci_device(). There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
This commit is contained in:
parent
b36ba53218
commit
51d87ed0aa
1 changed files with 13 additions and 7 deletions
|
@ -480,7 +480,7 @@ EXPORT_SYMBOL_GPL(ide_pci_setup_ports);
|
||||||
*/
|
*/
|
||||||
static int do_ide_setup_pci_device(struct pci_dev *dev,
|
static int do_ide_setup_pci_device(struct pci_dev *dev,
|
||||||
const struct ide_port_info *d,
|
const struct ide_port_info *d,
|
||||||
u8 *idx, u8 noisy)
|
u8 noisy)
|
||||||
{
|
{
|
||||||
int tried_config = 0;
|
int tried_config = 0;
|
||||||
int pciirq, ret;
|
int pciirq, ret;
|
||||||
|
@ -529,9 +529,7 @@ static int do_ide_setup_pci_device(struct pci_dev *dev,
|
||||||
d->name, pciirq);
|
d->name, pciirq);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: silent failure can happen */
|
ret = pciirq;
|
||||||
|
|
||||||
ide_pci_setup_ports(dev, d, pciirq, idx);
|
|
||||||
out:
|
out:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -541,10 +539,14 @@ int ide_setup_pci_device(struct pci_dev *dev, const struct ide_port_info *d)
|
||||||
u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
|
u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = do_ide_setup_pci_device(dev, d, &idx[0], 1);
|
ret = do_ide_setup_pci_device(dev, d, 1);
|
||||||
|
|
||||||
|
if (ret >= 0) {
|
||||||
|
/* FIXME: silent failure can happen */
|
||||||
|
ide_pci_setup_ports(dev, d, ret, &idx[0]);
|
||||||
|
|
||||||
if (ret >= 0)
|
|
||||||
ide_device_add(idx, d);
|
ide_device_add(idx, d);
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -558,13 +560,17 @@ int ide_setup_pci_devices(struct pci_dev *dev1, struct pci_dev *dev2,
|
||||||
u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
|
u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
|
||||||
|
|
||||||
for (i = 0; i < 2; i++) {
|
for (i = 0; i < 2; i++) {
|
||||||
ret = do_ide_setup_pci_device(pdev[i], d, &idx[i*2], !i);
|
ret = do_ide_setup_pci_device(pdev[i], d, !i);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* FIXME: Mom, mom, they stole me the helper function to undo
|
* FIXME: Mom, mom, they stole me the helper function to undo
|
||||||
* do_ide_setup_pci_device() on the first device!
|
* do_ide_setup_pci_device() on the first device!
|
||||||
*/
|
*/
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
/* FIXME: silent failure can happen */
|
||||||
|
ide_pci_setup_ports(pdev[i], d, ret, &idx[i*2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
ide_device_add(idx, d);
|
ide_device_add(idx, d);
|
||||||
|
|
Loading…
Add table
Reference in a new issue