hwmon: pwm-fan: Refactor pwm_fan_probe
authorPaul Barker <pbarker@konsulko.com>
Thu, 26 Nov 2020 17:44:07 +0000 (17:44 +0000)
committerGuenter Roeck <linux@roeck-us.net>
Thu, 3 Dec 2020 01:42:24 +0000 (17:42 -0800)
commitb5fcb8a4018dabf9cbcb9a83757bd74576c66174
tree48a5b02f4495bdba4162edb9a92336ce4df2acef
parent02c155cb321643df9400a9af082902fcff222ad9
hwmon: pwm-fan: Refactor pwm_fan_probe

Use platform_irq_count to determine the number of fan tachometer inputs
configured in the device tree. At this stage we support either 0 or 1
inputs.

Once we have this information we only need to read the
pulses-per-revolution value if a fan tachometer is actually configured
via an IRQ value.

Also add a debug print of the IRQ number and the pulses-per-revolution
value to aid in investigating issues.

Signed-off-by: Paul Barker <pbarker@konsulko.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20201126174408.755-2-pbarker@konsulko.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/pwm-fan.c