Message ID | 20211227094526.698714-7-u.kleine-koenig@pengutronix.de (mailing list archive) |
---|---|
State | Handled Elsewhere |
Headers | show |
Series | [v2,01/23] counter: Use container_of instead of drvdata to track counter_device | expand |
On Mon, 27 Dec 2021 10:45:09 +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/interrupt-cnt.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/counter/interrupt-cnt.c b/drivers/counter/interrupt-cnt.c > index 8514a87fcbee..4bf706ef46e2 100644 > --- a/drivers/counter/interrupt-cnt.c > +++ b/drivers/counter/interrupt-cnt.c > @@ -37,7 +37,7 @@ static irqreturn_t interrupt_cnt_isr(int irq, void *dev_id) > static int interrupt_cnt_enable_read(struct counter_device *counter, > struct counter_count *count, u8 *enable) > { > - struct interrupt_cnt_priv *priv = counter->priv; > + struct interrupt_cnt_priv *priv = counter_priv(counter); > > *enable = priv->enabled; > > @@ -47,7 +47,7 @@ static int interrupt_cnt_enable_read(struct counter_device *counter, > static int interrupt_cnt_enable_write(struct counter_device *counter, > struct counter_count *count, u8 enable) > { > - struct interrupt_cnt_priv *priv = counter->priv; > + struct interrupt_cnt_priv *priv = counter_priv(counter); > > if (priv->enabled == enable) > return 0; > @@ -85,7 +85,7 @@ static int interrupt_cnt_action_read(struct counter_device *counter, > static int interrupt_cnt_read(struct counter_device *counter, > struct counter_count *count, u64 *val) > { > - struct interrupt_cnt_priv *priv = counter->priv; > + struct interrupt_cnt_priv *priv = counter_priv(counter); > > *val = atomic_read(&priv->count); > > @@ -95,7 +95,7 @@ static int interrupt_cnt_read(struct counter_device *counter, > static int interrupt_cnt_write(struct counter_device *counter, > struct counter_count *count, const u64 val) > { > - struct interrupt_cnt_priv *priv = counter->priv; > + struct interrupt_cnt_priv *priv = counter_priv(counter); > > if (val != (typeof(priv->count.counter))val) > return -ERANGE; > @@ -122,7 +122,7 @@ static int interrupt_cnt_signal_read(struct counter_device *counter, > struct counter_signal *signal, > enum counter_signal_level *level) > { > - struct interrupt_cnt_priv *priv = counter->priv; > + struct interrupt_cnt_priv *priv = counter_priv(counter); > int ret; > > if (!priv->gpio)
On Mon, Dec 27, 2021 at 10:45:09AM +0100, Uwe Kleine-König 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: William Breathitt Gray <vilhelm.gray@gmail.com> > --- > drivers/counter/interrupt-cnt.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/counter/interrupt-cnt.c b/drivers/counter/interrupt-cnt.c > index 8514a87fcbee..4bf706ef46e2 100644 > --- a/drivers/counter/interrupt-cnt.c > +++ b/drivers/counter/interrupt-cnt.c > @@ -37,7 +37,7 @@ static irqreturn_t interrupt_cnt_isr(int irq, void *dev_id) > static int interrupt_cnt_enable_read(struct counter_device *counter, > struct counter_count *count, u8 *enable) > { > - struct interrupt_cnt_priv *priv = counter->priv; > + struct interrupt_cnt_priv *priv = counter_priv(counter); > > *enable = priv->enabled; > > @@ -47,7 +47,7 @@ static int interrupt_cnt_enable_read(struct counter_device *counter, > static int interrupt_cnt_enable_write(struct counter_device *counter, > struct counter_count *count, u8 enable) > { > - struct interrupt_cnt_priv *priv = counter->priv; > + struct interrupt_cnt_priv *priv = counter_priv(counter); > > if (priv->enabled == enable) > return 0; > @@ -85,7 +85,7 @@ static int interrupt_cnt_action_read(struct counter_device *counter, > static int interrupt_cnt_read(struct counter_device *counter, > struct counter_count *count, u64 *val) > { > - struct interrupt_cnt_priv *priv = counter->priv; > + struct interrupt_cnt_priv *priv = counter_priv(counter); > > *val = atomic_read(&priv->count); > > @@ -95,7 +95,7 @@ static int interrupt_cnt_read(struct counter_device *counter, > static int interrupt_cnt_write(struct counter_device *counter, > struct counter_count *count, const u64 val) > { > - struct interrupt_cnt_priv *priv = counter->priv; > + struct interrupt_cnt_priv *priv = counter_priv(counter); > > if (val != (typeof(priv->count.counter))val) > return -ERANGE; > @@ -122,7 +122,7 @@ static int interrupt_cnt_signal_read(struct counter_device *counter, > struct counter_signal *signal, > enum counter_signal_level *level) > { > - struct interrupt_cnt_priv *priv = counter->priv; > + struct interrupt_cnt_priv *priv = counter_priv(counter); > int ret; > > if (!priv->gpio) > -- > 2.33.0 >
diff --git a/drivers/counter/interrupt-cnt.c b/drivers/counter/interrupt-cnt.c index 8514a87fcbee..4bf706ef46e2 100644 --- a/drivers/counter/interrupt-cnt.c +++ b/drivers/counter/interrupt-cnt.c @@ -37,7 +37,7 @@ static irqreturn_t interrupt_cnt_isr(int irq, void *dev_id) static int interrupt_cnt_enable_read(struct counter_device *counter, struct counter_count *count, u8 *enable) { - struct interrupt_cnt_priv *priv = counter->priv; + struct interrupt_cnt_priv *priv = counter_priv(counter); *enable = priv->enabled; @@ -47,7 +47,7 @@ static int interrupt_cnt_enable_read(struct counter_device *counter, static int interrupt_cnt_enable_write(struct counter_device *counter, struct counter_count *count, u8 enable) { - struct interrupt_cnt_priv *priv = counter->priv; + struct interrupt_cnt_priv *priv = counter_priv(counter); if (priv->enabled == enable) return 0; @@ -85,7 +85,7 @@ static int interrupt_cnt_action_read(struct counter_device *counter, static int interrupt_cnt_read(struct counter_device *counter, struct counter_count *count, u64 *val) { - struct interrupt_cnt_priv *priv = counter->priv; + struct interrupt_cnt_priv *priv = counter_priv(counter); *val = atomic_read(&priv->count); @@ -95,7 +95,7 @@ static int interrupt_cnt_read(struct counter_device *counter, static int interrupt_cnt_write(struct counter_device *counter, struct counter_count *count, const u64 val) { - struct interrupt_cnt_priv *priv = counter->priv; + struct interrupt_cnt_priv *priv = counter_priv(counter); if (val != (typeof(priv->count.counter))val) return -ERANGE; @@ -122,7 +122,7 @@ static int interrupt_cnt_signal_read(struct counter_device *counter, struct counter_signal *signal, enum counter_signal_level *level) { - struct interrupt_cnt_priv *priv = counter->priv; + struct interrupt_cnt_priv *priv = counter_priv(counter); int ret; if (!priv->gpio)
This is a straight forward conversion to the new counter_priv() wrapper. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> --- drivers/counter/interrupt-cnt.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)