[35/36] driver core: device.h: make struct bus_type a const *

Message ID 20230313182918.1312597-35-gregkh@linuxfoundation.org
State New
Headers
Series [01/36] EDAC/sysfs: move to use bus_get_dev_root() |

Commit Message

Greg KH March 13, 2023, 6:29 p.m. UTC
  Now that all users who accessed the bus_type structure in struct device
are properly using it as a const *, mark it as such so that no one can
modify it going forward anymore.

Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 include/linux/device.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/include/linux/device.h b/include/linux/device.h
index 0f128520f6e5..9a8573409685 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -564,7 +564,7 @@  struct device {
 	const char		*init_name; /* initial name of the device */
 	const struct device_type *type;
 
-	struct bus_type	*bus;		/* type of bus device is on */
+	const struct bus_type	*bus;	/* type of bus device is on */
 	struct device_driver *driver;	/* which driver has allocated this
 					   device */
 	void		*platform_data;	/* Platform specific data, device