aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-probe.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide-probe.c')
-rw-r--r--drivers/ide/ide-probe.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 34b0d4f26b58..d27061b39324 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -646,15 +646,12 @@ static int ide_register_port(ide_hwif_t *hwif)
646 goto out; 646 goto out;
647 } 647 }
648 648
649 get_device(&hwif->gendev); 649 hwif->portdev = device_create_drvdata(ide_port_class, &hwif->gendev,
650 650 MKDEV(0, 0), hwif, hwif->name);
651 hwif->portdev = device_create(ide_port_class, &hwif->gendev,
652 MKDEV(0, 0), hwif->name);
653 if (IS_ERR(hwif->portdev)) { 651 if (IS_ERR(hwif->portdev)) {
654 ret = PTR_ERR(hwif->portdev); 652 ret = PTR_ERR(hwif->portdev);
655 device_unregister(&hwif->gendev); 653 device_unregister(&hwif->gendev);
656 } 654 }
657 dev_set_drvdata(hwif->portdev, hwif);
658out: 655out:
659 return ret; 656 return ret;
660} 657}
@@ -1334,8 +1331,7 @@ static void ide_port_init_devices(ide_hwif_t *hwif)
1334static void ide_init_port(ide_hwif_t *hwif, unsigned int port, 1331static void ide_init_port(ide_hwif_t *hwif, unsigned int port,
1335 const struct ide_port_info *d) 1332 const struct ide_port_info *d)
1336{ 1333{
1337 if (d->chipset != ide_etrax100) 1334 hwif->channel = port;
1338 hwif->channel = port;
1339 1335
1340 if (d->chipset) 1336 if (d->chipset)
1341 hwif->chipset = d->chipset; 1337 hwif->chipset = d->chipset;
@@ -1520,7 +1516,7 @@ int ide_device_add_all(u8 *idx, const struct ide_port_info *d)
1520 continue; 1516 continue;
1521 } 1517 }
1522 1518
1523 if (d->chipset != ide_etrax100 && (i & 1) && mate) { 1519 if ((i & 1) && mate) {
1524 hwif->mate = mate; 1520 hwif->mate = mate;
1525 mate->mate = hwif; 1521 mate->mate = hwif;
1526 } 1522 }
@@ -1666,6 +1662,7 @@ static void ide_legacy_init_one(u8 *idx, hw_regs_t *hw, u8 port_no,
1666 1662
1667 ide_std_init_ports(hw, base, ctl); 1663 ide_std_init_ports(hw, base, ctl);
1668 hw->irq = irq; 1664 hw->irq = irq;
1665 hw->chipset = d->chipset;
1669 1666
1670 hwif = ide_find_port_slot(d); 1667 hwif = ide_find_port_slot(d);
1671 if (hwif) { 1668 if (hwif) {