summaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-probe.c
diff options
context:
space:
mode:
authorRandy Dunlap <rdunlap@xenotime.net>2006-10-03 01:14:23 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-03 08:04:08 -0700
commit349ae23fe7379a42973bcb1c85f7d43ec583c17d (patch)
tree2f885e437a59a23f04161e9761b86a8421ab6ff7 /drivers/ide/ide-probe.c
parent5ac24697699b394cdebac0a2329ce3af247d6a3b (diff)
[PATCH] IDE core: driver layer error checking
Check driver layer return values in IDE core. Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/ide/ide-probe.c')
-rw-r--r--drivers/ide/ide-probe.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 9cadf0106c6..dad9c47ebb6 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -623,6 +623,8 @@ static void hwif_release_dev (struct device *dev)
static void hwif_register (ide_hwif_t *hwif)
{
+ int ret;
+
/* register with global device tree */
strlcpy(hwif->gendev.bus_id,hwif->name,BUS_ID_SIZE);
hwif->gendev.driver_data = hwif;
@@ -634,7 +636,10 @@ static void hwif_register (ide_hwif_t *hwif)
hwif->gendev.parent = NULL;
}
hwif->gendev.release = hwif_release_dev;
- device_register(&hwif->gendev);
+ ret = device_register(&hwif->gendev);
+ if (ret < 0)
+ printk(KERN_WARNING "IDE: %s: device_register error: %d\n",
+ __FUNCTION__, ret);
}
static int wait_hwif_ready(ide_hwif_t *hwif)
@@ -884,13 +889,19 @@ int probe_hwif_init_with_fixup(ide_hwif_t *hwif, void (*fixup)(ide_hwif_t *hwif)
if (hwif->present) {
u16 unit = 0;
+ int ret;
+
for (unit = 0; unit < MAX_DRIVES; ++unit) {
ide_drive_t *drive = &hwif->drives[unit];
/* For now don't attach absent drives, we may
want them on default or a new "empty" class
for hotplug reprobing ? */
if (drive->present) {
- device_register(&drive->gendev);
+ ret = device_register(&drive->gendev);
+ if (ret < 0)
+ printk(KERN_WARNING "IDE: %s: "
+ "device_register error: %d\n",
+ __FUNCTION__, ret);
}
}
}
@@ -1409,8 +1420,14 @@ int ideprobe_init (void)
if (hwif->chipset == ide_unknown || hwif->chipset == ide_forced)
hwif->chipset = ide_generic;
for (unit = 0; unit < MAX_DRIVES; ++unit)
- if (hwif->drives[unit].present)
- device_register(&hwif->drives[unit].gendev);
+ if (hwif->drives[unit].present) {
+ int ret = device_register(
+ &hwif->drives[unit].gendev);
+ if (ret < 0)
+ printk(KERN_WARNING "IDE: %s: "
+ "device_register error: %d\n",
+ __FUNCTION__, ret);
+ }
}
}
return 0;