struct ccwgroup_device *gdev;
struct ccwgroup_driver *gdrv;
- gdev = container_of(dev, struct ccwgroup_device, dev);
- gdrv = container_of(drv, struct ccwgroup_driver, driver);
+ gdev = to_ccwgroupdev(dev);
+ gdrv = to_ccwgroupdrv(drv);
if (gdev->creator_id == gdrv->driver_id)
return 1;
static int
css_bus_match (struct device *dev, struct device_driver *drv)
{
- struct subchannel *sch = container_of (dev, struct subchannel, dev);
- struct css_driver *driver = container_of (drv, struct css_driver, drv);
+ struct subchannel *sch = to_subchannel(dev);
+ struct css_driver *driver = to_cssdriver(drv);
if (sch->st == driver->subchannel_type)
return 1;
struct subchannel *sch;
sch = to_subchannel(dev);
- sch->driver = container_of (dev->driver, struct css_driver, drv);
+ sch->driver = to_cssdriver(dev->driver);
return (sch->driver->probe ? sch->driver->probe(sch) : 0);
}
void (*shutdown)(struct subchannel *);
};
+#define to_cssdriver(n) container_of(n, struct css_driver, drv)
+
/*
* all css_drivers have the css_bus_type
*/