Message ID | 20230727082301.741821-1-ruanjinjie@huawei.com (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show |
Series | [-next] power: supply: Remove redundant dev_err_probe() | expand |
Il 27/07/23 10:23, Ruan Jinjie ha scritto: > There is no need to call the dev_err_probe() function directly to print > a custom message when handling an error from platform_get_irq_byname() > function as it is going to display an appropriate error message > in case of a failure. > > Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com> power: supply: Remove redundant dev_err_probe() for platform_get_irq_byname() After clarifying the commit title, Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
diff --git a/drivers/power/supply/mt6370-charger.c b/drivers/power/supply/mt6370-charger.c index f27dae5043f5..571cf00dde07 100644 --- a/drivers/power/supply/mt6370-charger.c +++ b/drivers/power/supply/mt6370-charger.c @@ -849,9 +849,7 @@ static int mt6370_chg_init_irq(struct mt6370_priv *priv) ret = platform_get_irq_byname(to_platform_device(priv->dev), mt6370_chg_irqs[i].name); if (ret < 0) - return dev_err_probe(priv->dev, ret, - "Failed to get irq %s\n", - mt6370_chg_irqs[i].name); + return ret; priv->irq_nums[i] = ret; ret = devm_request_threaded_irq(priv->dev, ret, NULL, diff --git a/drivers/power/supply/qcom_pmi8998_charger.c b/drivers/power/supply/qcom_pmi8998_charger.c index d16c5ee17249..ce7392e7d8b8 100644 --- a/drivers/power/supply/qcom_pmi8998_charger.c +++ b/drivers/power/supply/qcom_pmi8998_charger.c @@ -922,8 +922,7 @@ static int smb2_init_irq(struct smb2_chip *chip, int *irq, const char *name, irqnum = platform_get_irq_byname(to_platform_device(chip->dev), name); if (irqnum < 0) - return dev_err_probe(chip->dev, irqnum, - "Couldn't get irq %s byname\n", name); + return irqnum; rc = devm_request_threaded_irq(chip->dev, irqnum, NULL, handler, IRQF_ONESHOT, name, chip);
There is no need to call the dev_err_probe() function directly to print a custom message when handling an error from platform_get_irq_byname() function as it is going to display an appropriate error message in case of a failure. Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com> --- drivers/power/supply/mt6370-charger.c | 4 +--- drivers/power/supply/qcom_pmi8998_charger.c | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-)