nvmem: core: make nvmem_layout_bus_type const
authorRicardo B. Marliere <ricardo@marliere.net>
Sat, 24 Feb 2024 11:45:15 +0000 (11:45 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 7 Mar 2024 20:21:53 +0000 (20:21 +0000)
Since commit d492cc2573a0 ("driver core: device.h: make struct bus_type
a const *"), the driver core can properly handle constant struct
bus_type, move the nvmem_layout_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 <gregkh@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: "Ricardo B. Marliere" <ricardo@marliere.net>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20240224114516.86365-11-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nvmem/layouts.c

index 6a6aa58369ff24162a15538449e50216947aa00d..8b5e2de138eb513df62c13f65518420b7a0698f8 100644 (file)
@@ -45,7 +45,7 @@ static void nvmem_layout_bus_remove(struct device *dev)
        return drv->remove(layout);
 }
 
-static struct bus_type nvmem_layout_bus_type = {
+static const struct bus_type nvmem_layout_bus_type = {
        .name           = "nvmem-layout",
        .match          = nvmem_layout_bus_match,
        .probe          = nvmem_layout_bus_probe,