Skip to content

Commit dac7837

Browse files
Ruan Jinjiealexandrebelloni
authored andcommitted
rtc: tps65910: Remove redundant dev_warn() and do not check for 0 return after calling platform_get_irq()
It is not possible for platform_get_irq() to return 0. Use the return value from platform_get_irq(). And there is no need to call the dev_warn() function directly to print a custom message when handling an error from platform_get_irq() function as it is going to display an appropriate error message in case of a failure. Signed-off-by: Ruan Jinjie <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
1 parent 4d349a5 commit dac7837

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

drivers/rtc/rtc-tps65910.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -406,11 +406,8 @@ static int tps65910_rtc_probe(struct platform_device *pdev)
406406
platform_set_drvdata(pdev, tps_rtc);
407407

408408
irq = platform_get_irq(pdev, 0);
409-
if (irq <= 0) {
410-
dev_warn(&pdev->dev, "Wake up is not possible as irq = %d\n",
411-
irq);
412-
return -ENXIO;
413-
}
409+
if (irq < 0)
410+
return irq;
414411

415412
ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
416413
tps65910_rtc_interrupt, IRQF_TRIGGER_LOW,

0 commit comments

Comments
 (0)