diff options
author | Ricardo B. Marliere <ricardo@marliere.net> | 2024-02-18 22:18:12 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-02-19 11:35:46 +0300 |
commit | 1ab40abcdbb2c409372223060078cc2347df2721 (patch) | |
tree | 18052e590c0fd4e74fb45465680236b52c5e607d /drivers/usb/core/usb.h | |
parent | 3e383260dfd406d8bb09a64cadeafb5cd71a7e0c (diff) | |
download | linux-1ab40abcdbb2c409372223060078cc2347df2721.tar.xz |
usb: core: constify the struct device_type usage
Since commit aed65af1cc2f ("drivers: make device_type const"), the driver
core can properly handle constant struct device_type. Move the
usb_device_type, usb_if_device_type, usb_ep_device_type and
usb_port_device_type variables to be constant structures as well, placing
it into read-only memory which can not be modified at runtime.
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Link: https://lore.kernel.org/r/20240218-device_cleanup-usb-v1-4-77423c4da262@marliere.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/core/usb.h')
-rw-r--r-- | drivers/usb/core/usb.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h index bfecb50773b6..b8324ea05b20 100644 --- a/drivers/usb/core/usb.h +++ b/drivers/usb/core/usb.h @@ -144,10 +144,10 @@ static inline int usb_disable_usb2_hardware_lpm(struct usb_device *udev) extern const struct class usbmisc_class; extern const struct bus_type usb_bus_type; extern struct mutex usb_port_peer_mutex; -extern struct device_type usb_device_type; -extern struct device_type usb_if_device_type; -extern struct device_type usb_ep_device_type; -extern struct device_type usb_port_device_type; +extern const struct device_type usb_device_type; +extern const struct device_type usb_if_device_type; +extern const struct device_type usb_ep_device_type; +extern const struct device_type usb_port_device_type; extern struct usb_device_driver usb_generic_driver; static inline int is_usb_device(const struct device *dev) |