diff options
author | Cornelia Huck <cornelia.huck@de.ibm.com> | 2008-01-26 08:10:38 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2008-01-26 08:10:56 -0500 |
commit | 084325d80418adf4d75b10a9ceff1348f2e09163 (patch) | |
tree | 5fef7966f632167f3ce7d48d2a230f787b14a1aa | |
parent | 14ff56bbb3422cc465a12e81f5e1b5f06168aeda (diff) |
[S390] cio: Use helpers instead of container_of().
- Introduce to_cssdriver.
- Use to_xxx instead of container_of where possible.
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r-- | drivers/s390/cio/ccwgroup.c | 4 | ||||
-rw-r--r-- | drivers/s390/cio/css.c | 6 | ||||
-rw-r--r-- | drivers/s390/cio/css.h | 2 |
3 files changed, 7 insertions, 5 deletions
diff --git a/drivers/s390/cio/ccwgroup.c b/drivers/s390/cio/ccwgroup.c index 5baa517c3b66..b3e2c16caa41 100644 --- a/drivers/s390/cio/ccwgroup.c +++ b/drivers/s390/cio/ccwgroup.c | |||
@@ -35,8 +35,8 @@ ccwgroup_bus_match (struct device * dev, struct device_driver * drv) | |||
35 | struct ccwgroup_device *gdev; | 35 | struct ccwgroup_device *gdev; |
36 | struct ccwgroup_driver *gdrv; | 36 | struct ccwgroup_driver *gdrv; |
37 | 37 | ||
38 | gdev = container_of(dev, struct ccwgroup_device, dev); | 38 | gdev = to_ccwgroupdev(dev); |
39 | gdrv = container_of(drv, struct ccwgroup_driver, driver); | 39 | gdrv = to_ccwgroupdrv(drv); |
40 | 40 | ||
41 | if (gdev->creator_id == gdrv->driver_id) | 41 | if (gdev->creator_id == gdrv->driver_id) |
42 | return 1; | 42 | return 1; |
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c index c3df2cd009a4..bc2f8fa576a3 100644 --- a/drivers/s390/cio/css.c +++ b/drivers/s390/cio/css.c | |||
@@ -787,8 +787,8 @@ int sch_is_pseudo_sch(struct subchannel *sch) | |||
787 | static int | 787 | static int |
788 | css_bus_match (struct device *dev, struct device_driver *drv) | 788 | css_bus_match (struct device *dev, struct device_driver *drv) |
789 | { | 789 | { |
790 | struct subchannel *sch = container_of (dev, struct subchannel, dev); | 790 | struct subchannel *sch = to_subchannel(dev); |
791 | struct css_driver *driver = container_of (drv, struct css_driver, drv); | 791 | struct css_driver *driver = to_cssdriver(drv); |
792 | 792 | ||
793 | if (sch->st == driver->subchannel_type) | 793 | if (sch->st == driver->subchannel_type) |
794 | return 1; | 794 | return 1; |
@@ -802,7 +802,7 @@ css_probe (struct device *dev) | |||
802 | struct subchannel *sch; | 802 | struct subchannel *sch; |
803 | 803 | ||
804 | sch = to_subchannel(dev); | 804 | sch = to_subchannel(dev); |
805 | sch->driver = container_of (dev->driver, struct css_driver, drv); | 805 | sch->driver = to_cssdriver(dev->driver); |
806 | return (sch->driver->probe ? sch->driver->probe(sch) : 0); | 806 | return (sch->driver->probe ? sch->driver->probe(sch) : 0); |
807 | } | 807 | } |
808 | 808 | ||
diff --git a/drivers/s390/cio/css.h b/drivers/s390/cio/css.h index 81215ef32435..1d8306cc74c4 100644 --- a/drivers/s390/cio/css.h +++ b/drivers/s390/cio/css.h | |||
@@ -134,6 +134,8 @@ struct css_driver { | |||
134 | void (*shutdown)(struct subchannel *); | 134 | void (*shutdown)(struct subchannel *); |
135 | }; | 135 | }; |
136 | 136 | ||
137 | #define to_cssdriver(n) container_of(n, struct css_driver, drv) | ||
138 | |||
137 | /* | 139 | /* |
138 | * all css_drivers have the css_bus_type | 140 | * all css_drivers have the css_bus_type |
139 | */ | 141 | */ |