From: Ricardo B. Marliere Date: Sat, 17 Feb 2024 20:13:23 +0000 (-0300) Subject: net: usbnet: constify the struct device_type usage X-Git-Tag: microblaze-v6.10~161^2~215^2~11 X-Git-Url: http://git.monstr.eu/?a=commitdiff_plain;h=3ce7caee3af0f467ac3a1f90277d469d94c95af5;p=linux-2.6-microblaze.git net: usbnet: 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 wlan_type and wwan_type variables to be constant structures as well, placing it into read-only memory which can not be modified at runtime. Cc: Greg Kroah-Hartman Signed-off-by: Ricardo B. Marliere Reviewed-by: Simon Horman Signed-off-by: David S. Miller --- diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 2d14b0d78541..b21ebe24057f 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c @@ -1654,11 +1654,11 @@ static const struct net_device_ops usbnet_netdev_ops = { // precondition: never called in_interrupt -static struct device_type wlan_type = { +static const struct device_type wlan_type = { .name = "wlan", }; -static struct device_type wwan_type = { +static const struct device_type wwan_type = { .name = "wwan", };