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 <hminas@synopsys.com>
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Acked-by: Minas Harutyunyan <hminas@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Chunfeng Yun 2019-04-17 16:28:19 +08:00 коммит произвёл Greg Kroah-Hartman
Родитель bbe2028f43
Коммит e894cdc2cb
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -284,10 +284,10 @@ static int dwc2_lowlevel_hw_init(struct dwc2_hsotg *hsotg)
} }
/* Clock */ /* Clock */
hsotg->clk = devm_clk_get(hsotg->dev, "otg"); hsotg->clk = devm_clk_get_optional(hsotg->dev, "otg");
if (IS_ERR(hsotg->clk)) { if (IS_ERR(hsotg->clk)) {
hsotg->clk = NULL; dev_err(hsotg->dev, "cannot get otg clock\n");
dev_dbg(hsotg->dev, "cannot get otg clock\n"); return PTR_ERR(hsotg->clk);
} }
/* Regulators */ /* Regulators */