Skip to contentSkip to conversation

pinctrl: starfive: Correct driver declaration for starfive_gpio

PATCH In review Hal Feng 2 participants 2 messages Jan 16, 2025 Pin control

lore
Share & tools
lore

Hal Feng

author
#0 lore raw

PATCH 1/1 pinctrl: starfive: Correct driver declaration for starfive_gpio

Use the driver macros so that the driver appears in the linker list.

Fixes 732f01aabf53 ("pinctrl: starfive: Add StarFive JH7110 driver")
---
 drivers/pinctrl/starfive/pinctrl-starfive.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pinctrl/starfive/pinctrl-starfive.c +2 -2
index 95b1a752de2..1b942e6f045 100644
@@ -348,7 +348,7 @@ static const struct dm_gpio_ops starfive_gpio_ops = {
 	.set_value = starfive_gpio_set_value,
 };
 
-static struct driver starfive_gpio_driver = {
+U_BOOT_DRIVER(starfive_gpio) = {
 	.name = "starfive_gpio",
 	.id = UCLASS_GPIO,
 	.probe = starfive_gpio_probe,
@@ -367,7 +367,7 @@ static int starfive_gpiochip_register(struct udevice *parent)
 		return -ENOENT;
 
 	node = dev_ofnode(parent);
-	ret = device_bind_with_driver_data(parent, &starfive_gpio_driver,
+	ret = device_bind_with_driver_data(parent, DM_DRIVER_REF(starfive_gpio),
 					   "starfive_gpio", 0, node, &dev);
 
 	return (ret == 0) ? 0 : ret;

base-commit: 178f6ecb21fe12ada74a9a1a08093c812b15eea5

Signature · 1 line
2.43.2
Reviewed-by on v1 1/1
#1 lore raw

Hi Hal Feng,

Quoted 26 lines · Hal Feng

Use the driver macros so that the driver appears in the linker list.

Fixes 732f01aabf53 ("pinctrl: starfive: Add StarFive JH7110 driver")
---
 drivers/pinctrl/starfive/pinctrl-starfive.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pinctrl/starfive/pinctrl-starfive.c +1 -1
index 95b1a752de2..1b942e6f045 100644
@@ -348,7 +348,7 @@ static const struct dm_gpio_ops starfive_gpio_ops = {
        .set_value = starfive_gpio_set_value,
 };
 
-static struct driver starfive_gpio_driver = {
+U_BOOT_DRIVER(starfive_gpio) = {
        .name = "starfive_gpio",
        .id = UCLASS_GPIO,
        .probe = starfive_gpio_probe,

drivers/pinctrl/starfive/pinctrl-starfive.c static int starfive_gpiochip_register(struct udevice *parent) · line 373

Quoted 8 lines
drivers/pinctrl/starfive/pinctrl-starfive.c +1 -1
@@ -367,7 +367,7 @@ static int starfive_gpiochip_register(struct udevice *parent)
                return -ENOENT;
 
        node = dev_ofnode(parent);
-       ret = device_bind_with_driver_data(parent, &starfive_gpio_driver,
+       ret = device_bind_with_driver_data(parent, DM_DRIVER_REF(starfive_gpio),
                                           "starfive_gpio", 0, node, &dev);
 
        return (ret == 0) ? 0 : ret;

Thanks
-Anand

Quoted 5 lines

base-commit: 178f6ecb21fe12ada74a9a1a08093c812b15eea5

--
2.43.2