]> Git Repo - J-linux.git/commitdiff
pwm: stm32-lp: Make use of pwmchip_parent() accessor
authorUwe Kleine-König <[email protected]>
Wed, 14 Feb 2024 09:32:47 +0000 (10:32 +0100)
committerUwe Kleine-König <[email protected]>
Thu, 22 Feb 2024 13:39:24 +0000 (14:39 +0100)
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.

Link: https://lore.kernel.org/r/d79148ed49389c657b72df05758032be2b516ceb.1707900770.git.u.kleine-koenig@pengutronix.de
Signed-off-by: Uwe Kleine-König <[email protected]>
drivers/pwm/pwm-stm32-lp.c

index b46d8193dd0f4708d979831f91682f9c69776ce5..958043bc5c9200494f98ef7485305c4567dd8db0 100644 (file)
@@ -61,7 +61,7 @@ static int stm32_pwm_lp_apply(struct pwm_chip *chip, struct pwm_device *pwm,
        do_div(div, NSEC_PER_SEC);
        if (!div) {
                /* Clock is too slow to achieve requested period. */
-               dev_dbg(chip->dev, "Can't reach %llu ns\n", state->period);
+               dev_dbg(pwmchip_parent(chip), "Can't reach %llu ns\n", state->period);
                return -EINVAL;
        }
 
@@ -69,7 +69,7 @@ static int stm32_pwm_lp_apply(struct pwm_chip *chip, struct pwm_device *pwm,
        while (div > STM32_LPTIM_MAX_ARR) {
                presc++;
                if ((1 << presc) > STM32_LPTIM_MAX_PRESCALER) {
-                       dev_err(chip->dev, "max prescaler exceeded\n");
+                       dev_err(pwmchip_parent(chip), "max prescaler exceeded\n");
                        return -EINVAL;
                }
                div = prd >> presc;
@@ -130,7 +130,7 @@ static int stm32_pwm_lp_apply(struct pwm_chip *chip, struct pwm_device *pwm,
                                       (val & STM32_LPTIM_CMPOK_ARROK) == STM32_LPTIM_CMPOK_ARROK,
                                       100, 1000);
        if (ret) {
-               dev_err(chip->dev, "ARR/CMP registers write issue\n");
+               dev_err(pwmchip_parent(chip), "ARR/CMP registers write issue\n");
                goto err;
        }
        ret = regmap_write(priv->regmap, STM32_LPTIM_ICR,
This page took 0.047306 seconds and 4 git commands to generate.