phy: socionext: get optional clock by devm_clk_get_optional()
authorChunfeng Yun <chunfeng.yun@mediatek.com>
Wed, 10 Apr 2019 06:13:05 +0000 (14:13 +0800)
committerKishon Vijay Abraham I <kishon@ti.com>
Wed, 17 Apr 2019 08:43:15 +0000 (14:13 +0530)
Use devm_clk_get_optional() to get optional clock

Cc: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Reviewed-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
drivers/phy/socionext/phy-uniphier-usb3hs.c
drivers/phy/socionext/phy-uniphier-usb3ss.c

index b1b048be61664c2e34cd6d70048ea277b0b3a116..50f379fc4e06c4ab727b8a8a8aa9b8dbebd44cca 100644 (file)
@@ -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))
index 4be95679c7d86a345310eb684b7c1b833c7cb73e..ec231e40ef2ace3bc324d6566bd6594250c813ad 100644 (file)
@@ -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))