Skip to content

Commit 5dd4826

Browse files
hidrv4sre
authored andcommitted
power: supply: da9150: Remove redundant error logging
A call to platform_get_irq_byname() already prints an error on failure within its own implementation. So printing another error based on its return value in the caller is redundant and should be removed. The clean up also makes if condition block braces and the device pointer variable dev unnecessary. Remove those as well. Issue identified using platform_get_irq.cocci coccinelle semantic patch. Signed-off-by: Deepak R Varma <drv@mailo.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
1 parent a441f3b commit 5dd4826

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

drivers/power/supply/da9150-charger.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -466,10 +466,8 @@ static int da9150_charger_register_irq(struct platform_device *pdev,
466466
int irq, ret;
467467

468468
irq = platform_get_irq_byname(pdev, irq_name);
469-
if (irq < 0) {
470-
dev_err(dev, "Failed to get IRQ CHG_STATUS: %d\n", irq);
469+
if (irq < 0)
471470
return irq;
472-
}
473471

474472
ret = request_threaded_irq(irq, NULL, handler, IRQF_ONESHOT, irq_name,
475473
charger);
@@ -482,15 +480,12 @@ static int da9150_charger_register_irq(struct platform_device *pdev,
482480
static void da9150_charger_unregister_irq(struct platform_device *pdev,
483481
const char *irq_name)
484482
{
485-
struct device *dev = &pdev->dev;
486483
struct da9150_charger *charger = platform_get_drvdata(pdev);
487484
int irq;
488485

489486
irq = platform_get_irq_byname(pdev, irq_name);
490-
if (irq < 0) {
491-
dev_err(dev, "Failed to get IRQ CHG_STATUS: %d\n", irq);
487+
if (irq < 0)
492488
return;
493-
}
494489

495490
free_irq(irq, charger);
496491
}

0 commit comments

Comments
 (0)