ide: fix hwif->gendev refcounting
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Sat, 5 Jul 2008 18:30:51 +0000 (20:30 +0200)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Sat, 5 Jul 2008 18:30:51 +0000 (20:30 +0200)
commit7cd95f56cb61f5348d062527c9d3653196f6e629
tree8b26646d5add5812c06605cee0ecf5e4c0dc6e5a
parentb8a0b6ccf2ba2519ace65d782b41ee91bf3c3778
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>
drivers/ide/ide-probe.c
drivers/ide/ide.c