hwmon: (aspeed-g6-pwm-tacho): Make use of pwmchip_parent() accessor
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Mon, 18 Mar 2024 16:09:49 +0000 (17:09 +0100)
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Fri, 26 Apr 2024 19:29:16 +0000 (21:29 +0200)
struct pwm_chip::dev is about to change. To not have to touch this
driver in the same commit as struct pwm_chip::dev, use the accessor
function provided for exactly this purpose.

Acked-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/5c6a11dd10cd29e0f7bfaa1fdef145523347cb58.1710777536.git.u.kleine-koenig@pengutronix.de
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
drivers/hwmon/aspeed-g6-pwm-tach.c

index 597b3b019d49a940a97a4c394e8fe2b3f6deab35..64def5e4cdf60a6db09ac241d05b45f48729b551 100644 (file)
@@ -195,7 +195,7 @@ static int aspeed_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
 
        expect_period = div64_u64(ULLONG_MAX, (u64)priv->clk_rate);
        expect_period = min(expect_period, state->period);
-       dev_dbg(chip->dev, "expect period: %lldns, duty_cycle: %lldns",
+       dev_dbg(pwmchip_parent(chip), "expect period: %lldns, duty_cycle: %lldns",
                expect_period, state->duty_cycle);
        /*
         * Pick the smallest value for div_h so that div_l can be the biggest
@@ -218,12 +218,12 @@ static int aspeed_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
        if (div_l > 255)
                div_l = 255;
 
-       dev_dbg(chip->dev, "clk source: %ld div_h %lld, div_l : %lld\n",
+       dev_dbg(pwmchip_parent(chip), "clk source: %ld div_h %lld, div_l : %lld\n",
                priv->clk_rate, div_h, div_l);
        /* duty_pt = duty_cycle * (PERIOD + 1) / period */
        duty_pt = div64_u64(state->duty_cycle * priv->clk_rate,
                            (u64)NSEC_PER_SEC * (div_l + 1) << div_h);
-       dev_dbg(chip->dev, "duty_cycle = %lld, duty_pt = %d\n",
+       dev_dbg(pwmchip_parent(chip), "duty_cycle = %lld, duty_pt = %d\n",
                state->duty_cycle, duty_pt);
 
        /*