]> git.baikalelectronics.ru Git - uboot.git/commit
pinctrl: fix pinctrl_gpio_get_pinctrl_and_offset for gpio-ranges array
authorQuanyang Wang <quanyang.wang@windriver.com>
Thu, 16 Mar 2023 06:11:46 +0000 (14:11 +0800)
committerSimon Glass <sjg@chromium.org>
Sun, 2 Apr 2023 18:53:53 +0000 (06:53 +1200)
commit61440f4e7403cbb0df6020b3eb5027b9a011f6a7
tree0736c4d7b69ded1909b653c78cd7e7b22fec1703
parentd87a89386db07f43319e642b16f727f88e46dc5b
pinctrl: fix pinctrl_gpio_get_pinctrl_and_offset for gpio-ranges array

Sometimes a multi-element array is used for "gpio-ranges" property in
dts file:

    qe_pio_e: gpio-controller@1460 {
        ......
        gpio-ranges = <&pinctrl1 0 20 10>, <&pinctrl2 10 50 20>;
        ......
    };

But the function pinctrl_gpio_get_pinctrl_and_offset can't handle this
case because the "index" argument passed to dev_read_phandle_with_args
is fixed to be "0". Use a loop to traverse the array to fix it.

Signed-off-by: Quanyang Wang <quanyang.wang@windriver.com>
drivers/pinctrl/pinctrl-uclass.c