aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-probe.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-02-01 17:09:34 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-02-01 17:09:34 -0500
commit48535651f6a993924115768aa7256c371bf818e6 (patch)
tree627eadcd69bc46efe2c99493602cae714f83c534 /drivers/ide/ide-probe.c
parentc860a8f2d29b7da84fb3aed7b097f53c2c225fd6 (diff)
ide: remove hwif->present manipulations from hwif_init()
* Call hwif_init() only if hwif->present is set. * If hwif_init() fails clear hwif->present. * Remove hwif->present manipulations from hwif_init(). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-probe.c')
-rw-r--r--drivers/ide/ide-probe.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index b812b98744e8..00b2b07f63be 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -1245,28 +1245,21 @@ static int hwif_init(ide_hwif_t *hwif)
1245{ 1245{
1246 int old_irq; 1246 int old_irq;
1247 1247
1248 /* Return success if no device is connected */
1249 if (!hwif->present)
1250 return 1;
1251
1252 if (!hwif->irq) { 1248 if (!hwif->irq) {
1253 if (!(hwif->irq = ide_default_irq(hwif->io_ports[IDE_DATA_OFFSET]))) 1249 if (!(hwif->irq = ide_default_irq(hwif->io_ports[IDE_DATA_OFFSET])))
1254 { 1250 {
1255 printk("%s: DISABLED, NO IRQ\n", hwif->name); 1251 printk("%s: DISABLED, NO IRQ\n", hwif->name);
1256 return (hwif->present = 0); 1252 return 0;
1257 } 1253 }
1258 } 1254 }
1259#ifdef CONFIG_BLK_DEV_HD 1255#ifdef CONFIG_BLK_DEV_HD
1260 if (hwif->irq == HD_IRQ && hwif->io_ports[IDE_DATA_OFFSET] != HD_DATA) { 1256 if (hwif->irq == HD_IRQ && hwif->io_ports[IDE_DATA_OFFSET] != HD_DATA) {
1261 printk("%s: CANNOT SHARE IRQ WITH OLD " 1257 printk("%s: CANNOT SHARE IRQ WITH OLD "
1262 "HARDDISK DRIVER (hd.c)\n", hwif->name); 1258 "HARDDISK DRIVER (hd.c)\n", hwif->name);
1263 return (hwif->present = 0); 1259 return 0;
1264 } 1260 }
1265#endif /* CONFIG_BLK_DEV_HD */ 1261#endif /* CONFIG_BLK_DEV_HD */
1266 1262
1267 /* we set it back to 1 if all is ok below */
1268 hwif->present = 0;
1269
1270 if (register_blkdev(hwif->major, hwif->name)) 1263 if (register_blkdev(hwif->major, hwif->name))
1271 return 0; 1264 return 0;
1272 1265
@@ -1305,10 +1298,7 @@ static int hwif_init(ide_hwif_t *hwif)
1305 1298
1306done: 1299done:
1307 init_gendisk(hwif); 1300 init_gendisk(hwif);
1308
1309 ide_acpi_init(hwif); 1301 ide_acpi_init(hwif);
1310
1311 hwif->present = 1; /* success */
1312 return 1; 1302 return 1;
1313 1303
1314out: 1304out:
@@ -1352,9 +1342,13 @@ int ide_device_add_all(u8 *idx)
1352 1342
1353 hwif = &ide_hwifs[idx[i]]; 1343 hwif = &ide_hwifs[idx[i]];
1354 1344
1345 if (!hwif->present)
1346 continue;
1347
1355 if (hwif_init(hwif) == 0) { 1348 if (hwif_init(hwif) == 0) {
1356 printk(KERN_INFO "%s: failed to initialize IDE " 1349 printk(KERN_INFO "%s: failed to initialize IDE "
1357 "interface\n", hwif->name); 1350 "interface\n", hwif->name);
1351 hwif->present = 0;
1358 rc = -1; 1352 rc = -1;
1359 continue; 1353 continue;
1360 } 1354 }