summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2017-05-23 15:07:10 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2017-05-24 09:16:23 +0200
commit4a64060e90f69f146edd095016548f3235410f0b (patch)
tree0fa02d9fad50eba51bc3ac6b95788403ae0ad3e2
parent74d8a35d4461daa2374f420aef63748f51f1f3aa (diff)
downloadbarebox-4a64060e90f69f146edd095016548f3235410f0b.tar.gz
usb: imx: Only use clock when it exists
Fixes: bbe0df90b8e2463dd8db651e9f1dd57702985d2d I assumed all chipidea devices actually have a clock. This is true when looking at the device tree, but in barebox not all i.MX SoCs use the clocks provided by the device tree. Most instead use clkdev_add_physbase() to attach a clocks to devices. For these the chipidea device does not have a clock. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--drivers/usb/imx/chipidea-imx.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/usb/imx/chipidea-imx.c b/drivers/usb/imx/chipidea-imx.c
index 67d01d3..39593c4 100644
--- a/drivers/usb/imx/chipidea-imx.c
+++ b/drivers/usb/imx/chipidea-imx.c
@@ -276,10 +276,8 @@ static int imx_chipidea_probe(struct device_d *dev)
* devices which have only one.
*/
ci->clk = clk_get(dev, NULL);
- if (IS_ERR(ci->clk))
- return PTR_ERR(ci->clk);
-
- clk_enable(ci->clk);
+ if (!IS_ERR(ci->clk))
+ clk_enable(ci->clk);
if (of_property_read_bool(dev->device_node, "fsl,usbphy")) {
ci->phy = of_phy_get_by_phandle(dev, "fsl,usbphy", 0);