Skip to contentSkip to conversation

gpio: viperboard: mark gpioa_clk variable as __ro_after_init

PATCH In review Len Bao 1 participant 2 messages May 16 – Jun 6 GPIO

lore
Share & tools
lore

Len Bao

author
#0 lore raw

PATCH 1/1 gpio: viperboard: mark gpioa_clk variable as __ro_after_init

The 'gpioa_clk' variable is initialized only during the init phase in the 'vprbrd_gpio_init' function and never changed. So, mark it as __ro_after_init.

---
 drivers/gpio/gpio-viperboard.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpio-viperboard.c +1 -1
index 89087fd48..4e6442390 100644
@@ -70,7 +70,7 @@ struct vprbrd_gpio {
 };
 
 /* gpioa sampling clock module parameter */
-static unsigned char gpioa_clk;
+static unsigned char gpioa_clk __ro_after_init;
 static unsigned int gpioa_freq = VPRBRD_GPIOA_FREQ_DEFAULT;
 module_param(gpioa_freq, uint, 0);
 MODULE_PARM_DESC(gpioa_freq,
Signature · 1 line
2.43.0
author
#1 lore raw

Hi,

Quoted 6 lines · Len Bao

The 'gpioa_clk' variable is initialized only during the init phase in the 'vprbrd_gpio_init' function and never changed. So, mark it as __ro_after_init.

---

Friendly ping.
Any comments are welcome.

Regards,
Len

Quoted 19 lines
 drivers/gpio/gpio-viperboard.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpio-viperboard.c +1 -1
index 89087fd48..4e6442390 100644
@@ -70,7 +70,7 @@ struct vprbrd_gpio {
 };
 
 /* gpioa sampling clock module parameter */
-static unsigned char gpioa_clk;
+static unsigned char gpioa_clk __ro_after_init;
 static unsigned int gpioa_freq = VPRBRD_GPIOA_FREQ_DEFAULT;
 module_param(gpioa_freq, uint, 0);
 MODULE_PARM_DESC(gpioa_freq,
Signature · 1 line
2.43.0