ide: remove ide_driver_proc_write
authorChristoph Hellwig <hch@lst.de>
Fri, 13 Apr 2018 19:22:21 +0000 (21:22 +0200)
committerChristoph Hellwig <hch@lst.de>
Wed, 16 May 2018 05:24:30 +0000 (07:24 +0200)
The driver proc file hasn't been writeable for a long time, so this is
just dead code.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
drivers/ide/ide-proc.c

index 863db44c79169632e4f66bfe5ae13acf79764151..b3b8b8822d6aa37a6b4be64888710ae5064e1d67 100644 (file)
@@ -528,58 +528,12 @@ static int ide_driver_proc_open(struct inode *inode, struct file *file)
        return single_open(file, ide_driver_proc_show, PDE_DATA(inode));
 }
 
-static int ide_replace_subdriver(ide_drive_t *drive, const char *driver)
-{
-       struct device *dev = &drive->gendev;
-       int ret = 1;
-       int err;
-
-       device_release_driver(dev);
-       /* FIXME: device can still be in use by previous driver */
-       strlcpy(drive->driver_req, driver, sizeof(drive->driver_req));
-       err = device_attach(dev);
-       if (err < 0)
-               printk(KERN_WARNING "IDE: %s: device_attach error: %d\n",
-                       __func__, err);
-       drive->driver_req[0] = 0;
-       if (dev->driver == NULL) {
-               err = device_attach(dev);
-               if (err < 0)
-                       printk(KERN_WARNING
-                               "IDE: %s: device_attach(2) error: %d\n",
-                               __func__, err);
-       }
-       if (dev->driver && !strcmp(dev->driver->name, driver))
-               ret = 0;
-
-       return ret;
-}
-
-static ssize_t ide_driver_proc_write(struct file *file, const char __user *buffer,
-                                    size_t count, loff_t *pos)
-{
-       ide_drive_t     *drive = PDE_DATA(file_inode(file));
-       char name[32];
-
-       if (!capable(CAP_SYS_ADMIN))
-               return -EACCES;
-       if (count > 31)
-               count = 31;
-       if (copy_from_user(name, buffer, count))
-               return -EFAULT;
-       name[count] = '\0';
-       if (ide_replace_subdriver(drive, name))
-               return -EINVAL;
-       return count;
-}
-
 static const struct file_operations ide_driver_proc_fops = {
        .owner          = THIS_MODULE,
        .open           = ide_driver_proc_open,
        .read           = seq_read,
        .llseek         = seq_lseek,
        .release        = single_release,
-       .write          = ide_driver_proc_write,
 };
 
 static int ide_media_proc_show(struct seq_file *m, void *v)