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.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 34b0d4f26b58..26e68b65b7cf 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}
@@ -1221,16 +1218,12 @@ static void drive_release_dev (struct device *dev)
1221 complete(&drive->gendev_rel_comp); 1218 complete(&drive->gendev_rel_comp);
1222} 1219}
1223 1220
1224#ifndef ide_default_irq
1225#define ide_default_irq(irq) 0
1226#endif
1227
1228static int hwif_init(ide_hwif_t *hwif) 1221static int hwif_init(ide_hwif_t *hwif)
1229{ 1222{
1230 int old_irq; 1223 int old_irq;
1231 1224
1232 if (!hwif->irq) { 1225 if (!hwif->irq) {
1233 hwif->irq = ide_default_irq(hwif->io_ports.data_addr); 1226 hwif->irq = __ide_default_irq(hwif->io_ports.data_addr);
1234 if (!hwif->irq) { 1227 if (!hwif->irq) {
1235 printk("%s: DISABLED, NO IRQ\n", hwif->name); 1228 printk("%s: DISABLED, NO IRQ\n", hwif->name);
1236 return 0; 1229 return 0;
@@ -1260,7 +1253,7 @@ static int hwif_init(ide_hwif_t *hwif)
1260 * It failed to initialise. Find the default IRQ for 1253 * It failed to initialise. Find the default IRQ for
1261 * this port and try that. 1254 * this port and try that.
1262 */ 1255 */
1263 hwif->irq = ide_default_irq(hwif->io_ports.data_addr); 1256 hwif->irq = __ide_default_irq(hwif->io_ports.data_addr);
1264 if (!hwif->irq) { 1257 if (!hwif->irq) {
1265 printk("%s: Disabled unable to get IRQ %d.\n", 1258 printk("%s: Disabled unable to get IRQ %d.\n",
1266 hwif->name, old_irq); 1259 hwif->name, old_irq);
@@ -1334,8 +1327,7 @@ static void ide_port_init_devices(ide_hwif_t *hwif)
1334static void ide_init_port(ide_hwif_t *hwif, unsigned int port, 1327static void ide_init_port(ide_hwif_t *hwif, unsigned int port,
1335 const struct ide_port_info *d) 1328 const struct ide_port_info *d)
1336{ 1329{
1337 if (d->chipset != ide_etrax100) 1330 hwif->channel = port;
1338 hwif->channel = port;
1339 1331
1340 if (d->chipset) 1332 if (d->chipset)
1341 hwif->chipset = d->chipset; 1333 hwif->chipset = d->chipset;
@@ -1520,7 +1512,7 @@ int ide_device_add_all(u8 *idx, const struct ide_port_info *d)
1520 continue; 1512 continue;
1521 } 1513 }
1522 1514
1523 if (d->chipset != ide_etrax100 && (i & 1) && mate) { 1515 if ((i & 1) && mate) {
1524 hwif->mate = mate; 1516 hwif->mate = mate;
1525 mate->mate = hwif; 1517 mate->mate = hwif;
1526 } 1518 }
@@ -1666,6 +1658,7 @@ static void ide_legacy_init_one(u8 *idx, hw_regs_t *hw, u8 port_no,
1666 1658
1667 ide_std_init_ports(hw, base, ctl); 1659 ide_std_init_ports(hw, base, ctl);
1668 hw->irq = irq; 1660 hw->irq = irq;
1661 hw->chipset = d->chipset;
1669 1662
1670 hwif = ide_find_port_slot(d); 1663 hwif = ide_find_port_slot(d);
1671 if (hwif) { 1664 if (hwif) {