* [PATCH] gpio: sysfs: constify gpio class
@ 2024-10-14 12:18 Bartosz Golaszewski
2024-10-15 8:02 ` Linus Walleij
2024-10-17 6:57 ` Bartosz Golaszewski
0 siblings, 2 replies; 3+ messages in thread
From: Bartosz Golaszewski @ 2024-10-14 12:18 UTC (permalink / raw)
To: Linus Walleij, Kent Gibson; +Cc: linux-gpio, linux-kernel, Bartosz Golaszewski
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
All class functions used here take a const pointer to the class
structure. We can constify gpio_class.
While at it: remove a stray newline and use a tab in the struct
definition for consistency with the line above.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
drivers/gpio/gpiolib-sysfs.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c
index 20426d6e04d5..0c713baa7784 100644
--- a/drivers/gpio/gpiolib-sysfs.c
+++ b/drivers/gpio/gpiolib-sysfs.c
@@ -549,12 +549,11 @@ static struct attribute *gpio_class_attrs[] = {
};
ATTRIBUTE_GROUPS(gpio_class);
-static struct class gpio_class = {
+static const struct class gpio_class = {
.name = "gpio",
- .class_groups = gpio_class_groups,
+ .class_groups = gpio_class_groups,
};
-
/**
* gpiod_export - export a GPIO through sysfs
* @desc: GPIO to make available, already requested
--
2.43.0
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] gpio: sysfs: constify gpio class
2024-10-14 12:18 [PATCH] gpio: sysfs: constify gpio class Bartosz Golaszewski
@ 2024-10-15 8:02 ` Linus Walleij
2024-10-17 6:57 ` Bartosz Golaszewski
1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2024-10-15 8:02 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Kent Gibson, linux-gpio, linux-kernel, Bartosz Golaszewski
On Mon, Oct 14, 2024 at 2:18 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>
> All class functions used here take a const pointer to the class
> structure. We can constify gpio_class.
>
> While at it: remove a stray newline and use a tab in the struct
> definition for consistency with the line above.
>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] gpio: sysfs: constify gpio class
2024-10-14 12:18 [PATCH] gpio: sysfs: constify gpio class Bartosz Golaszewski
2024-10-15 8:02 ` Linus Walleij
@ 2024-10-17 6:57 ` Bartosz Golaszewski
1 sibling, 0 replies; 3+ messages in thread
From: Bartosz Golaszewski @ 2024-10-17 6:57 UTC (permalink / raw)
To: Linus Walleij, Kent Gibson, Bartosz Golaszewski
Cc: Bartosz Golaszewski, linux-gpio, linux-kernel
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
On Mon, 14 Oct 2024 14:18:30 +0200, Bartosz Golaszewski wrote:
> All class functions used here take a const pointer to the class
> structure. We can constify gpio_class.
>
> While at it: remove a stray newline and use a tab in the struct
> definition for consistency with the line above.
>
>
> [...]
Applied, thanks!
[1/1] gpio: sysfs: constify gpio class
commit: b6f7aeaf1bfd8d78d55868f0857e397b06a01777
Best regards,
--
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-10-17 6:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-14 12:18 [PATCH] gpio: sysfs: constify gpio class Bartosz Golaszewski
2024-10-15 8:02 ` Linus Walleij
2024-10-17 6:57 ` Bartosz Golaszewski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®