Skip to contentSkip to conversation

mfd: intel_soc_pmic_core: Use explicit name of GPIO controller

PATCH In review Andy Shevchenko 3 participants 4 messages Oct 20, 2016 – Oct 23, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mfd: intel_soc_pmic_core: Use explicit name of GPIO controller

The Crystal Cove GPIO driver has its explicit name, i.e. crystal_cove_gpio.

Use it explicitly to be in align with the rest of code, pretty grepping, and prevent potential breakage if GPIO driver file name ever changed.

Cc Linus Walleij <[email protected]>
Cc Ville Syrjälä <[email protected]>
---
 drivers/mfd/intel_soc_pmic_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/intel_soc_pmic_core.c +1 -1
index 12d6ebb4..7fd8e87 100644
@@ -34,7 +34,7 @@ static struct gpiod_lookup_table panel_gpio_table = {
 	.dev_id = "0000:00:02.0",
 	.table = {
 		/* Panel EN/DISABLE */
-		GPIO_LOOKUP("gpio_crystalcove", 94, "panel", GPIO_ACTIVE_HIGH),
+		GPIO_LOOKUP("crystal_cove_gpio", 94, "panel", GPIO_ACTIVE_HIGH),
 		{ },
 	},
 };
Signature · 1 line
2.9.3
#1 lore raw
Quoted 17 lines · Andy Shevchenko

The Crystal Cove GPIO driver has its explicit name, i.e. crystal_cove_gpio.

Use it explicitly to be in align with the rest of code, pretty grepping, and prevent potential breakage if GPIO driver file name ever changed.

Cc Linus Walleij <[email protected]>
Cc Ville Syrjälä <[email protected]>
---
 drivers/mfd/intel_soc_pmic_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/intel_soc_pmic_core.c +0 -0
index 12d6ebb4..7fd8e87 100644

drivers/mfd/intel_soc_pmic_core.c static struct gpiod_lookup_table panel_gpio_table = { · line 37

Quoted 5 lines
drivers/mfd/intel_soc_pmic_core.c +1 -1
@@ -34,7 +34,7 @@ static struct gpiod_lookup_table panel_gpio_table = {
 	.dev_id = "0000:00:02.0",
 	.table = {
 		/* Panel EN/DISABLE */
-		GPIO_LOOKUP("gpio_crystalcove", 94, "panel", GPIO_ACTIVE_HIGH),
+		GPIO_LOOKUP("crystal_cove_gpio", 94, "panel", GPIO_ACTIVE_HIGH),

This looks like it would break things. The gpio_chip->label which is used for the lookup is based on KBUILD_MODNAME and the moduled is called gpio-crystalcove.

Quoted 5 lines
drivers/mfd/intel_soc_pmic_core.c +0 -0
 		{ },
 	},
 };
Signature · 1 line
2.9.3
Signature · 2 lines
Ville Syrjälä
Intel OTC
#2 lore raw
Quoted 15 lines · Ville Syrjälä
Quoted 14 lines · Andy Shevchenko

The Crystal Cove GPIO driver has its explicit name, i.e. crystal_cove_gpio.

Use it explicitly to be in align with the rest of code, pretty grepping, and
prevent potential breakage if GPIO driver file name ever changed.

Cc Linus Walleij <[email protected]>
Cc Ville Syrjälä <[email protected]>

---
 drivers/mfd/intel_soc_pmic_core.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 16 lines
Quoted 6 lines
drivers/mfd/intel_soc_pmic_core.c +0 -0
index 12d6ebb4..7fd8e87 100644

drivers/mfd/intel_soc_pmic_core.c static struct gpiod_lookup_table panel_gpio_table · line 40

Quoted 8 lines
drivers/mfd/intel_soc_pmic_core.c +1 -1
@@ -34,7 +34,7 @@ static struct gpiod_lookup_table panel_gpio_table
 = {
  	.dev_id = "0000:00:02.0",
  	.table = {
  		/* Panel EN/DISABLE */
-		GPIO_LOOKUP("gpio_crystalcove", 94, "panel",
 GPIO_ACTIVE_HIGH),
+		GPIO_LOOKUP("crystal_cove_gpio", 94, "panel",
 GPIO_ACTIVE_HIGH),

This looks like it would break things.

Yeah. Good catch.

Quoted 3 lines

The gpio_chip->label which is
used for the lookup is based on KBUILD_MODNAME and the moduled is called gpio-crystalcove.

...which I think is wrong. Only few drivers are binding to file / module name.

Perhaps it should be fixed all together.

Naming a bit chaotic in drivers/gpio/*::chip.label, though majority of them are using dev_name() of actual device.

Linus, what is your opinion?

Signature · 2 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy
#3 lore raw
Quoted 8 lines · Andy Shevchenko

[Ville]

Quoted 3 lines

The gpio_chip->label which is
used for the lookup is based on KBUILD_MODNAME and the moduled is called gpio-crystalcove.

...which I think is wrong. Only few drivers are binding to file / module name.

Quoted 6 lines

Perhaps it should be fixed all together.

Naming a bit chaotic in drivers/gpio/*::chip.label, though majority of them are using dev_name() of actual device.

Linus, what is your opinion?

The docs says:

/**
* struct gpio_chip - abstract a GPIO controller
* @label: a functional name for the GPIO device, such as a part
* number or the name of the SoC IP-block implementing it.

Apart from that it is just a name. It does not need to be unique per instance since the gpiocip0 ... gpiochipN plus sysfs topology takes care of identifying the chip. I have no strong opinion on it.

Yours,
Linus Walleij