Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 371fd7a2 authored by Geliang Tang's avatar Geliang Tang Committed by Greg Kroah-Hartman
Browse files

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: default avatarGeliang Tang <geliangtang@163.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4c62785e
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -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;
	}