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

Configure Feed

Select the types of activity you want to include in your feed.

phy: freescale: fsl-samsung-hdmi: Use helper function devm_clk_get_enabled()

Since commit 7ef9651e9792 ("clk: Provide new devm_clk helpers for prepared
and enabled clocks"), devm_clk_get() and clk_prepare_enable() can now be
replaced by devm_clk_get_enabled() when driver enables the clocks for the
whole lifetime of the device. Moreover, it is no longer necessary to
unprepare and disable the clocks explicitly.

Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn>
Link: https://lore.kernel.org/r/tencent_9087BCE04E38E6AA5C4B2252B82FA99C2009@qq.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Pei Xiao and committed by
Vinod Koul
27995020 d58c04e3

+1 -9
+1 -9
drivers/phy/freescale/phy-fsl-samsung-hdmi.c
··· 659 659 if (IS_ERR(phy->regs)) 660 660 return PTR_ERR(phy->regs); 661 661 662 - phy->apbclk = devm_clk_get(phy->dev, "apb"); 662 + phy->apbclk = devm_clk_get_enabled(phy->dev, "apb"); 663 663 if (IS_ERR(phy->apbclk)) 664 664 return dev_err_probe(phy->dev, PTR_ERR(phy->apbclk), 665 665 "failed to get apb clk\n"); ··· 668 668 if (IS_ERR(phy->refclk)) 669 669 return dev_err_probe(phy->dev, PTR_ERR(phy->refclk), 670 670 "failed to get ref clk\n"); 671 - 672 - ret = clk_prepare_enable(phy->apbclk); 673 - if (ret) { 674 - dev_err(phy->dev, "failed to enable apbclk\n"); 675 - return ret; 676 - } 677 671 678 672 pm_runtime_get_noresume(phy->dev); 679 673 pm_runtime_set_active(phy->dev); ··· 684 690 return 0; 685 691 686 692 register_clk_failed: 687 - clk_disable_unprepare(phy->apbclk); 688 - 689 693 return ret; 690 694 } 691 695