From patchwork Wed Apr 22 17:25:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lokesh Vutla X-Patchwork-Id: 238343 List-Id: U-Boot discussion From: lokeshvutla at ti.com (Lokesh Vutla) Date: Wed, 22 Apr 2020 22:55:31 +0530 Subject: [PATCH] dm: pinctrl: Use right device pointer for configuring pinctrl Message-ID: <20200422172531.29649-1-lokeshvutla@ti.com> commit 719cab6d2e2bf ("dm: pinctrl: convert pinctrl-single to livetree") converted pinctrl driver to livetree. In this conversion, the call to read pinctrl-single,pins/bits property is provided with pinctrl device pointer instead of pinctrl config pointer. Because of this none of the pins gets configured. Fix it by passing the right udevice pointer. Fixes: 719cab6d2e2bf ("dm: pinctrl: convert pinctrl-single to livetree") Reported-by: Tom Rini Signed-off-by: Lokesh Vutla Tested-by: Tom Rini [am65x_evm_a53 / am65x_evm_r5] Reviewed-by: Patrick Delaunay --- drivers/pinctrl/pinctrl-single.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c index a5d1ff0e97..738f5bd636 100644 --- a/drivers/pinctrl/pinctrl-single.c +++ b/drivers/pinctrl/pinctrl-single.c @@ -120,7 +120,7 @@ static int single_set_state(struct udevice *dev, const struct single_fdt_bits_cfg *prop_bits; int len; - prop = dev_read_prop(dev, "pinctrl-single,pins", &len); + prop = dev_read_prop(config, "pinctrl-single,pins", &len); if (prop) { dev_dbg(dev, "configuring pins for %s\n", config->name); @@ -133,7 +133,7 @@ static int single_set_state(struct udevice *dev, } /* pinctrl-single,pins not found so check for pinctrl-single,bits */ - prop_bits = dev_read_prop(dev, "pinctrl-single,bits", &len); + prop_bits = dev_read_prop(config, "pinctrl-single,bits", &len); if (prop_bits) { dev_dbg(dev, "configuring pins for %s\n", config->name); if (len % sizeof(struct single_fdt_bits_cfg)) {