Skip to content

Commit 1c24535

Browse files
Yuuoniygregkh
authored andcommitted
misc: atmel-ssc: Fix IRQ check in ssc_probe
platform_get_irq() returns negative error number instead 0 on failure. And the doc of platform_get_irq() provides a usage example: int irq = platform_get_irq(pdev, 0); if (irq < 0) return irq; Fix the check of return value to catch errors correctly. Fixes: eb1f293 ("Driver for the Atmel on-chip SSC on AT32AP and AT91") Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com> Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Link: https://lore.kernel.org/r/20220601123026.7119-1-linmq006@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 6497e77 commit 1c24535

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/misc/atmel-ssc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,9 @@ static int ssc_probe(struct platform_device *pdev)
232232
clk_disable_unprepare(ssc->clk);
233233

234234
ssc->irq = platform_get_irq(pdev, 0);
235-
if (!ssc->irq) {
235+
if (ssc->irq < 0) {
236236
dev_dbg(&pdev->dev, "could not get irq\n");
237-
return -ENXIO;
237+
return ssc->irq;
238238
}
239239

240240
mutex_lock(&user_lock);

0 commit comments

Comments
 (0)