Skip to content

Commit

Permalink
phy: phy-meson-gxl-usb2: 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: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
  • Loading branch information
Chunfeng Yun authored and Kishon Vijay Abraham I committed Apr 17, 2019
1 parent 752d31a commit 42c7cb7
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions drivers/phy/amlogic/phy-meson-gxl-usb2.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,14 +261,9 @@ static int phy_meson_gxl_usb2_probe(struct platform_device *pdev)
if (IS_ERR(priv->regmap))
return PTR_ERR(priv->regmap);

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

priv->reset = devm_reset_control_get_optional_shared(dev, "phy");
if (IS_ERR(priv->reset))
Expand Down

0 comments on commit 42c7cb7

Please sign in to comment.