Skip to content

Commit a8e3c4e

Browse files
ukleineknunojsa
authored andcommitted
pwm: axi-pwmgen: Drop write-only variable in driver private data
.ch_period is only written to, it's never read without already knowing its value. So this member can go away. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
1 parent 1c77626 commit a8e3c4e

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

drivers/pwm/pwm-axi-pwmgen.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@ struct axi_pwmgen {
5757
struct clk *clk;
5858
void __iomem *base;
5959
u8 hw_maj_ver;
60-
61-
/* Used to store the period when the channel is disabled */
62-
unsigned int ch_period[AXI_PWMGEN_N_MAX_PWMS];
6360
};
6461

6562
static inline unsigned int axi_pwmgen_read(struct axi_pwmgen *pwmgen,
@@ -105,9 +102,8 @@ static int axi_pwmgen_apply(struct pwm_chip *chip, struct pwm_device *pwm,
105102

106103
target = state->period * axi_pwmgen_scales[state->time_unit];
107104
cnt = target ? DIV_ROUND_CLOSEST_ULL(target, clk_period_ps) : 0;
108-
pwmgen->ch_period[ch] = cnt;
109105
axi_pwmgen_write(pwmgen, AXI_PWMGEN_CHX_PERIOD(pwmgen, ch),
110-
state->enabled ? pwmgen->ch_period[ch] : 0);
106+
state->enabled ? cnt : 0);
111107

112108
target = state->duty_cycle * axi_pwmgen_scales[state->time_unit];
113109
cnt = target ? DIV_ROUND_CLOSEST_ULL(target, clk_period_ps) : 0;

0 commit comments

Comments
 (0)