Skip to contentSkip to conversation

pinctrl: meson: Correct the driver GPIO declaration

PATCH Superseded Simon Glass 2 participants 3 messages Nov 13, 2021

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pinctrl: meson: Correct the driver GPIO declaration

This should use the provided U_BOOT_DRIVER() macro so that the driver gets added to the appropriate linker list. Fix it.

Fixes 7c9dcfed50f ("pinctrl: meson: rework gx pmx function")

---

 drivers/pinctrl/meson/pinctrl-meson-gx-pmx.c | 2 +-
 drivers/pinctrl/meson/pinctrl-meson-gx.h     | 2 +-
 drivers/pinctrl/meson/pinctrl-meson-gxbb.c   | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/pinctrl/meson/pinctrl-meson-gx-pmx.c +1 -1
index 159f3406a20..99502d89c6c 100644
@@ -145,7 +145,7 @@ static const struct dm_gpio_ops meson_gx_gpio_ops = {
 	.direction_output = meson_gpio_direction_output,
 };
 
-const struct driver meson_gx_gpio_driver = {
+U_BOOT_DRIVER(meson_gx_gpio_driver) = {
 	.name	= "meson-gx-gpio",
 	.id	= UCLASS_GPIO,
 	.probe	= meson_gpio_probe,
drivers/pinctrl/meson/pinctrl-meson-gx.h +1 -1
index 4c1aa1a3002..c70c1f51c6d 100644
@@ -43,6 +43,6 @@ struct meson_gx_pmx_data {
 	}
 
 extern const struct pinctrl_ops meson_gx_pinctrl_ops;
-extern const struct driver meson_gx_gpio_driver;
+extern U_BOOT_DRIVER(meson_gx_gpio_driver);
 
 #endif /* __PINCTRL_MESON_GX_H__ */
drivers/pinctrl/meson/pinctrl-meson-gxbb.c +2 -2
index 8c01c739068..93a895c9fa7 100644
@@ -439,7 +439,7 @@ struct meson_pinctrl_data meson_gxbb_periphs_pinctrl_data = {
 	.num_groups	= ARRAY_SIZE(meson_gxbb_periphs_groups),
 	.num_funcs	= ARRAY_SIZE(meson_gxbb_periphs_functions),
 	.num_banks	= ARRAY_SIZE(meson_gxbb_periphs_banks),
-	.gpio_driver	= &meson_gx_gpio_driver,
+	.gpio_driver	= DM_DRIVER_REF(meson_gx_gpio_driver),
 };
 
 struct meson_pinctrl_data meson_gxbb_aobus_pinctrl_data = {
@@ -452,7 +452,7 @@ struct meson_pinctrl_data meson_gxbb_aobus_pinctrl_data = {
 	.num_groups	= ARRAY_SIZE(meson_gxbb_aobus_groups),
 	.num_funcs	= ARRAY_SIZE(meson_gxbb_aobus_functions),
 	.num_banks	= ARRAY_SIZE(meson_gxbb_aobus_banks),
-	.gpio_driver	= &meson_gx_gpio_driver,
+	.gpio_driver	= DM_DRIVER_REF(meson_gx_gpio_driver),
 };
 
 static const struct udevice_id meson_gxbb_pinctrl_match[] = {
Signature · 1 line
2.34.0.rc1.387.gb447b232ab-goog
#1 lore raw
Quoted 5 lines · Simon Glass

This should use the provided U_BOOT_DRIVER() macro so that the driver gets added to the appropriate linker list. Fix it.

Fixes 7c9dcfed50f ("pinctrl: meson: rework gx pmx function")

Doesn't build for me:
/home/trini/work/u-boot/u-boot/drivers/pinctrl/meson/pinctrl-meson-gxl.c:704:28:
error: 'meson_
gx_gpio_driver' undeclared here (not in a function); did you mean 'meson_gpio_probe'?
704 | .gpio_driver = &meson_gx_gpio_driver,

        |                            ^~~~~~~~~~~~~~~~~~~~
	      |                            meson_gpio_probe

For libretech-cc

Signature · 1 line
Tom
#2 lore raw

Hi Tom,

Quoted 15 lines · Tom Rini
Quoted 5 lines · Simon Glass

This should use the provided U_BOOT_DRIVER() macro so that the driver gets added to the appropriate linker list. Fix it.

Fixes 7c9dcfed50f ("pinctrl: meson: rework gx pmx function")

Doesn't build for me:
/home/trini/work/u-boot/u-boot/drivers/pinctrl/meson/pinctrl-meson-gxl.c:704:28:
error: 'meson_
gx_gpio_driver' undeclared here (not in a function); did you mean 'meson_gpio_probe'?
704 | .gpio_driver = &meson_gx_gpio_driver,

Quoted 4 lines
        |                            ^~~~~~~~~~~~~~~~~~~~
              |                            meson_gpio_probe

For libretech-cc

Oh I only fixed one driver and was building odroid-c2 (just a guess). I will send v2 that works with 'buildman meson'.

Regards,
Simon