aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo B. Marliere <[email protected]>2024-02-04 11:40:16 -0300
committerIlpo Järvinen <[email protected]>2024-02-06 11:58:01 +0200
commit10fdfd13a35994ac1dcc3003d4046cb1955e66a8 (patch)
tree74856bd949cdb3f5d76bb29ab0c08c7e9b3ab925
parent3a057bf30e044a51af8e6a8fe8cbfac49e2b9bc5 (diff)
platform: x86: wmi: make wmi_bus_type const
Now that the driver core can properly handle constant struct bus_type, move the wmi_bus_type variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime. Cc: Greg Kroah-Hartman <[email protected]> Suggested-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: "Ricardo B. Marliere" <[email protected]> Reviewed-by: Armin Wolf <[email protected]> Link: https://lore.kernel.org/r/20240204-bus_cleanup-platform-drivers-x86-v1-1-1f0839b385c6@marliere.net Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]>
-rw-r--r--drivers/platform/x86/wmi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
index 3335de4e32b2..5682c7de0394 100644
--- a/drivers/platform/x86/wmi.c
+++ b/drivers/platform/x86/wmi.c
@@ -219,7 +219,7 @@ static int wmidev_match_guid(struct device *dev, const void *data)
return 0;
}
-static struct bus_type wmi_bus_type;
+static const struct bus_type wmi_bus_type;
static struct wmi_device *wmi_find_device_by_guid(const char *guid_string)
{
@@ -899,7 +899,7 @@ static struct class wmi_bus_class = {
.name = "wmi_bus",
};
-static struct bus_type wmi_bus_type = {
+static const struct bus_type wmi_bus_type = {
.name = "wmi",
.dev_groups = wmi_groups,
.match = wmi_dev_match,