[PATCH] imx: usb: get pinctrl if it's not yet initialized

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In case usb phy mode is other than USBPHY_INTERFACE_MODE_HSIC
the pinctrl for device is not acquired. It is however used later
regardless of the mode, hence leads to requesting access to
uninitialized data.

Signed-off-by: Krzysztof Michonski <michonskikrzysztof@xxxxxxxxx>
---
 drivers/usb/chipidea/ci_hdrc_imx.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c
index a4b482c3dc65..2f02b35c40b6 100644
--- a/drivers/usb/chipidea/ci_hdrc_imx.c
+++ b/drivers/usb/chipidea/ci_hdrc_imx.c
@@ -428,6 +428,9 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)
 		pm_runtime_enable(dev);
 	}
 
+	if (!data->pinctrl)
+		data->pinctrl = devm_pinctrl_get(dev);
+
 	if (!IS_ERR(data->pinctrl)) {
 		struct pinctrl_state *state;
 
-- 
2.21.0




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux