Skip to content

Commit 4aacf5f

Browse files
author
Uwe Kleine-König
committed
staging: greybus: pwm: Make use of pwmchip_parent() accessor
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. Reviewed-by: Greg Kroah-Hartman <[email protected]> Link: https://lore.kernel.org/r/7e7517527b825a18ca10cb0faa837577d4f0ec8a.1707900770.git.u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König <[email protected]>
1 parent 46eec87 commit 4aacf5f

File tree

1 file changed

+7
-7
lines changed
  • drivers/staging/greybus

1 file changed

+7
-7
lines changed

drivers/staging/greybus/pwm.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ static int gb_pwm_activate_operation(struct pwm_chip *chip, u8 which)
5151

5252
request.which = which;
5353

54-
gbphy_dev = to_gbphy_dev(chip->dev);
54+
gbphy_dev = to_gbphy_dev(pwmchip_parent(chip));
5555
ret = gbphy_runtime_get_sync(gbphy_dev);
5656
if (ret)
5757
return ret;
@@ -76,7 +76,7 @@ static int gb_pwm_deactivate_operation(struct pwm_chip *chip, u8 which)
7676

7777
request.which = which;
7878

79-
gbphy_dev = to_gbphy_dev(chip->dev);
79+
gbphy_dev = to_gbphy_dev(pwmchip_parent(chip));
8080
ret = gbphy_runtime_get_sync(gbphy_dev);
8181
if (ret)
8282
return ret;
@@ -104,7 +104,7 @@ static int gb_pwm_config_operation(struct pwm_chip *chip,
104104
request.duty = cpu_to_le32(duty);
105105
request.period = cpu_to_le32(period);
106106

107-
gbphy_dev = to_gbphy_dev(chip->dev);
107+
gbphy_dev = to_gbphy_dev(pwmchip_parent(chip));
108108
ret = gbphy_runtime_get_sync(gbphy_dev);
109109
if (ret)
110110
return ret;
@@ -131,7 +131,7 @@ static int gb_pwm_set_polarity_operation(struct pwm_chip *chip,
131131
request.which = which;
132132
request.polarity = polarity;
133133

134-
gbphy_dev = to_gbphy_dev(chip->dev);
134+
gbphy_dev = to_gbphy_dev(pwmchip_parent(chip));
135135
ret = gbphy_runtime_get_sync(gbphy_dev);
136136
if (ret)
137137
return ret;
@@ -156,7 +156,7 @@ static int gb_pwm_enable_operation(struct pwm_chip *chip, u8 which)
156156

157157
request.which = which;
158158

159-
gbphy_dev = to_gbphy_dev(chip->dev);
159+
gbphy_dev = to_gbphy_dev(pwmchip_parent(chip));
160160
ret = gbphy_runtime_get_sync(gbphy_dev);
161161
if (ret)
162162
return ret;
@@ -184,7 +184,7 @@ static int gb_pwm_disable_operation(struct pwm_chip *chip, u8 which)
184184
ret = gb_operation_sync(pwmc->connection, GB_PWM_TYPE_DISABLE,
185185
&request, sizeof(request), NULL, 0);
186186

187-
gbphy_dev = to_gbphy_dev(chip->dev);
187+
gbphy_dev = to_gbphy_dev(pwmchip_parent(chip));
188188
gbphy_runtime_put_autosuspend(gbphy_dev);
189189

190190
return ret;
@@ -198,7 +198,7 @@ static int gb_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm)
198198
static void gb_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm)
199199
{
200200
if (pwm_is_enabled(pwm))
201-
dev_warn(chip->dev, "freeing PWM device without disabling\n");
201+
dev_warn(pwmchip_parent(chip), "freeing PWM device without disabling\n");
202202

203203
gb_pwm_deactivate_operation(chip, pwm->hwpwm);
204204
}

0 commit comments

Comments
 (0)