2023-05-12 06:19:48

by ChiaEn Wu

[permalink] [raw]
Subject: [PATCH] power: supply: rt9467: Fix passing zero to 'dev_err_probe'

Fix passing zero to 'dev_err_probe()' in 'rt9467_request_interrupt()'

Fixes: 6f7f70e3a8dd ("power: supply: rt9467: Add Richtek RT9467 charger driver")
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>
Link: https://lore.kernel.org/r/[email protected]/
Signed-off-by: ChiaEn Wu <[email protected]>
---
drivers/power/supply/rt9467-charger.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/supply/rt9467-charger.c b/drivers/power/supply/rt9467-charger.c
index 73f744a..ea33693 100644
--- a/drivers/power/supply/rt9467-charger.c
+++ b/drivers/power/supply/rt9467-charger.c
@@ -1023,7 +1023,7 @@ static int rt9467_request_interrupt(struct rt9467_chg_data *data)
for (i = 0; i < num_chg_irqs; i++) {
virq = regmap_irq_get_virq(data->irq_chip_data, chg_irqs[i].hwirq);
if (virq <= 0)
- return dev_err_probe(dev, virq, "Failed to get (%s) irq\n",
+ return dev_err_probe(dev, -EINVAL, "Failed to get (%s) irq\n",
chg_irqs[i].name);

ret = devm_request_threaded_irq(dev, virq, NULL, chg_irqs[i].handler,
--
2.7.4



2023-05-15 01:13:01

by Sebastian Reichel

[permalink] [raw]
Subject: Re: [PATCH] power: supply: rt9467: Fix passing zero to 'dev_err_probe'

Hi,

On Fri, May 12, 2023 at 01:44:23PM +0800, ChiaEn Wu wrote:
> Fix passing zero to 'dev_err_probe()' in 'rt9467_request_interrupt()'
>
> Fixes: 6f7f70e3a8dd ("power: supply: rt9467: Add Richtek RT9467 charger driver")
> Reported-by: kernel test robot <[email protected]>
> Reported-by: Dan Carpenter <[email protected]>
> Link: https://lore.kernel.org/r/[email protected]/
> Signed-off-by: ChiaEn Wu <[email protected]>
> ---

Thanks, queued to my fixes branch.

-- Sebastian

> drivers/power/supply/rt9467-charger.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/power/supply/rt9467-charger.c b/drivers/power/supply/rt9467-charger.c
> index 73f744a..ea33693 100644
> --- a/drivers/power/supply/rt9467-charger.c
> +++ b/drivers/power/supply/rt9467-charger.c
> @@ -1023,7 +1023,7 @@ static int rt9467_request_interrupt(struct rt9467_chg_data *data)
> for (i = 0; i < num_chg_irqs; i++) {
> virq = regmap_irq_get_virq(data->irq_chip_data, chg_irqs[i].hwirq);
> if (virq <= 0)
> - return dev_err_probe(dev, virq, "Failed to get (%s) irq\n",
> + return dev_err_probe(dev, -EINVAL, "Failed to get (%s) irq\n",
> chg_irqs[i].name);
>
> ret = devm_request_threaded_irq(dev, virq, NULL, chg_irqs[i].handler,
> --
> 2.7.4
>


Attachments:
(No filename) (1.31 kB)
signature.asc (849.00 B)
Download all attachments