summaryrefslogtreecommitdiffstats
path: root/drivers/base/base.h
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-03-13 19:29:04 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-03-23 13:20:36 +0100
commit9cc61e5fbd619eea0401f519e7bac72fe3d4d1e8 (patch)
treece3743bdf6965397a8b5129653edc52c1b922cdb /drivers/base/base.h
parentcpuidle: move to use bus_get_dev_root() (diff)
downloadlinux-9cc61e5fbd619eea0401f519e7bac72fe3d4d1e8.tar.xz
linux-9cc61e5fbd619eea0401f519e7bac72fe3d4d1e8.zip
driver core: bus: move dev_root out of struct bus_type
Now that all accesses of dev_root is through the bus_get_dev_root() call, move the pointer out of struct bus_type and into the private dynamic structure, subsys_private. With this change, there is no modifiable portions of struct bus_type so it can be marked as a constant structure and moved to read-only memory. Cc: "Rafael J. Wysocki" <rafael@kernel.org> Link: https://lore.kernel.org/r/20230313182918.1312597-22-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/base.h')
-rw-r--r--drivers/base/base.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/base/base.h b/drivers/base/base.h
index b055eba1ec30..f1034e27e651 100644
--- a/drivers/base/base.h
+++ b/drivers/base/base.h
@@ -27,6 +27,7 @@
* on this bus.
* @bus - pointer back to the struct bus_type that this structure is associated
* with.
+ * @dev_root: Default device to use as the parent.
*
* @glue_dirs - "glue" directory to put in-between the parent device to
* avoid namespace conflicts
@@ -49,6 +50,7 @@ struct subsys_private {
struct blocking_notifier_head bus_notifier;
unsigned int drivers_autoprobe:1;
struct bus_type *bus;
+ struct device *dev_root;
struct kset glue_dirs;
struct class *class;