Skip to contentSkip to conversation

leds: lp8860: Constify reg_default tables

PATCH In review Axel Lin 2 participants 2 messages Jul 8, 2015 – Jul 13, 2015 LED

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 leds: lp8860: Constify reg_default tables

These reg_default tables are not modified after initialized, so make them const.

---
 drivers/leds/leds-lp8860.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/leds/leds-lp8860.c +2 -2
index 8c2b7fb..79f0843 100644
@@ -302,7 +302,7 @@ out:
 	return ret;
 }
 
-static struct reg_default lp8860_reg_defs[] = {
+static const struct reg_default lp8860_reg_defs[] = {
 	{ LP8860_DISP_CL1_BRT_MSB, 0x00},
 	{ LP8860_DISP_CL1_BRT_LSB, 0x00},
 	{ LP8860_DISP_CL1_CURR_MSB, 0x00},
@@ -332,7 +332,7 @@ static const struct regmap_config lp8860_regmap_config = {
 	.cache_type = REGCACHE_NONE,
 };
 
-static struct reg_default lp8860_eeprom_defs[] = {
+static const struct reg_default lp8860_eeprom_defs[] = {
 	{ LP8860_EEPROM_REG_0, 0x00 },
 	{ LP8860_EEPROM_REG_1, 0x00 },
 	{ LP8860_EEPROM_REG_2, 0x00 },
Signature · 1 line
2.1.0
Acked-by on v1 1/1
#1 lore raw

Hi Axel,

Thanks for the patch.

Quoted 23 lines · Axel Lin

These reg_default tables are not modified after initialized, so make them const.

---
  drivers/leds/leds-lp8860.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/leds/leds-lp8860.c +1 -1
index 8c2b7fb..79f0843 100644
@@ -302,7 +302,7 @@ out:
  	return ret;
  }
 
-static struct reg_default lp8860_reg_defs[] = {
+static const struct reg_default lp8860_reg_defs[] = {
  	{ LP8860_DISP_CL1_BRT_MSB, 0x00},
  	{ LP8860_DISP_CL1_BRT_LSB, 0x00},
  	{ LP8860_DISP_CL1_CURR_MSB, 0x00},

drivers/leds/leds-lp8860.c static const struct regmap_config lp8860_regmap_config = { · line 338

Quoted 8 lines
drivers/leds/leds-lp8860.c +1 -1
@@ -332,7 +332,7 @@ static const struct regmap_config lp8860_regmap_config = {
  	.cache_type = REGCACHE_NONE,
  };
 
-static struct reg_default lp8860_eeprom_defs[] = {
+static const struct reg_default lp8860_eeprom_defs[] = {
  	{ LP8860_EEPROM_REG_0, 0x00 },
  	{ LP8860_EEPROM_REG_1, 0x00 },
  	{ LP8860_EEPROM_REG_2, 0x00 },
Signature · 2 lines
Best Regards,
Jacek Anaszewski