drm/bridge: ti-sn65dsi86: Make use of pwmchip_parent() accessor
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Wed, 14 Feb 2024 09:33:19 +0000 (10:33 +0100)
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Thu, 22 Feb 2024 13:39:28 +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.

Acked-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/10a8d55110fc48a4759e65cc19556858587e94cc.1707900770.git.u.kleine-koenig@pengutronix.de
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
drivers/gpu/drm/bridge/ti-sn65dsi86.c

index 1f6e929c2f6a3cefa84152ea682d6bbf87e9efeb..f1fffbef332470a54d681ba792bfd4bc1c1d45bd 100644 (file)
@@ -1415,7 +1415,7 @@ static int ti_sn_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
        int ret;
 
        if (!pdata->pwm_enabled) {
-               ret = pm_runtime_resume_and_get(chip->dev);
+               ret = pm_runtime_resume_and_get(pwmchip_parent(chip));
                if (ret < 0)
                        return ret;
        }
@@ -1431,7 +1431,7 @@ static int ti_sn_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
                                                 SN_GPIO_MUX_MASK << (2 * SN_PWM_GPIO_IDX),
                                                 SN_GPIO_MUX_SPECIAL << (2 * SN_PWM_GPIO_IDX));
                        if (ret) {
-                               dev_err(chip->dev, "failed to mux in PWM function\n");
+                               dev_err(pwmchip_parent(chip), "failed to mux in PWM function\n");
                                goto out;
                        }
                }
@@ -1507,7 +1507,7 @@ static int ti_sn_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
 
                ret = regmap_write(pdata->regmap, SN_PWM_PRE_DIV_REG, pre_div);
                if (ret) {
-                       dev_err(chip->dev, "failed to update PWM_PRE_DIV\n");
+                       dev_err(pwmchip_parent(chip), "failed to update PWM_PRE_DIV\n");
                        goto out;
                }
 
@@ -1519,7 +1519,7 @@ static int ti_sn_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
                     FIELD_PREP(SN_PWM_INV_MASK, state->polarity == PWM_POLARITY_INVERSED);
        ret = regmap_write(pdata->regmap, SN_PWM_EN_INV_REG, pwm_en_inv);
        if (ret) {
-               dev_err(chip->dev, "failed to update PWM_EN/PWM_INV\n");
+               dev_err(pwmchip_parent(chip), "failed to update PWM_EN/PWM_INV\n");
                goto out;
        }
 
@@ -1527,7 +1527,7 @@ static int ti_sn_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
 out:
 
        if (!pdata->pwm_enabled)
-               pm_runtime_put_sync(chip->dev);
+               pm_runtime_put_sync(pwmchip_parent(chip));
 
        return ret;
 }