2021-12-27 09:46:18

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH v2 11/23] counter: stm32-lptimer-cnt: Convert to counter_priv() wrapper

This is a straight forward conversion to the new counter_priv() wrapper.

Signed-off-by: Uwe Kleine-König <[email protected]>
---
drivers/counter/stm32-lptimer-cnt.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/counter/stm32-lptimer-cnt.c b/drivers/counter/stm32-lptimer-cnt.c
index 5168833b1fdf..9cf00e929cc0 100644
--- a/drivers/counter/stm32-lptimer-cnt.c
+++ b/drivers/counter/stm32-lptimer-cnt.c
@@ -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,
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;
int ret;

@@ -158,7 +158,7 @@ static int stm32_lptim_cnt_function_read(struct counter_device *counter,
struct counter_count *count,
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) {
*function = COUNTER_FUNCTION_INCREASE;
@@ -177,7 +177,7 @@ static int stm32_lptim_cnt_function_write(struct counter_device *counter,
struct counter_count *count,
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))
return -EBUSY;
@@ -200,7 +200,7 @@ static int stm32_lptim_cnt_enable_read(struct counter_device *counter,
struct counter_count *count,
u8 *enable)
{
- struct stm32_lptim_cnt *const priv = counter->priv;
+ struct stm32_lptim_cnt *const priv = counter_priv(counter);
int ret;

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

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

*ceiling = priv->ceiling;

@@ -252,7 +252,7 @@ static int stm32_lptim_cnt_ceiling_write(struct counter_device *counter,
struct counter_count *count,
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))
return -EBUSY;
@@ -277,7 +277,7 @@ static int stm32_lptim_cnt_action_read(struct counter_device *counter,
struct counter_synapse *synapse,
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;
int err;

@@ -321,7 +321,7 @@ static int stm32_lptim_cnt_action_write(struct counter_device *counter,
struct counter_synapse *synapse,
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;
int err;

--
2.33.0



2021-12-28 18:02:29

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH v2 11/23] counter: stm32-lptimer-cnt: Convert to counter_priv() wrapper

On Mon, 27 Dec 2021 10:45:14 +0100
Uwe Kleine-König <[email protected]> wrote:

> This is a straight forward conversion to the new counter_priv() wrapper.
>
> Signed-off-by: Uwe Kleine-König <[email protected]>
Acked-by: Jonathan Cameron <[email protected]>

> ---
> drivers/counter/stm32-lptimer-cnt.c | 18 +++++++++---------
> 1 file changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/counter/stm32-lptimer-cnt.c b/drivers/counter/stm32-lptimer-cnt.c
> index 5168833b1fdf..9cf00e929cc0 100644
> --- a/drivers/counter/stm32-lptimer-cnt.c
> +++ b/drivers/counter/stm32-lptimer-cnt.c
> @@ -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,
> 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;
> int ret;
>
> @@ -158,7 +158,7 @@ static int stm32_lptim_cnt_function_read(struct counter_device *counter,
> struct counter_count *count,
> 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) {
> *function = COUNTER_FUNCTION_INCREASE;
> @@ -177,7 +177,7 @@ static int stm32_lptim_cnt_function_write(struct counter_device *counter,
> struct counter_count *count,
> 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))
> return -EBUSY;
> @@ -200,7 +200,7 @@ static int stm32_lptim_cnt_enable_read(struct counter_device *counter,
> struct counter_count *count,
> u8 *enable)
> {
> - struct stm32_lptim_cnt *const priv = counter->priv;
> + struct stm32_lptim_cnt *const priv = counter_priv(counter);
> int ret;
>
> ret = stm32_lptim_is_enabled(priv);
> @@ -216,7 +216,7 @@ static int stm32_lptim_cnt_enable_write(struct counter_device *counter,
> struct counter_count *count,
> u8 enable)
> {
> - struct stm32_lptim_cnt *const priv = counter->priv;
> + struct stm32_lptim_cnt *const priv = counter_priv(counter);
> int ret;
>
> /* Check nobody uses the timer, or already disabled/enabled */
> @@ -241,7 +241,7 @@ static int stm32_lptim_cnt_ceiling_read(struct counter_device *counter,
> struct counter_count *count,
> u64 *ceiling)
> {
> - struct stm32_lptim_cnt *const priv = counter->priv;
> + struct stm32_lptim_cnt *const priv = counter_priv(counter);
>
> *ceiling = priv->ceiling;
>
> @@ -252,7 +252,7 @@ static int stm32_lptim_cnt_ceiling_write(struct counter_device *counter,
> struct counter_count *count,
> 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))
> return -EBUSY;
> @@ -277,7 +277,7 @@ static int stm32_lptim_cnt_action_read(struct counter_device *counter,
> struct counter_synapse *synapse,
> 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;
> int err;
>
> @@ -321,7 +321,7 @@ static int stm32_lptim_cnt_action_write(struct counter_device *counter,
> struct counter_synapse *synapse,
> 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;
> int err;
>


2021-12-29 07:49:07

by William Breathitt Gray

[permalink] [raw]
Subject: Re: [PATCH v2 11/23] counter: stm32-lptimer-cnt: Convert to counter_priv() wrapper

On Mon, Dec 27, 2021 at 10:45:14AM +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 <[email protected]>

Acked-by: William Breathitt Gray <[email protected]>

> ---
> drivers/counter/stm32-lptimer-cnt.c | 18 +++++++++---------
> 1 file changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/counter/stm32-lptimer-cnt.c b/drivers/counter/stm32-lptimer-cnt.c
> index 5168833b1fdf..9cf00e929cc0 100644
> --- a/drivers/counter/stm32-lptimer-cnt.c
> +++ b/drivers/counter/stm32-lptimer-cnt.c
> @@ -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,
> 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;
> int ret;
>
> @@ -158,7 +158,7 @@ static int stm32_lptim_cnt_function_read(struct counter_device *counter,
> struct counter_count *count,
> 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) {
> *function = COUNTER_FUNCTION_INCREASE;
> @@ -177,7 +177,7 @@ static int stm32_lptim_cnt_function_write(struct counter_device *counter,
> struct counter_count *count,
> 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))
> return -EBUSY;
> @@ -200,7 +200,7 @@ static int stm32_lptim_cnt_enable_read(struct counter_device *counter,
> struct counter_count *count,
> u8 *enable)
> {
> - struct stm32_lptim_cnt *const priv = counter->priv;
> + struct stm32_lptim_cnt *const priv = counter_priv(counter);
> int ret;
>
> ret = stm32_lptim_is_enabled(priv);
> @@ -216,7 +216,7 @@ static int stm32_lptim_cnt_enable_write(struct counter_device *counter,
> struct counter_count *count,
> u8 enable)
> {
> - struct stm32_lptim_cnt *const priv = counter->priv;
> + struct stm32_lptim_cnt *const priv = counter_priv(counter);
> int ret;
>
> /* Check nobody uses the timer, or already disabled/enabled */
> @@ -241,7 +241,7 @@ static int stm32_lptim_cnt_ceiling_read(struct counter_device *counter,
> struct counter_count *count,
> u64 *ceiling)
> {
> - struct stm32_lptim_cnt *const priv = counter->priv;
> + struct stm32_lptim_cnt *const priv = counter_priv(counter);
>
> *ceiling = priv->ceiling;
>
> @@ -252,7 +252,7 @@ static int stm32_lptim_cnt_ceiling_write(struct counter_device *counter,
> struct counter_count *count,
> 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))
> return -EBUSY;
> @@ -277,7 +277,7 @@ static int stm32_lptim_cnt_action_read(struct counter_device *counter,
> struct counter_synapse *synapse,
> 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;
> int err;
>
> @@ -321,7 +321,7 @@ static int stm32_lptim_cnt_action_write(struct counter_device *counter,
> struct counter_synapse *synapse,
> 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;
> int err;
>
> --
> 2.33.0
>


Attachments:
(No filename) (3.75 kB)
signature.asc (833.00 B)
Download all attachments