From: Greg Kroah-Hartman Date: Mon, 13 Mar 2023 18:29:10 +0000 (+0100) Subject: driver core: make the bus_type in struct device_driver constant X-Git-Tag: v6.4-rc1~115^2~64 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c28dd08ef713d2127c5bad3f3e0e93d6ec0309a2;p=thirdparty%2Fkernel%2Flinux.git driver core: make the bus_type in struct device_driver constant The pointer to struct bus_type in struct device_driver should only be pointing to something that can never change now that the driver core has fixed up the previously writable fields. So mark it as a constant pointer to enforce this and move forward with the goal of moving bus_type into read-only memory. Cc: "Rafael J. Wysocki" Link: https://lore.kernel.org/r/20230313182918.1312597-28-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman --- diff --git a/include/linux/device/driver.h b/include/linux/device/driver.h index ceb0e477c2c87..0f22a6f46f8cd 100644 --- a/include/linux/device/driver.h +++ b/include/linux/device/driver.h @@ -95,7 +95,7 @@ enum probe_type { */ struct device_driver { const char *name; - struct bus_type *bus; + const struct bus_type *bus; struct module *owner; const char *mod_name; /* used for built-in modules */