aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBorislav Petkov <petkovbb@googlemail.com>2008-10-13 21:39:34 +0200
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-13 21:39:34 +0200
commit5aeddf907f149cae7e19b7c23ccea3823d00698c (patch)
treec3507ed9a078f94bb091ed6557f570927b34f255 /include
parent91ddc9988efeaed487eb7dd81d2557e1b1d501ef (diff)
ide: unify conversion macros
Introduce to_ide_drv() and ide_drv_g() macros and replace the respective definitions of similar ones in each driver. There should be no functionality change resulting from this patch. Signed-off-by: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/ide.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 85cb96c1fd6..350ef47ed61 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -570,7 +570,13 @@ struct ide_drive_s {
typedef struct ide_drive_s ide_drive_t;
-#define to_ide_device(dev)container_of(dev, ide_drive_t, gendev)
+#define to_ide_device(dev) container_of(dev, ide_drive_t, gendev)
+
+#define to_ide_drv(obj, cont_type) \
+ container_of(obj, struct cont_type, kref)
+
+#define ide_drv_g(disk, cont_type) \
+ container_of((disk)->private_data, struct cont_type, driver)
struct ide_task_s;
struct ide_port_info;