summaryrefslogtreecommitdiff
path: root/drivers/base/bus.c
diff options
context:
space:
mode:
authorGeliang Tang <geliangtang@163.com>2016-01-05 18:03:38 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-10 04:25:27 +0300
commit371fd7a2c438a56e00c18a83178555a7918329a2 (patch)
treecbb387f814c835b3787257209a69ab34b25af63a /drivers/base/bus.c
parent4c62785e670e978294222a42200346f0538e19e7 (diff)
downloadlinux-371fd7a2c438a56e00c18a83178555a7918329a2.tar.xz
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 <geliangtang@163.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/bus.c')
-rw-r--r--drivers/base/bus.c5
1 files changed, 2 insertions, 3 deletions
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;
}