Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

phy: socionext: get optional clock by devm_clk_get_optional()

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>

authored by

Chunfeng Yun and committed by
Kishon Vijay Abraham I
752d31a3 1039596c

+6 -14
+3 -7
drivers/phy/socionext/phy-uniphier-usb3hs.c
··· 335 335 if (IS_ERR(priv->clk_parent)) 336 336 return PTR_ERR(priv->clk_parent); 337 337 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); 345 341 346 342 priv->rst = devm_reset_control_get_shared(dev, "phy"); 347 343 if (IS_ERR(priv->rst))
+3 -7
drivers/phy/socionext/phy-uniphier-usb3ss.c
··· 238 238 if (IS_ERR(priv->clk)) 239 239 return PTR_ERR(priv->clk); 240 240 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); 248 244 249 245 priv->rst = devm_reset_control_get_shared(dev, "phy"); 250 246 if (IS_ERR(priv->rst))