aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-01-05 11:16:17 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-03-06 14:11:23 +0000
commit00b9850e7307ff690639dd0584a50dd8a72d3548 (patch)
treeb2795b667d075222fc610acf6026e1523cc6f8e1
parentMerge tag 'icc-6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc into char-misc-next (diff)
downloadwireguard-linux-00b9850e7307ff690639dd0584a50dd8a72d3548.tar.xz
wireguard-linux-00b9850e7307ff690639dd0584a50dd8a72d3548.zip
greybus: make greybus_bus_type const
Now that the driver core can properly handle constant struct bus_type, move the greybus_bus_type variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime. Cc: Alex Elder <elder@kernel.org> Cc: greybus-dev@lists.linaro.org Reviewed-by: Johan Hovold <johan@kernel.org> Link: https://lore.kernel.org/r/2024010517-handgun-scoreless-05e7@gregkh Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/greybus/core.c2
-rw-r--r--include/linux/greybus.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/greybus/core.c b/drivers/greybus/core.c
index 5714be740470..b0aadc1e7bbe 100644
--- a/drivers/greybus/core.c
+++ b/drivers/greybus/core.c
@@ -155,7 +155,7 @@ static void greybus_shutdown(struct device *dev)
}
}
-struct bus_type greybus_bus_type = {
+const struct bus_type greybus_bus_type = {
.name = "greybus",
.match = greybus_match_device,
.uevent = greybus_uevent,
diff --git a/include/linux/greybus.h b/include/linux/greybus.h
index 18c0fb958b74..92da9ec4f5f0 100644
--- a/include/linux/greybus.h
+++ b/include/linux/greybus.h
@@ -104,7 +104,7 @@ void gb_debugfs_init(void);
void gb_debugfs_cleanup(void);
struct dentry *gb_debugfs_get(void);
-extern struct bus_type greybus_bus_type;
+extern const struct bus_type greybus_bus_type;
extern struct device_type greybus_hd_type;
extern struct device_type greybus_module_type;