mfd: intel_soc_pmic_core: Use explicit name of GPIO controller
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.
--- drivers/mfd/intel_soc_pmic_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
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), { }, }, };
Signature · 1 line
2.9.3
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]>Signed-off-by Andy Shevchenko <[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
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
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]>Signed-off-by Andy Shevchenko <[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
-0drivers/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->labelwhich is
used for the lookup is based onKBUILD_MODNAMEand 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
Quoted 8 lines · Andy Shevchenko
[Ville]
Quoted 3 lines
The
gpio_chip->labelwhich is
used for the lookup is based onKBUILD_MODNAMEand 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