diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-05 20:30:51 +0200 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-05 20:30:51 +0200 |
commit | 7cd95f56cb61f5348d062527c9d3653196f6e629 (patch) | |
tree | 8b26646d5add5812c06605cee0ecf5e4c0dc6e5a /drivers/ide/ide.c | |
parent | Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kern... (diff) | |
download | linux-7cd95f56cb61f5348d062527c9d3653196f6e629.tar.xz linux-7cd95f56cb61f5348d062527c9d3653196f6e629.zip |
ide: fix hwif->gendev refcounting
class->dev_release is called by device_release() iff dev->release
is not present so ide_port_class_release() is never called and the
last hwif->gendev reference is not dropped.
Fix it by removing ide_port_class_release() and get_device() call
from ide_register_port() (device_create_drvdata() takes a hwif->gendev
reference anyway).
This patch fixes hang on wait_for_completion(&hwif->gendev_rel_comp)
in ide_unregister() reported by Pavel Machek.
Cc: Pavel Machek <pavel@suse.cz>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide.c')
-rw-r--r-- | drivers/ide/ide.c | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index c758dcb13b14..246077792e21 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c @@ -1094,13 +1094,6 @@ struct bus_type ide_bus_type = { EXPORT_SYMBOL_GPL(ide_bus_type); -static void ide_port_class_release(struct device *portdev) -{ - ide_hwif_t *hwif = dev_get_drvdata(portdev); - - put_device(&hwif->gendev); -} - int ide_vlb_clk; EXPORT_SYMBOL_GPL(ide_vlb_clk); @@ -1305,7 +1298,6 @@ static int __init ide_init(void) ret = PTR_ERR(ide_port_class); goto out_port_class; } - ide_port_class->dev_release = ide_port_class_release; init_ide_data(); |