summaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-gd.h
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-02-25 20:28:24 +0100
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-02-25 20:28:24 +0100
commit8fed43684174b68f04d01d1210fd00536af790df (patch)
treedf8d5f87c68526267d0ae320173814ed3f417fd5 /drivers/ide/ide-gd.h
parentd3dd7107f4d843d0f01d0f77d49a7c5449130577 (diff)
downloadlinux-8fed43684174b68f04d01d1210fd00536af790df.tar.bz2
ide: fix refcounting in device drivers
During host driver module removal del_gendisk() results in a final put on drive->gendev and freeing the drive by drive_release_dev(). Convert device drivers from using struct kref to use struct device so device driver's object holds reference on ->gendev and prevents drive from prematurely going away. Also fix ->remove methods to not erroneously drop reference on a host driver by using only put_device() instead of ide*_put(). Reported-by: Stanislaw Gruszka <stf_xl@wp.pl> Tested-by: Stanislaw Gruszka <stf_xl@wp.pl> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-gd.h')
-rw-r--r--drivers/ide/ide-gd.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/ide/ide-gd.h b/drivers/ide/ide-gd.h
index a86779f0756b..b604bdd318a1 100644
--- a/drivers/ide/ide-gd.h
+++ b/drivers/ide/ide-gd.h
@@ -17,7 +17,7 @@ struct ide_disk_obj {
ide_drive_t *drive;
struct ide_driver *driver;
struct gendisk *disk;
- struct kref kref;
+ struct device dev;
unsigned int openers; /* protected by BKL for now */
/* Last failed packet command */