Merge tag 'u-boot-atmel-fixes-2021.01-b' of https://gitlab.denx.de/u-boot/custodians...
[platform/kernel/u-boot.git] / drivers / pinctrl / pinctrl-stmfx.c
index c2ea827..a62be44 100644 (file)
@@ -343,8 +343,8 @@ static int stmfx_pinctrl_get_pins_count(struct udevice *dev)
 }
 
 /*
- * STMFX pins[15:0] are called "gpio[15:0]"
- * and STMFX pins[23:16] are called "agpio[7:0]"
+ * STMFX pins[15:0] are called "stmfx_gpio[15:0]"
+ * and STMFX pins[23:16] are called "stmfx_agpio[7:0]"
  */
 #define MAX_PIN_NAME_LEN 7
 static char pin_name[MAX_PIN_NAME_LEN];
@@ -352,9 +352,9 @@ static const char *stmfx_pinctrl_get_pin_name(struct udevice *dev,
                                              unsigned int selector)
 {
        if (selector < STMFX_MAX_GPIO)
-               snprintf(pin_name, MAX_PIN_NAME_LEN, "gpio%u", selector);
+               snprintf(pin_name, MAX_PIN_NAME_LEN, "stmfx_gpio%u", selector);
        else
-               snprintf(pin_name, MAX_PIN_NAME_LEN, "agpio%u", selector - 16);
+               snprintf(pin_name, MAX_PIN_NAME_LEN, "stmfx_agpio%u", selector - 16);
        return pin_name;
 }
 
@@ -408,8 +408,11 @@ static int stmfx_pinctrl_bind(struct udevice *dev)
 {
        struct stmfx_pinctrl *plat = dev_get_platdata(dev);
 
+       /* subnode name is not explicit: use father name */
+       device_set_name(dev, dev->parent->name);
+
        return device_bind_driver_to_node(dev->parent,
-                                         "stmfx-gpio", "stmfx-gpio",
+                                         "stmfx-gpio", dev->parent->name,
                                          dev_ofnode(dev), &plat->gpio);
 };