lkml.org 
[lkml]   [2021]   [Dec]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 10/23] counter: ti-eqep: Convert to counter_priv() wrapper
On Mon, 27 Dec 2021 10:45:13 +0100
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote:

> This is a straight forward conversion to the new counter_priv() wrapper.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> ---
> drivers/counter/ti-eqep.c | 18 +++++++++---------
> 1 file changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/counter/ti-eqep.c b/drivers/counter/ti-eqep.c
> index 09817c953f9a..abeda966e7be 100644
> --- a/drivers/counter/ti-eqep.c
> +++ b/drivers/counter/ti-eqep.c
> @@ -90,7 +90,7 @@ struct ti_eqep_cnt {
> static int ti_eqep_count_read(struct counter_device *counter,
> struct counter_count *count, u64 *val)
> {
> - struct ti_eqep_cnt *priv = counter->priv;
> + struct ti_eqep_cnt *priv = counter_priv(counter);
> u32 cnt;
>
> regmap_read(priv->regmap32, QPOSCNT, &cnt);
> @@ -102,7 +102,7 @@ static int ti_eqep_count_read(struct counter_device *counter,
> static int ti_eqep_count_write(struct counter_device *counter,
> struct counter_count *count, u64 val)
> {
> - struct ti_eqep_cnt *priv = counter->priv;
> + struct ti_eqep_cnt *priv = counter_priv(counter);
> u32 max;
>
> regmap_read(priv->regmap32, QPOSMAX, &max);
> @@ -116,7 +116,7 @@ static int ti_eqep_function_read(struct counter_device *counter,
> struct counter_count *count,
> enum counter_function *function)
> {
> - struct ti_eqep_cnt *priv = counter->priv;
> + struct ti_eqep_cnt *priv = counter_priv(counter);
> u32 qdecctl;
>
> regmap_read(priv->regmap16, QDECCTL, &qdecctl);
> @@ -143,7 +143,7 @@ static int ti_eqep_function_write(struct counter_device *counter,
> struct counter_count *count,
> enum counter_function function)
> {
> - struct ti_eqep_cnt *priv = counter->priv;
> + struct ti_eqep_cnt *priv = counter_priv(counter);
> enum ti_eqep_count_func qsrc;
>
> switch (function) {
> @@ -173,7 +173,7 @@ static int ti_eqep_action_read(struct counter_device *counter,
> struct counter_synapse *synapse,
> enum counter_synapse_action *action)
> {
> - struct ti_eqep_cnt *priv = counter->priv;
> + struct ti_eqep_cnt *priv = counter_priv(counter);
> enum counter_function function;
> u32 qdecctl;
> int err;
> @@ -245,7 +245,7 @@ static int ti_eqep_position_ceiling_read(struct counter_device *counter,
> struct counter_count *count,
> u64 *ceiling)
> {
> - struct ti_eqep_cnt *priv = counter->priv;
> + struct ti_eqep_cnt *priv = counter_priv(counter);
> u32 qposmax;
>
> regmap_read(priv->regmap32, QPOSMAX, &qposmax);
> @@ -259,7 +259,7 @@ static int ti_eqep_position_ceiling_write(struct counter_device *counter,
> struct counter_count *count,
> u64 ceiling)
> {
> - struct ti_eqep_cnt *priv = counter->priv;
> + struct ti_eqep_cnt *priv = counter_priv(counter);
>
> if (ceiling != (u32)ceiling)
> return -ERANGE;
> @@ -272,7 +272,7 @@ static int ti_eqep_position_ceiling_write(struct counter_device *counter,
> static int ti_eqep_position_enable_read(struct counter_device *counter,
> struct counter_count *count, u8 *enable)
> {
> - struct ti_eqep_cnt *priv = counter->priv;
> + struct ti_eqep_cnt *priv = counter_priv(counter);
> u32 qepctl;
>
> regmap_read(priv->regmap16, QEPCTL, &qepctl);
> @@ -285,7 +285,7 @@ static int ti_eqep_position_enable_read(struct counter_device *counter,
> static int ti_eqep_position_enable_write(struct counter_device *counter,
> struct counter_count *count, u8 enable)
> {
> - struct ti_eqep_cnt *priv = counter->priv;
> + struct ti_eqep_cnt *priv = counter_priv(counter);
>
> regmap_write_bits(priv->regmap16, QEPCTL, QEPCTL_PHEN, enable ? -1 : 0);
>

\
 
 \ /
  Last update: 2021-12-28 19:02    [W:0.327 / U:4.920 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site