Message ID | YJotlJBJ1CVAgvMT@mwanda (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
Series | clk: qcom: cleanup some dev_err_probe() calls | expand |
Quoting Dan Carpenter (2021-05-11 00:09:08) > The dev_err_probe() function prints an error message if the error > code is not -EPROBE_DEFER. If we know the error code in is -ENODEV > then there is no reason to check. Conversely, we do not need to > check for -EPROBE_DEFER before calling. > > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> > --- Applied to clk-next with some manual effort
diff --git a/drivers/clk/qcom/apcs-sdx55.c b/drivers/clk/qcom/apcs-sdx55.c index d0edabebf9c2..ee3fbe755f72 100644 --- a/drivers/clk/qcom/apcs-sdx55.c +++ b/drivers/clk/qcom/apcs-sdx55.c @@ -57,7 +57,7 @@ static int qcom_apcs_sdx55_clk_probe(struct platform_device *pdev) regmap = dev_get_regmap(parent, NULL); if (!regmap) { - dev_err_probe(dev, -ENODEV, "Failed to get parent regmap\n"); + dev_err(dev, "Failed to get parent regmap\n"); return -ENODEV; } @@ -82,9 +82,7 @@ static int qcom_apcs_sdx55_clk_probe(struct platform_device *pdev) 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; + return dev_err_probe(dev, ret, "Failed to get PLL clk\n"); } a7cc->clk_nb.notifier_call = a7cc_notifier_cb;
The dev_err_probe() function prints an error message if the error code is not -EPROBE_DEFER. If we know the error code in is -ENODEV then there is no reason to check. Conversely, we do not need to check for -EPROBE_DEFER before calling. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> --- drivers/clk/qcom/apcs-sdx55.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)