From: Geliang Tang Date: Tue, 5 Jan 2016 15:03:38 +0000 (+0800) Subject: driver core: bus: use to_subsys_private and to_device_private_bus X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=371fd7a2c438a56e00c18a83178555a7918329a2;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git driver core: bus: use to_subsys_private and to_device_private_bus Use to_subsys_private() and to_device_private_bus() instead of open-coding. Signed-off-by: Geliang Tang Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/base/bus.c b/drivers/base/bus.c index 4bee6b0f9ea4..6470eb8088f4 100644 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c @@ -149,8 +149,7 @@ EXPORT_SYMBOL_GPL(bus_remove_file); static void bus_release(struct kobject *kobj) { - struct subsys_private *priv = - container_of(kobj, typeof(*priv), subsys.kobj); + struct subsys_private *priv = to_subsys_private(kobj); struct bus_type *bus = priv->bus; kfree(priv); @@ -1103,7 +1102,7 @@ struct device *subsys_dev_iter_next(struct subsys_dev_iter *iter) knode = klist_next(&iter->ki); if (!knode) return NULL; - dev = container_of(knode, struct device_private, knode_bus)->device; + dev = to_device_private_bus(knode)->device; if (!iter->type || iter->type == dev->type) return dev; }