@@ -51,7 +51,7 @@ static int gb_pwm_activate_operation(struct pwm_chip *chip, u8 which)
51
51
52
52
request .which = which ;
53
53
54
- gbphy_dev = to_gbphy_dev (chip -> dev );
54
+ gbphy_dev = to_gbphy_dev (pwmchip_parent ( chip ) );
55
55
ret = gbphy_runtime_get_sync (gbphy_dev );
56
56
if (ret )
57
57
return ret ;
@@ -76,7 +76,7 @@ static int gb_pwm_deactivate_operation(struct pwm_chip *chip, u8 which)
76
76
77
77
request .which = which ;
78
78
79
- gbphy_dev = to_gbphy_dev (chip -> dev );
79
+ gbphy_dev = to_gbphy_dev (pwmchip_parent ( chip ) );
80
80
ret = gbphy_runtime_get_sync (gbphy_dev );
81
81
if (ret )
82
82
return ret ;
@@ -104,7 +104,7 @@ static int gb_pwm_config_operation(struct pwm_chip *chip,
104
104
request .duty = cpu_to_le32 (duty );
105
105
request .period = cpu_to_le32 (period );
106
106
107
- gbphy_dev = to_gbphy_dev (chip -> dev );
107
+ gbphy_dev = to_gbphy_dev (pwmchip_parent ( chip ) );
108
108
ret = gbphy_runtime_get_sync (gbphy_dev );
109
109
if (ret )
110
110
return ret ;
@@ -131,7 +131,7 @@ static int gb_pwm_set_polarity_operation(struct pwm_chip *chip,
131
131
request .which = which ;
132
132
request .polarity = polarity ;
133
133
134
- gbphy_dev = to_gbphy_dev (chip -> dev );
134
+ gbphy_dev = to_gbphy_dev (pwmchip_parent ( chip ) );
135
135
ret = gbphy_runtime_get_sync (gbphy_dev );
136
136
if (ret )
137
137
return ret ;
@@ -156,7 +156,7 @@ static int gb_pwm_enable_operation(struct pwm_chip *chip, u8 which)
156
156
157
157
request .which = which ;
158
158
159
- gbphy_dev = to_gbphy_dev (chip -> dev );
159
+ gbphy_dev = to_gbphy_dev (pwmchip_parent ( chip ) );
160
160
ret = gbphy_runtime_get_sync (gbphy_dev );
161
161
if (ret )
162
162
return ret ;
@@ -184,7 +184,7 @@ static int gb_pwm_disable_operation(struct pwm_chip *chip, u8 which)
184
184
ret = gb_operation_sync (pwmc -> connection , GB_PWM_TYPE_DISABLE ,
185
185
& request , sizeof (request ), NULL , 0 );
186
186
187
- gbphy_dev = to_gbphy_dev (chip -> dev );
187
+ gbphy_dev = to_gbphy_dev (pwmchip_parent ( chip ) );
188
188
gbphy_runtime_put_autosuspend (gbphy_dev );
189
189
190
190
return ret ;
@@ -198,7 +198,7 @@ static int gb_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm)
198
198
static void gb_pwm_free (struct pwm_chip * chip , struct pwm_device * pwm )
199
199
{
200
200
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" );
202
202
203
203
gb_pwm_deactivate_operation (chip , pwm -> hwpwm );
204
204
}
0 commit comments