fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / ide / ide-proc.c
index 84665e2..aa049da 100644 (file)
@@ -22,7 +22,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <asm/uaccess.h>
@@ -327,15 +326,24 @@ static int ide_replace_subdriver(ide_drive_t *drive, const char *driver)
 {
        struct device *dev = &drive->gendev;
        int ret = 1;
+       int err;
 
        down_write(&dev->bus->subsys.rwsem);
        device_release_driver(dev);
        /* FIXME: device can still be in use by previous driver */
        strlcpy(drive->driver_req, driver, sizeof(drive->driver_req));
-       device_attach(dev);
+       err = device_attach(dev);
+       if (err < 0)
+               printk(KERN_WARNING "IDE: %s: device_attach error: %d\n",
+                       __FUNCTION__, err);
        drive->driver_req[0] = 0;
-       if (dev->driver == NULL)
-               device_attach(dev);
+       if (dev->driver == NULL) {
+               err = device_attach(dev);
+               if (err < 0)
+                       printk(KERN_WARNING
+                               "IDE: %s: device_attach(2) error: %d\n",
+                               __FUNCTION__, err);
+       }
        if (dev->driver && !strcmp(dev->driver->name, driver))
                ret = 0;
        up_write(&dev->bus->subsys.rwsem);
@@ -377,6 +385,8 @@ static int proc_ide_read_media
                                break;
                case ide_floppy:media = "floppy\n";
                                break;
+               case ide_optical:media = "optical\n";
+                               break;
                default:        media = "UNKNOWN\n";
                                break;
        }
@@ -525,7 +535,12 @@ static int proc_print_driver(struct device_driver *drv, void *data)
 
 static int ide_drivers_show(struct seq_file *s, void *p)
 {
-       bus_for_each_drv(&ide_bus_type, NULL, s, proc_print_driver);
+       int err;
+
+       err = bus_for_each_drv(&ide_bus_type, NULL, s, proc_print_driver);
+       if (err < 0)
+               printk(KERN_WARNING "IDE: %s: bus_for_each_drv error: %d\n",
+                       __FUNCTION__, err);
        return 0;
 }