diff options
author | Randy Dunlap <rdunlap@xenotime.net> | 2006-10-03 04:14:23 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-03 11:04:08 -0400 |
commit | 349ae23fe7379a42973bcb1c85f7d43ec583c17d (patch) | |
tree | 2f885e437a59a23f04161e9761b86a8421ab6ff7 /drivers/ide/ide-proc.c | |
parent | 5ac24697699b394cdebac0a2329ce3af247d6a3b (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-proc.c')
-rw-r--r-- | drivers/ide/ide-proc.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/drivers/ide/ide-proc.c b/drivers/ide/ide-proc.c index 41b74b13a00c..aa049dab3d95 100644 --- a/drivers/ide/ide-proc.c +++ b/drivers/ide/ide-proc.c | |||
@@ -326,15 +326,24 @@ static int ide_replace_subdriver(ide_drive_t *drive, const char *driver) | |||
326 | { | 326 | { |
327 | struct device *dev = &drive->gendev; | 327 | struct device *dev = &drive->gendev; |
328 | int ret = 1; | 328 | int ret = 1; |
329 | int err; | ||
329 | 330 | ||
330 | down_write(&dev->bus->subsys.rwsem); | 331 | down_write(&dev->bus->subsys.rwsem); |
331 | device_release_driver(dev); | 332 | device_release_driver(dev); |
332 | /* FIXME: device can still be in use by previous driver */ | 333 | /* FIXME: device can still be in use by previous driver */ |
333 | strlcpy(drive->driver_req, driver, sizeof(drive->driver_req)); | 334 | strlcpy(drive->driver_req, driver, sizeof(drive->driver_req)); |
334 | device_attach(dev); | 335 | err = device_attach(dev); |
336 | if (err < 0) | ||
337 | printk(KERN_WARNING "IDE: %s: device_attach error: %d\n", | ||
338 | __FUNCTION__, err); | ||
335 | drive->driver_req[0] = 0; | 339 | drive->driver_req[0] = 0; |
336 | if (dev->driver == NULL) | 340 | if (dev->driver == NULL) { |
337 | device_attach(dev); | 341 | err = device_attach(dev); |
342 | if (err < 0) | ||
343 | printk(KERN_WARNING | ||
344 | "IDE: %s: device_attach(2) error: %d\n", | ||
345 | __FUNCTION__, err); | ||
346 | } | ||
338 | if (dev->driver && !strcmp(dev->driver->name, driver)) | 347 | if (dev->driver && !strcmp(dev->driver->name, driver)) |
339 | ret = 0; | 348 | ret = 0; |
340 | up_write(&dev->bus->subsys.rwsem); | 349 | up_write(&dev->bus->subsys.rwsem); |
@@ -526,7 +535,12 @@ static int proc_print_driver(struct device_driver *drv, void *data) | |||
526 | 535 | ||
527 | static int ide_drivers_show(struct seq_file *s, void *p) | 536 | static int ide_drivers_show(struct seq_file *s, void *p) |
528 | { | 537 | { |
529 | bus_for_each_drv(&ide_bus_type, NULL, s, proc_print_driver); | 538 | int err; |
539 | |||
540 | err = bus_for_each_drv(&ide_bus_type, NULL, s, proc_print_driver); | ||
541 | if (err < 0) | ||
542 | printk(KERN_WARNING "IDE: %s: bus_for_each_drv error: %d\n", | ||
543 | __FUNCTION__, err); | ||
530 | return 0; | 544 | return 0; |
531 | } | 545 | } |
532 | 546 | ||