Commit e98ea385 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Greg Kroah-Hartman

counter: stm32-lptimer-cnt: Convert to counter_priv() wrapper

This is a straight forward conversion to the new counter_priv() wrapper.
Acked-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: default avatarWilliam Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20211230150300.72196-12-u.kleine-koenig@pengutronix.deSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8817c2d0
...@@ -141,7 +141,7 @@ static const enum counter_synapse_action stm32_lptim_cnt_synapse_actions[] = { ...@@ -141,7 +141,7 @@ static const enum counter_synapse_action stm32_lptim_cnt_synapse_actions[] = {
static int stm32_lptim_cnt_read(struct counter_device *counter, static int stm32_lptim_cnt_read(struct counter_device *counter,
struct counter_count *count, u64 *val) struct counter_count *count, u64 *val)
{ {
struct stm32_lptim_cnt *const priv = counter->priv; struct stm32_lptim_cnt *const priv = counter_priv(counter);
u32 cnt; u32 cnt;
int ret; int ret;
...@@ -158,7 +158,7 @@ static int stm32_lptim_cnt_function_read(struct counter_device *counter, ...@@ -158,7 +158,7 @@ static int stm32_lptim_cnt_function_read(struct counter_device *counter,
struct counter_count *count, struct counter_count *count,
enum counter_function *function) enum counter_function *function)
{ {
struct stm32_lptim_cnt *const priv = counter->priv; struct stm32_lptim_cnt *const priv = counter_priv(counter);
if (!priv->quadrature_mode) { if (!priv->quadrature_mode) {
*function = COUNTER_FUNCTION_INCREASE; *function = COUNTER_FUNCTION_INCREASE;
...@@ -177,7 +177,7 @@ static int stm32_lptim_cnt_function_write(struct counter_device *counter, ...@@ -177,7 +177,7 @@ static int stm32_lptim_cnt_function_write(struct counter_device *counter,
struct counter_count *count, struct counter_count *count,
enum counter_function function) enum counter_function function)
{ {
struct stm32_lptim_cnt *const priv = counter->priv; struct stm32_lptim_cnt *const priv = counter_priv(counter);
if (stm32_lptim_is_enabled(priv)) if (stm32_lptim_is_enabled(priv))
return -EBUSY; return -EBUSY;
...@@ -200,7 +200,7 @@ static int stm32_lptim_cnt_enable_read(struct counter_device *counter, ...@@ -200,7 +200,7 @@ static int stm32_lptim_cnt_enable_read(struct counter_device *counter,
struct counter_count *count, struct counter_count *count,
u8 *enable) u8 *enable)
{ {
struct stm32_lptim_cnt *const priv = counter->priv; struct stm32_lptim_cnt *const priv = counter_priv(counter);
int ret; int ret;
ret = stm32_lptim_is_enabled(priv); ret = stm32_lptim_is_enabled(priv);
...@@ -216,7 +216,7 @@ static int stm32_lptim_cnt_enable_write(struct counter_device *counter, ...@@ -216,7 +216,7 @@ static int stm32_lptim_cnt_enable_write(struct counter_device *counter,
struct counter_count *count, struct counter_count *count,
u8 enable) u8 enable)
{ {
struct stm32_lptim_cnt *const priv = counter->priv; struct stm32_lptim_cnt *const priv = counter_priv(counter);
int ret; int ret;
/* Check nobody uses the timer, or already disabled/enabled */ /* Check nobody uses the timer, or already disabled/enabled */
...@@ -241,7 +241,7 @@ static int stm32_lptim_cnt_ceiling_read(struct counter_device *counter, ...@@ -241,7 +241,7 @@ static int stm32_lptim_cnt_ceiling_read(struct counter_device *counter,
struct counter_count *count, struct counter_count *count,
u64 *ceiling) u64 *ceiling)
{ {
struct stm32_lptim_cnt *const priv = counter->priv; struct stm32_lptim_cnt *const priv = counter_priv(counter);
*ceiling = priv->ceiling; *ceiling = priv->ceiling;
...@@ -252,7 +252,7 @@ static int stm32_lptim_cnt_ceiling_write(struct counter_device *counter, ...@@ -252,7 +252,7 @@ static int stm32_lptim_cnt_ceiling_write(struct counter_device *counter,
struct counter_count *count, struct counter_count *count,
u64 ceiling) u64 ceiling)
{ {
struct stm32_lptim_cnt *const priv = counter->priv; struct stm32_lptim_cnt *const priv = counter_priv(counter);
if (stm32_lptim_is_enabled(priv)) if (stm32_lptim_is_enabled(priv))
return -EBUSY; return -EBUSY;
...@@ -277,7 +277,7 @@ static int stm32_lptim_cnt_action_read(struct counter_device *counter, ...@@ -277,7 +277,7 @@ static int stm32_lptim_cnt_action_read(struct counter_device *counter,
struct counter_synapse *synapse, struct counter_synapse *synapse,
enum counter_synapse_action *action) enum counter_synapse_action *action)
{ {
struct stm32_lptim_cnt *const priv = counter->priv; struct stm32_lptim_cnt *const priv = counter_priv(counter);
enum counter_function function; enum counter_function function;
int err; int err;
...@@ -321,7 +321,7 @@ static int stm32_lptim_cnt_action_write(struct counter_device *counter, ...@@ -321,7 +321,7 @@ static int stm32_lptim_cnt_action_write(struct counter_device *counter,
struct counter_synapse *synapse, struct counter_synapse *synapse,
enum counter_synapse_action action) enum counter_synapse_action action)
{ {
struct stm32_lptim_cnt *const priv = counter->priv; struct stm32_lptim_cnt *const priv = counter_priv(counter);
enum counter_function function; enum counter_function function;
int err; int err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment