@@ -47,7 +47,7 @@ static const enum counter_function stm32_count_functions[] = {
47
47
static int stm32_count_read (struct counter_device * counter ,
48
48
struct counter_count * count , u64 * val )
49
49
{
50
- struct stm32_timer_cnt * const priv = counter -> priv ;
50
+ struct stm32_timer_cnt * const priv = counter_priv ( counter ) ;
51
51
u32 cnt ;
52
52
53
53
regmap_read (priv -> regmap , TIM_CNT , & cnt );
@@ -59,7 +59,7 @@ static int stm32_count_read(struct counter_device *counter,
59
59
static int stm32_count_write (struct counter_device * counter ,
60
60
struct counter_count * count , const u64 val )
61
61
{
62
- struct stm32_timer_cnt * const priv = counter -> priv ;
62
+ struct stm32_timer_cnt * const priv = counter_priv ( counter ) ;
63
63
u32 ceiling ;
64
64
65
65
regmap_read (priv -> regmap , TIM_ARR , & ceiling );
@@ -73,7 +73,7 @@ static int stm32_count_function_read(struct counter_device *counter,
73
73
struct counter_count * count ,
74
74
enum counter_function * function )
75
75
{
76
- struct stm32_timer_cnt * const priv = counter -> priv ;
76
+ struct stm32_timer_cnt * const priv = counter_priv ( counter ) ;
77
77
u32 smcr ;
78
78
79
79
regmap_read (priv -> regmap , TIM_SMCR , & smcr );
@@ -100,7 +100,7 @@ static int stm32_count_function_write(struct counter_device *counter,
100
100
struct counter_count * count ,
101
101
enum counter_function function )
102
102
{
103
- struct stm32_timer_cnt * const priv = counter -> priv ;
103
+ struct stm32_timer_cnt * const priv = counter_priv ( counter ) ;
104
104
u32 cr1 , sms ;
105
105
106
106
switch (function ) {
@@ -140,7 +140,7 @@ static int stm32_count_direction_read(struct counter_device *counter,
140
140
struct counter_count * count ,
141
141
enum counter_count_direction * direction )
142
142
{
143
- struct stm32_timer_cnt * const priv = counter -> priv ;
143
+ struct stm32_timer_cnt * const priv = counter_priv ( counter ) ;
144
144
u32 cr1 ;
145
145
146
146
regmap_read (priv -> regmap , TIM_CR1 , & cr1 );
@@ -153,7 +153,7 @@ static int stm32_count_direction_read(struct counter_device *counter,
153
153
static int stm32_count_ceiling_read (struct counter_device * counter ,
154
154
struct counter_count * count , u64 * ceiling )
155
155
{
156
- struct stm32_timer_cnt * const priv = counter -> priv ;
156
+ struct stm32_timer_cnt * const priv = counter_priv ( counter ) ;
157
157
u32 arr ;
158
158
159
159
regmap_read (priv -> regmap , TIM_ARR , & arr );
@@ -166,7 +166,7 @@ static int stm32_count_ceiling_read(struct counter_device *counter,
166
166
static int stm32_count_ceiling_write (struct counter_device * counter ,
167
167
struct counter_count * count , u64 ceiling )
168
168
{
169
- struct stm32_timer_cnt * const priv = counter -> priv ;
169
+ struct stm32_timer_cnt * const priv = counter_priv ( counter ) ;
170
170
171
171
if (ceiling > priv -> max_arr )
172
172
return - ERANGE ;
@@ -181,7 +181,7 @@ static int stm32_count_ceiling_write(struct counter_device *counter,
181
181
static int stm32_count_enable_read (struct counter_device * counter ,
182
182
struct counter_count * count , u8 * enable )
183
183
{
184
- struct stm32_timer_cnt * const priv = counter -> priv ;
184
+ struct stm32_timer_cnt * const priv = counter_priv ( counter ) ;
185
185
u32 cr1 ;
186
186
187
187
regmap_read (priv -> regmap , TIM_CR1 , & cr1 );
@@ -194,7 +194,7 @@ static int stm32_count_enable_read(struct counter_device *counter,
194
194
static int stm32_count_enable_write (struct counter_device * counter ,
195
195
struct counter_count * count , u8 enable )
196
196
{
197
- struct stm32_timer_cnt * const priv = counter -> priv ;
197
+ struct stm32_timer_cnt * const priv = counter_priv ( counter ) ;
198
198
u32 cr1 ;
199
199
200
200
if (enable ) {
0 commit comments