Skip to content

Commit e98ea38

Browse files
Uwe Kleine-Königgregkh
authored andcommitted
counter: stm32-lptimer-cnt: Convert to counter_priv() wrapper
This is a straight forward conversion to the new counter_priv() wrapper. Acked-by: Jonathan Cameron <[email protected]> Acked-by: William Breathitt Gray <[email protected]> Signed-off-by: Uwe Kleine-König <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 8817c2d commit e98ea38

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

drivers/counter/stm32-lptimer-cnt.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ static const enum counter_synapse_action stm32_lptim_cnt_synapse_actions[] = {
141141
static int stm32_lptim_cnt_read(struct counter_device *counter,
142142
struct counter_count *count, u64 *val)
143143
{
144-
struct stm32_lptim_cnt *const priv = counter->priv;
144+
struct stm32_lptim_cnt *const priv = counter_priv(counter);
145145
u32 cnt;
146146
int ret;
147147

@@ -158,7 +158,7 @@ static int stm32_lptim_cnt_function_read(struct counter_device *counter,
158158
struct counter_count *count,
159159
enum counter_function *function)
160160
{
161-
struct stm32_lptim_cnt *const priv = counter->priv;
161+
struct stm32_lptim_cnt *const priv = counter_priv(counter);
162162

163163
if (!priv->quadrature_mode) {
164164
*function = COUNTER_FUNCTION_INCREASE;
@@ -177,7 +177,7 @@ static int stm32_lptim_cnt_function_write(struct counter_device *counter,
177177
struct counter_count *count,
178178
enum counter_function function)
179179
{
180-
struct stm32_lptim_cnt *const priv = counter->priv;
180+
struct stm32_lptim_cnt *const priv = counter_priv(counter);
181181

182182
if (stm32_lptim_is_enabled(priv))
183183
return -EBUSY;
@@ -200,7 +200,7 @@ static int stm32_lptim_cnt_enable_read(struct counter_device *counter,
200200
struct counter_count *count,
201201
u8 *enable)
202202
{
203-
struct stm32_lptim_cnt *const priv = counter->priv;
203+
struct stm32_lptim_cnt *const priv = counter_priv(counter);
204204
int ret;
205205

206206
ret = stm32_lptim_is_enabled(priv);
@@ -216,7 +216,7 @@ static int stm32_lptim_cnt_enable_write(struct counter_device *counter,
216216
struct counter_count *count,
217217
u8 enable)
218218
{
219-
struct stm32_lptim_cnt *const priv = counter->priv;
219+
struct stm32_lptim_cnt *const priv = counter_priv(counter);
220220
int ret;
221221

222222
/* Check nobody uses the timer, or already disabled/enabled */
@@ -241,7 +241,7 @@ static int stm32_lptim_cnt_ceiling_read(struct counter_device *counter,
241241
struct counter_count *count,
242242
u64 *ceiling)
243243
{
244-
struct stm32_lptim_cnt *const priv = counter->priv;
244+
struct stm32_lptim_cnt *const priv = counter_priv(counter);
245245

246246
*ceiling = priv->ceiling;
247247

@@ -252,7 +252,7 @@ static int stm32_lptim_cnt_ceiling_write(struct counter_device *counter,
252252
struct counter_count *count,
253253
u64 ceiling)
254254
{
255-
struct stm32_lptim_cnt *const priv = counter->priv;
255+
struct stm32_lptim_cnt *const priv = counter_priv(counter);
256256

257257
if (stm32_lptim_is_enabled(priv))
258258
return -EBUSY;
@@ -277,7 +277,7 @@ static int stm32_lptim_cnt_action_read(struct counter_device *counter,
277277
struct counter_synapse *synapse,
278278
enum counter_synapse_action *action)
279279
{
280-
struct stm32_lptim_cnt *const priv = counter->priv;
280+
struct stm32_lptim_cnt *const priv = counter_priv(counter);
281281
enum counter_function function;
282282
int err;
283283

@@ -321,7 +321,7 @@ static int stm32_lptim_cnt_action_write(struct counter_device *counter,
321321
struct counter_synapse *synapse,
322322
enum counter_synapse_action action)
323323
{
324-
struct stm32_lptim_cnt *const priv = counter->priv;
324+
struct stm32_lptim_cnt *const priv = counter_priv(counter);
325325
enum counter_function function;
326326
int err;
327327

0 commit comments

Comments
 (0)