* [PATCH -next v2] power: supply: Remove redundant dev_err_probe() for platform_get_irq_byname()
@ 2023-07-27 11:35 Ruan Jinjie
2023-07-28 8:14 ` Dhruva Gole
2023-09-12 19:08 ` Sebastian Reichel
0 siblings, 2 replies; 3+ messages in thread
From: Ruan Jinjie @ 2023-07-27 11:35 UTC (permalink / raw)
To: sre, matthias.bgg, angelogioacchino.delregno, agross, andersson,
konrad.dybcio, linux-pm, linux-arm-kernel, linux-mediatek,
linux-arm-msm
Cc: ruanjinjie
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>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
v2:
- clarify the commit title
---
drivers/power/supply/mt6370-charger.c | 4 +---
drivers/power/supply/qcom_pmi8998_charger.c | 3 +--
2 files changed, 2 insertions(+), 5 deletions(-)
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);
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH -next v2] power: supply: Remove redundant dev_err_probe() for platform_get_irq_byname()
2023-07-27 11:35 [PATCH -next v2] power: supply: Remove redundant dev_err_probe() for platform_get_irq_byname() Ruan Jinjie
@ 2023-07-28 8:14 ` Dhruva Gole
2023-09-12 19:08 ` Sebastian Reichel
1 sibling, 0 replies; 3+ messages in thread
From: Dhruva Gole @ 2023-07-28 8:14 UTC (permalink / raw)
To: Ruan Jinjie
Cc: sre, matthias.bgg, angelogioacchino.delregno, agross, andersson,
konrad.dybcio, linux-pm, linux-arm-kernel, linux-mediatek,
linux-arm-msm
On Jul 27, 2023 at 19:35:50 +0800, Ruan Jinjie wrote:
> 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.
Ah yes, good catch!
>
> Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> ---
> v2:
> - clarify the commit title
> ---
> drivers/power/supply/mt6370-charger.c | 4 +---
> drivers/power/supply/qcom_pmi8998_charger.c | 3 +--
> 2 files changed, 2 insertions(+), 5 deletions(-)
Reviewed-by: Dhruva Gole <d-gole@ti.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);
> --
> 2.34.1
>
--
Best regards,
Dhruva Gole <d-gole@ti.com>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next v2] power: supply: Remove redundant dev_err_probe() for platform_get_irq_byname()
2023-07-27 11:35 [PATCH -next v2] power: supply: Remove redundant dev_err_probe() for platform_get_irq_byname() Ruan Jinjie
2023-07-28 8:14 ` Dhruva Gole
@ 2023-09-12 19:08 ` Sebastian Reichel
1 sibling, 0 replies; 3+ messages in thread
From: Sebastian Reichel @ 2023-09-12 19:08 UTC (permalink / raw)
To: sre, matthias.bgg, angelogioacchino.delregno, agross, andersson,
konrad.dybcio, linux-pm, linux-arm-kernel, linux-mediatek,
linux-arm-msm, Ruan Jinjie
On Thu, 27 Jul 2023 19:35:50 +0800, Ruan Jinjie wrote:
> 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.
>
>
Applied, thanks!
[1/1] power: supply: Remove redundant dev_err_probe() for platform_get_irq_byname()
commit: 389405146ca11d24f85b3277121a58f98a926a28
Best regards,
--
Sebastian Reichel <sebastian.reichel@collabora.com>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-09-12 19:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-27 11:35 [PATCH -next v2] power: supply: Remove redundant dev_err_probe() for platform_get_irq_byname() Ruan Jinjie
2023-07-28 8:14 ` Dhruva Gole
2023-09-12 19:08 ` Sebastian Reichel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox