Skip to content

Commit 9a6ac82

Browse files
Uwe Kleine-Königthierryreding
authored andcommitted
pwm: atmel-tcb: Unroll atmel_tcb_pwm_set_polarity() into only caller
atmel_tcb_pwm_set_polarity() is only called once and effectively wraps an assignment only. Replace the function call by the respective assignment. Signed-off-by: Uwe Kleine-König <[email protected]> Reviewed-by: Claudiu Beznea <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
1 parent 78dca23 commit 9a6ac82

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

drivers/pwm/pwm-atmel-tcb.c

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -67,18 +67,6 @@ static inline struct atmel_tcb_pwm_chip *to_tcb_chip(struct pwm_chip *chip)
6767
return container_of(chip, struct atmel_tcb_pwm_chip, chip);
6868
}
6969

70-
static int atmel_tcb_pwm_set_polarity(struct pwm_chip *chip,
71-
struct pwm_device *pwm,
72-
enum pwm_polarity polarity)
73-
{
74-
struct atmel_tcb_pwm_chip *tcbpwmc = to_tcb_chip(chip);
75-
struct atmel_tcb_pwm_device *tcbpwm = &tcbpwmc->pwms[pwm->hwpwm];
76-
77-
tcbpwm->polarity = polarity;
78-
79-
return 0;
80-
}
81-
8270
static int atmel_tcb_pwm_request(struct pwm_chip *chip,
8371
struct pwm_device *pwm)
8472
{
@@ -356,11 +344,12 @@ static int atmel_tcb_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
356344
static int atmel_tcb_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
357345
const struct pwm_state *state)
358346
{
347+
struct atmel_tcb_pwm_chip *tcbpwmc = to_tcb_chip(chip);
348+
struct atmel_tcb_pwm_device *tcbpwm = &tcbpwmc->pwms[pwm->hwpwm];
359349
int duty_cycle, period;
360350
int ret;
361351

362-
/* This function only sets a flag in driver data */
363-
atmel_tcb_pwm_set_polarity(chip, pwm, state->polarity);
352+
tcbpwm->polarity = state->polarity;
364353

365354
if (!state->enabled) {
366355
atmel_tcb_pwm_disable(chip, pwm);

0 commit comments

Comments
 (0)