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: qcom-qmp: Make use of the helper function devm_add_action_or_reset()

The helper function devm_add_action_or_reset() will internally
call devm_add_action(), and gif devm_add_action() fails then it will
execute the action mentioned and return the error code. So
use devm_add_action_or_reset() instead of devm_add_action()
to simplify the error handling, reduce the code.

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20210922130017.692-1-caihuoqing@baidu.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Cai Huoqing and committed by
Vinod Koul
6ae6942f 55b9b741

+2 -10
+2 -10
drivers/phy/qualcomm/phy-qcom-qmp.c
··· 5154 5154 * Roll a devm action because the clock provider is the child node, but 5155 5155 * the child node is not actually a device. 5156 5156 */ 5157 - ret = devm_add_action(qmp->dev, phy_clk_release_provider, np); 5158 - if (ret) 5159 - phy_clk_release_provider(np); 5160 - 5161 - return ret; 5157 + return devm_add_action_or_reset(qmp->dev, phy_clk_release_provider, np); 5162 5158 } 5163 5159 5164 5160 /* ··· 5346 5350 * Roll a devm action because the clock provider is the child node, but 5347 5351 * the child node is not actually a device. 5348 5352 */ 5349 - ret = devm_add_action(qmp->dev, phy_clk_release_provider, np); 5350 - if (ret) 5351 - phy_clk_release_provider(np); 5352 - 5353 - return ret; 5353 + return devm_add_action_or_reset(qmp->dev, phy_clk_release_provider, np); 5354 5354 } 5355 5355 5356 5356 static const struct phy_ops qcom_qmp_phy_gen_ops = {