[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240204-bus_cleanup-gpio-v1-1-82d91b4ee1de@marliere.net>
Date: Sun, 04 Feb 2024 13:29:42 -0300
From: "Ricardo B. Marliere" <ricardo@...liere.net>
To: Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <brgl@...ev.pl>
Cc: linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Ricardo B. Marliere" <ricardo@...liere.net>
Subject: [PATCH] gpio: gpiolib: make gpio_bus_type const
Now that the driver core can properly handle constant struct bus_type,
move the gpio_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@...uxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@...liere.net>
---
drivers/gpio/gpiolib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index d50a786f8176..24d046268a01 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -63,7 +63,7 @@ static int gpio_bus_match(struct device *dev, struct device_driver *drv)
return 1;
}
-static struct bus_type gpio_bus_type = {
+static const struct bus_type gpio_bus_type = {
.name = "gpio",
.match = gpio_bus_match,
};
---
base-commit: 3eac8bbed22e940ac1645a884f221bef408f675c
change-id: 20240204-bus_cleanup-gpio-57eea8d32a5a
Best regards,
--
Ricardo B. Marliere <ricardo@...liere.net>
Powered by blists - more mailing lists