diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-10-17 18:09:09 +0200 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-10-17 18:09:09 +0200 |
commit | d7e747596829c1c11833ca0a1f5e64f400d20bf2 (patch) | |
tree | 3ca99d61a3e05399bea3969a588011e235ca5f7a /drivers | |
parent | 9c3ba7692bc1166c6a5d06fb7c59984f9f988a00 (diff) |
ide-disk: use to_ide_drv() and ide_drv_g()
There should be no functional changes caused by this patch.
Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ide/ide-disk.c | 14 | ||||
-rw-r--r-- | drivers/ide/ide-disk.h | 3 | ||||
-rw-r--r-- | drivers/ide/ide-disk_ioctl.c | 2 |
3 files changed, 7 insertions, 12 deletions
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index 2c48bd81f537..6c9c898aff62 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c @@ -49,8 +49,6 @@ static DEFINE_MUTEX(idedisk_ref_mutex); -#define to_ide_disk(obj) container_of(obj, struct ide_disk_obj, kref) - static void ide_disk_release(struct kref *); static struct ide_disk_obj *ide_disk_get(struct gendisk *disk) @@ -58,7 +56,7 @@ static struct ide_disk_obj *ide_disk_get(struct gendisk *disk) struct ide_disk_obj *idkp = NULL; mutex_lock(&idedisk_ref_mutex); - idkp = ide_disk_g(disk); + idkp = ide_drv_g(disk, ide_disk_obj); if (idkp) { if (ide_device_get(idkp->drive)) idkp = NULL; @@ -746,7 +744,7 @@ static void ide_disk_remove(ide_drive_t *drive) static void ide_disk_release(struct kref *kref) { - struct ide_disk_obj *idkp = to_ide_disk(kref); + struct ide_disk_obj *idkp = to_ide_drv(kref, ide_disk_obj); ide_drive_t *drive = idkp->drive; struct gendisk *g = idkp->disk; @@ -858,7 +856,7 @@ static int idedisk_open(struct inode *inode, struct file *filp) static int idedisk_release(struct inode *inode, struct file *filp) { struct gendisk *disk = inode->i_bdev->bd_disk; - struct ide_disk_obj *idkp = ide_disk_g(disk); + struct ide_disk_obj *idkp = ide_drv_g(disk, ide_disk_obj); ide_drive_t *drive = idkp->drive; if (idkp->openers == 1) @@ -879,7 +877,7 @@ static int idedisk_release(struct inode *inode, struct file *filp) static int idedisk_getgeo(struct block_device *bdev, struct hd_geometry *geo) { - struct ide_disk_obj *idkp = ide_disk_g(bdev->bd_disk); + struct ide_disk_obj *idkp = ide_drv_g(bdev->bd_disk, ide_disk_obj); ide_drive_t *drive = idkp->drive; geo->heads = drive->bios_head; @@ -890,7 +888,7 @@ static int idedisk_getgeo(struct block_device *bdev, struct hd_geometry *geo) static int idedisk_media_changed(struct gendisk *disk) { - struct ide_disk_obj *idkp = ide_disk_g(disk); + struct ide_disk_obj *idkp = ide_drv_g(disk, ide_disk_obj); ide_drive_t *drive = idkp->drive; /* do not scan partitions twice if this is a removable device */ @@ -905,7 +903,7 @@ static int idedisk_media_changed(struct gendisk *disk) static int idedisk_revalidate_disk(struct gendisk *disk) { - struct ide_disk_obj *idkp = ide_disk_g(disk); + struct ide_disk_obj *idkp = ide_drv_g(disk, ide_disk_obj); set_capacity(disk, ide_disk_capacity(idkp->drive)); return 0; } diff --git a/drivers/ide/ide-disk.h b/drivers/ide/ide-disk.h index a82fa4355665..50d674b91c8b 100644 --- a/drivers/ide/ide-disk.h +++ b/drivers/ide/ide-disk.h @@ -9,9 +9,6 @@ struct ide_disk_obj { unsigned int openers; /* protected by BKL for now */ }; -#define ide_disk_g(disk) \ - container_of((disk)->private_data, struct ide_disk_obj, driver) - /* ide-disk.c */ sector_t ide_disk_capacity(ide_drive_t *); ide_decl_devset(address); diff --git a/drivers/ide/ide-disk_ioctl.c b/drivers/ide/ide-disk_ioctl.c index a6cf1a03a806..e6624eda9e69 100644 --- a/drivers/ide/ide-disk_ioctl.c +++ b/drivers/ide/ide-disk_ioctl.c @@ -17,7 +17,7 @@ int ide_disk_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { struct block_device *bdev = inode->i_bdev; - struct ide_disk_obj *idkp = ide_disk_g(bdev->bd_disk); + struct ide_disk_obj *idkp = ide_drv_g(bdev->bd_disk, ide_disk_obj); ide_drive_t *drive = idkp->drive; int err; |