Skip to content

Commit 752d31a

Browse files
Chunfeng Yunkishon
authored andcommitted
phy: socionext: get optional clock by devm_clk_get_optional()
Use devm_clk_get_optional() to get optional clock Cc: Kunihiko Hayashi <[email protected]> Signed-off-by: Chunfeng Yun <[email protected]> Reviewed-by: Kunihiko Hayashi <[email protected]> Signed-off-by: Kishon Vijay Abraham I <[email protected]>
1 parent 1039596 commit 752d31a

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

drivers/phy/socionext/phy-uniphier-usb3hs.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -335,13 +335,9 @@ static int uniphier_u3hsphy_probe(struct platform_device *pdev)
335335
if (IS_ERR(priv->clk_parent))
336336
return PTR_ERR(priv->clk_parent);
337337

338-
priv->clk_ext = devm_clk_get(dev, "phy-ext");
339-
if (IS_ERR(priv->clk_ext)) {
340-
if (PTR_ERR(priv->clk_ext) == -ENOENT)
341-
priv->clk_ext = NULL;
342-
else
343-
return PTR_ERR(priv->clk_ext);
344-
}
338+
priv->clk_ext = devm_clk_get_optional(dev, "phy-ext");
339+
if (IS_ERR(priv->clk_ext))
340+
return PTR_ERR(priv->clk_ext);
345341

346342
priv->rst = devm_reset_control_get_shared(dev, "phy");
347343
if (IS_ERR(priv->rst))

drivers/phy/socionext/phy-uniphier-usb3ss.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -238,13 +238,9 @@ static int uniphier_u3ssphy_probe(struct platform_device *pdev)
238238
if (IS_ERR(priv->clk))
239239
return PTR_ERR(priv->clk);
240240

241-
priv->clk_ext = devm_clk_get(dev, "phy-ext");
242-
if (IS_ERR(priv->clk_ext)) {
243-
if (PTR_ERR(priv->clk_ext) == -ENOENT)
244-
priv->clk_ext = NULL;
245-
else
246-
return PTR_ERR(priv->clk_ext);
247-
}
241+
priv->clk_ext = devm_clk_get_optional(dev, "phy-ext");
242+
if (IS_ERR(priv->clk_ext))
243+
return PTR_ERR(priv->clk_ext);
248244

249245
priv->rst = devm_reset_control_get_shared(dev, "phy");
250246
if (IS_ERR(priv->rst))

0 commit comments

Comments
 (0)