diff mbox series

watchdog: Make watchdog_class const

Message ID 20240614-class-const-wdt-v1-1-f9a4e2b1ba76@weissschuh.net (mailing list archive)
State New
Headers show
Series watchdog: Make watchdog_class const | expand

Commit Message

Thomas Weißschuh June 13, 2024, 10:57 p.m. UTC
Now that the driver core allows for struct class to be in read-only
memory, mark watchdog_class as const.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 drivers/watchdog/watchdog_dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


---
base-commit: d20f6b3d747c36889b7ce75ee369182af3decb6b
change-id: 20240614-class-const-wdt-3649d0adc431

Best regards,

Comments

Guenter Roeck June 13, 2024, 11:46 p.m. UTC | #1
On 6/13/24 15:57, Thomas Weißschuh wrote:
> Now that the driver core allows for struct class to be in read-only
> memory, mark watchdog_class as const.
> 
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>   drivers/watchdog/watchdog_dev.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_dev.c
> index e2bd266b1b5b..4190cb800cc4 100644
> --- a/drivers/watchdog/watchdog_dev.c
> +++ b/drivers/watchdog/watchdog_dev.c
> @@ -1004,7 +1004,7 @@ static struct miscdevice watchdog_miscdev = {
>   	.fops		= &watchdog_fops,
>   };
>   
> -static struct class watchdog_class = {
> +static const struct class watchdog_class = {
>   	.name =		"watchdog",
>   	.dev_groups =	wdt_groups,
>   };
> 
> ---
> base-commit: d20f6b3d747c36889b7ce75ee369182af3decb6b
> change-id: 20240614-class-const-wdt-3649d0adc431
> 
> Best regards,
diff mbox series

Patch

diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_dev.c
index e2bd266b1b5b..4190cb800cc4 100644
--- a/drivers/watchdog/watchdog_dev.c
+++ b/drivers/watchdog/watchdog_dev.c
@@ -1004,7 +1004,7 @@  static struct miscdevice watchdog_miscdev = {
 	.fops		= &watchdog_fops,
 };
 
-static struct class watchdog_class = {
+static const struct class watchdog_class = {
 	.name =		"watchdog",
 	.dev_groups =	wdt_groups,
 };