aboutsummaryrefslogtreecommitdiff
path: root/drivers/ide/ide-disk.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-17 18:09:09 +0200
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-17 18:09:09 +0200
commitd7e747596829c1c11833ca0a1f5e64f400d20bf2 (patch)
tree3ca99d61a3e05399bea3969a588011e235ca5f7a /drivers/ide/ide-disk.c
parent9c3ba7692bc1166c6a5d06fb7c59984f9f988a00 (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/ide/ide-disk.c')
-rw-r--r--drivers/ide/ide-disk.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index 2c48bd81f53..6c9c898aff6 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;
}