提交 c4011101 编写于 作者: G Greg Kroah-Hartman

IDE: remove rwsem use from ide-proc core

The subsystem rwsem is not used by the driver core at all, so the use of
it in the ide-proc code of it doesn't make any sense.  Perhaps a local
lock might be needed, but I do not really think so.

Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Cc: linux ide <linux-ide@vger.kernel.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 79580057
...@@ -310,14 +310,12 @@ static int proc_ide_read_driver ...@@ -310,14 +310,12 @@ static int proc_ide_read_driver
ide_driver_t *ide_drv; ide_driver_t *ide_drv;
int len; int len;
down_read(&dev->bus->subsys.rwsem);
if (dev->driver) { if (dev->driver) {
ide_drv = container_of(dev->driver, ide_driver_t, gen_driver); ide_drv = container_of(dev->driver, ide_driver_t, gen_driver);
len = sprintf(page, "%s version %s\n", len = sprintf(page, "%s version %s\n",
dev->driver->name, ide_drv->version); dev->driver->name, ide_drv->version);
} else } else
len = sprintf(page, "ide-default version 0.9.newide\n"); len = sprintf(page, "ide-default version 0.9.newide\n");
up_read(&dev->bus->subsys.rwsem);
PROC_IDE_READ_RETURN(page,start,off,count,eof,len); PROC_IDE_READ_RETURN(page,start,off,count,eof,len);
} }
...@@ -327,7 +325,6 @@ static int ide_replace_subdriver(ide_drive_t *drive, const char *driver) ...@@ -327,7 +325,6 @@ static int ide_replace_subdriver(ide_drive_t *drive, const char *driver)
int ret = 1; int ret = 1;
int err; int err;
down_write(&dev->bus->subsys.rwsem);
device_release_driver(dev); device_release_driver(dev);
/* FIXME: device can still be in use by previous driver */ /* FIXME: device can still be in use by previous driver */
strlcpy(drive->driver_req, driver, sizeof(drive->driver_req)); strlcpy(drive->driver_req, driver, sizeof(drive->driver_req));
...@@ -345,7 +342,6 @@ static int ide_replace_subdriver(ide_drive_t *drive, const char *driver) ...@@ -345,7 +342,6 @@ static int ide_replace_subdriver(ide_drive_t *drive, const char *driver)
} }
if (dev->driver && !strcmp(dev->driver->name, driver)) if (dev->driver && !strcmp(dev->driver->name, driver))
ret = 0; ret = 0;
up_write(&dev->bus->subsys.rwsem);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册