Commit 86881de4 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Stephen Boyd

clk: qcom: Simplify usage of dev_err_probe()

dev_err_probe() returns the error code passed as second parameter. Also if
the error code is -EPROBE_DEFER dev_err_probe() is silent, so there is no
need to check for this value before calling dev_err_probe().
Signed-off-by: default avatarUwe Kleine-König <uwe@kleine-koenig.org>
Link: https://lore.kernel.org/r/20210427164522.2886825-1-uwe@kleine-koenig.orgReviewed-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent 7f891faf
......@@ -56,10 +56,8 @@ static int qcom_apcs_sdx55_clk_probe(struct platform_device *pdev)
int ret;
regmap = dev_get_regmap(parent, NULL);
if (!regmap) {
dev_err_probe(dev, -ENODEV, "Failed to get parent regmap\n");
return -ENODEV;
}
if (!regmap)
return dev_err_probe(dev, -ENODEV, "Failed to get parent regmap\n");
a7cc = devm_kzalloc(dev, sizeof(*a7cc), GFP_KERNEL);
if (!a7cc)
......@@ -80,19 +78,15 @@ static int qcom_apcs_sdx55_clk_probe(struct platform_device *pdev)
a7cc->parent_map = apcs_mux_clk_parent_map;
a7cc->pclk = devm_clk_get(parent, "pll");
if (IS_ERR(a7cc->pclk)) {
ret = PTR_ERR(a7cc->pclk);
if (ret != -EPROBE_DEFER)
dev_err_probe(dev, ret, "Failed to get PLL clk\n");
return ret;
}
if (IS_ERR(a7cc->pclk))
return dev_err_probe(dev, PTR_ERR(a7cc->pclk),
"Failed to get PLL clk\n");
a7cc->clk_nb.notifier_call = a7cc_notifier_cb;
ret = clk_notifier_register(a7cc->pclk, &a7cc->clk_nb);
if (ret) {
dev_err_probe(dev, ret, "Failed to register clock notifier\n");
return ret;
}
if (ret)
return dev_err_probe(dev, ret,
"Failed to register clock notifier\n");
ret = devm_clk_register_regmap(dev, &a7cc->clkr);
if (ret) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment