Merge master.kernel.org:/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog
[pandora-kernel.git] / drivers / ide / ide-proc.c
index c12f1b7..30a5780 100644 (file)
@@ -326,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);
@@ -376,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;
        }
@@ -402,7 +413,6 @@ void ide_add_proc_entries(struct proc_dir_entry *dir, ide_proc_entry_t *p, void
        while (p->name != NULL) {
                ent = create_proc_entry(p->name, p->mode, dir);
                if (!ent) return;
-               ent->nlink = 1;
                ent->data = data;
                ent->read_proc = p->read_proc;
                ent->write_proc = p->write_proc;
@@ -524,7 +534,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;
 }
 
@@ -533,7 +548,7 @@ static int ide_drivers_open(struct inode *inode, struct file *file)
        return single_open(file, &ide_drivers_show, NULL);
 }
 
-static struct file_operations ide_drivers_operations = {
+static const struct file_operations ide_drivers_operations = {
        .open           = ide_drivers_open,
        .read           = seq_read,
        .llseek         = seq_lseek,