[PATCH] phy: usb-nop-xceiv: Make the clock always optional

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

 



The clock seems to be optional at probe time, if not found it's set
to NULL. However this was not the case in the function nop_usbphy_init
which exits with error if the clock cannot be enabled.

Make the clock optional also during the nop_usbphy_init by trying to
do the clock init only if the clock has been found during probe.

Signed-off-by: Jules Maselbas <jmaselbas@xxxxxxxxx>
---
 drivers/phy/usb-nop-xceiv.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/phy/usb-nop-xceiv.c b/drivers/phy/usb-nop-xceiv.c
index 7ea7d28a2..b549b564b 100644
--- a/drivers/phy/usb-nop-xceiv.c
+++ b/drivers/phy/usb-nop-xceiv.c
@@ -46,9 +46,11 @@ static int nop_usbphy_init(struct phy *phy)
 	int ret;
 	struct nop_usbphy *nopphy = phy_get_drvdata(phy);
 
-	ret = clk_enable(nopphy->clk);
-	if (ret < 0)
-		return ret;
+	if (nopphy->clk) {
+		ret = clk_enable(nopphy->clk);
+		if (ret < 0)
+			return ret;
+	}
 
 	if (gpio_is_valid(nopphy->reset)) {
 		/*
-- 
2.17.1



_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux