lkml.org 
[lkml]   [2014]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCHv7 6/8] usb: dwc2: gadget: Do not fail probe if there isn't a clock node
Date
From: Dinh Nguyen <dinguyen@opensource.altera.com>

Since the dwc2 hcd driver is currently not looking for a clock node during
init, we should not completely fail if there isn't a clock provided.
By assigning clk = NULL, this allows the driver, when configured for dual-role
mode, to be able to continue loading the host portion of the driver when
a clock node is not specified.

Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
---
v7: Reworked to use clk=NULL and remove the need to is IS_ERR(clk)
v6: none
v5: reworked to not access gadget functions from the hcd.
---
drivers/usb/dwc2/gadget.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c
index 37c7916..367689b 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -3431,6 +3431,7 @@ int dwc2_gadget_init(struct dwc2_hsotg *hsotg, int irq)

hsotg->clk = devm_clk_get(dev, "otg");
if (IS_ERR(hsotg->clk)) {
+ hsotg->clk = NULL;
dev_err(dev, "cannot get otg clock\n");
return PTR_ERR(hsotg->clk);
}
--
2.0.3


\
 
 \ /
  Last update: 2014-11-11 18:41    [W:0.280 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site