mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 22:37:45 -04:00
usb: dwc2: get optional clock by devm_clk_get_optional()
When the driver tries to get optional clock, it ignores all errors, but if only ignores -ENOENT, it will cover some real errors, such as -EPROBE_DEFER, so use devm_clk_get_optional() to get optional clock. Cc: Minas Harutyunyan <[email protected]> Signed-off-by: Chunfeng Yun <[email protected]> Acked-by: Minas Harutyunyan <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
This commit is contained in:
1 parent
466375657d
commit
60722c4eef
1 file changed
+3
-3
@@ -284,10 +284,10 @@ static int dwc2_lowlevel_hw_init(struct dwc2_hsotg *hsotg)
|
||||
}
|
||||
|
||||
/* Clock */
|
||||
hsotg->clk = devm_clk_get(hsotg->dev, "otg");
|
||||
hsotg->clk = devm_clk_get_optional(hsotg->dev, "otg");
|
||||
if (IS_ERR(hsotg->clk)) {
|
||||
hsotg->clk = NULL;
|
||||
dev_dbg(hsotg->dev, "cannot get otg clock\n");
|
||||
dev_err(hsotg->dev, "cannot get otg clock\n");
|
||||
return PTR_ERR(hsotg->clk);
|
||||
}
|
||||
|
||||
/* Regulators */
|
||||
|
||||
Reference in new issue
Block a user