Skip to content

Commit

Permalink
phy: socionext: get optional clock by devm_clk_get_optional()
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Chunfeng Yun authored and kishon committed Apr 17, 2019
1 parent 1039596 commit 752d31a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
10 changes: 3 additions & 7 deletions drivers/phy/socionext/phy-uniphier-usb3hs.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,13 +335,9 @@ static int uniphier_u3hsphy_probe(struct platform_device *pdev)
if (IS_ERR(priv->clk_parent))
return PTR_ERR(priv->clk_parent);

priv->clk_ext = devm_clk_get(dev, "phy-ext");
if (IS_ERR(priv->clk_ext)) {
if (PTR_ERR(priv->clk_ext) == -ENOENT)
priv->clk_ext = NULL;
else
return PTR_ERR(priv->clk_ext);
}
priv->clk_ext = devm_clk_get_optional(dev, "phy-ext");
if (IS_ERR(priv->clk_ext))
return PTR_ERR(priv->clk_ext);

priv->rst = devm_reset_control_get_shared(dev, "phy");
if (IS_ERR(priv->rst))
Expand Down
10 changes: 3 additions & 7 deletions drivers/phy/socionext/phy-uniphier-usb3ss.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,13 +238,9 @@ static int uniphier_u3ssphy_probe(struct platform_device *pdev)
if (IS_ERR(priv->clk))
return PTR_ERR(priv->clk);

priv->clk_ext = devm_clk_get(dev, "phy-ext");
if (IS_ERR(priv->clk_ext)) {
if (PTR_ERR(priv->clk_ext) == -ENOENT)
priv->clk_ext = NULL;
else
return PTR_ERR(priv->clk_ext);
}
priv->clk_ext = devm_clk_get_optional(dev, "phy-ext");
if (IS_ERR(priv->clk_ext))
return PTR_ERR(priv->clk_ext);

priv->rst = devm_reset_control_get_shared(dev, "phy");
if (IS_ERR(priv->rst))
Expand Down

0 comments on commit 752d31a

Please sign in to comment.