Commit 37d158d0 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman Committed by Jiri Kosina

HID: make hid_bus_type const

Now that the driver core can properly handle constant struct bus_type,
move the hid_bus_type variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.

Cc: Jiri Kosina <jikos@kernel.org>
Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: linux-input@vger.kernel.org
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.com>
parent 3f10e214
...@@ -2749,7 +2749,7 @@ static int hid_uevent(const struct device *dev, struct kobj_uevent_env *env) ...@@ -2749,7 +2749,7 @@ static int hid_uevent(const struct device *dev, struct kobj_uevent_env *env)
return 0; return 0;
} }
struct bus_type hid_bus_type = { const struct bus_type hid_bus_type = {
.name = "hid", .name = "hid",
.dev_groups = hid_dev_groups, .dev_groups = hid_dev_groups,
.drv_groups = hid_drv_groups, .drv_groups = hid_drv_groups,
......
...@@ -912,7 +912,7 @@ extern bool hid_ignore(struct hid_device *); ...@@ -912,7 +912,7 @@ extern bool hid_ignore(struct hid_device *);
extern int hid_add_device(struct hid_device *); extern int hid_add_device(struct hid_device *);
extern void hid_destroy_device(struct hid_device *); extern void hid_destroy_device(struct hid_device *);
extern struct bus_type hid_bus_type; extern const struct bus_type hid_bus_type;
extern int __must_check __hid_register_driver(struct hid_driver *, extern int __must_check __hid_register_driver(struct hid_driver *,
struct module *, const char *mod_name); struct module *, const char *mod_name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment