Skip to content

Commit

Permalink
hwmon: (pwm-fan): Make use of device properties everywhere
Browse files Browse the repository at this point in the history
Commit 255ab27 ("hwmon: (pwm-fan) Introduce start from stopped state
handling") added two of_property_read_u32() calls after the driver was
reworked to use device_property_* in commit dfd977d ("hwmon: (pwm-fan)
Make use of device properties"), so convert those as well.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Link: https://lore.kernel.org/r/20250102170429.791912-1-peter@korsgaard.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
  • Loading branch information
Peter Korsgaard authored and Guenter Roeck committed Jan 6, 2025
1 parent 6071d10 commit 4b04472
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/hwmon/pwm-fan.c
Original file line number Diff line number Diff line change
Expand Up @@ -638,16 +638,16 @@ static int pwm_fan_probe(struct platform_device *pdev)
channels[1] = &ctx->fan_channel;
}

ret = of_property_read_u32(dev->of_node, "fan-stop-to-start-percent",
&pwm_min_from_stopped);
ret = device_property_read_u32(dev, "fan-stop-to-start-percent",
&pwm_min_from_stopped);
if (!ret && pwm_min_from_stopped) {
ctx->pwm_duty_cycle_from_stopped =
DIV_ROUND_UP_ULL(pwm_min_from_stopped *
(ctx->pwm_state.period - 1),
100);
}
ret = of_property_read_u32(dev->of_node, "fan-stop-to-start-us",
&ctx->pwm_usec_from_stopped);
ret = device_property_read_u32(dev, "fan-stop-to-start-us",
&ctx->pwm_usec_from_stopped);
if (ret)
ctx->pwm_usec_from_stopped = 250000;

Expand Down

0 comments on commit 4b04472

Please sign in to comment.