hwmon: pwm-fan: Use platform_get_irq_optional()

The PWM fan interrupt is optional, so we don't want an error message in
the kernel log if it wasn't specified.

Signed-off-by: Thierry Reding <[email protected]>
Reviewed-by: Stephen Boyd <[email protected]>
Acked-by: Guenter Roeck <[email protected]>
Acked-by: Bartlomiej Zolnierkiewicz <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
Thierry Reding 2019-08-28 10:34:11 +02:00 • committed by Greg Kroah-Hartman
commit 6e7e5c7fbc

View file

@ -304,7 +304,7 @@ static int pwm_fan_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, ctx);
ctx->irq = platform_get_irq(pdev, 0);
ctx->irq = platform_get_irq_optional(pdev, 0);
if (ctx->irq == -EPROBE_DEFER)
return ctx->irq;