diff mbox series

[v2,09/23] counter: ftm-quaddec: Convert to counter_priv() wrapper

Message ID 20211227094526.698714-10-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

Commit Message

Uwe Kleine-König Dec. 27, 2021, 9:45 a.m. UTC
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/ftm-quaddec.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Jonathan Cameron Dec. 28, 2021, 6:07 p.m. UTC | #1
On Mon, 27 Dec 2021 10:45:12 +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/ftm-quaddec.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/counter/ftm-quaddec.c b/drivers/counter/ftm-quaddec.c
> index 9272f7b58beb..f5d92df6a611 100644
> --- a/drivers/counter/ftm-quaddec.c
> +++ b/drivers/counter/ftm-quaddec.c
> @@ -118,7 +118,7 @@ static void ftm_quaddec_disable(void *ftm)
>  static int ftm_quaddec_get_prescaler(struct counter_device *counter,
>  				     struct counter_count *count, u32 *cnt_mode)
>  {
> -	struct ftm_quaddec *ftm = counter->priv;
> +	struct ftm_quaddec *ftm = counter_priv(counter);
>  	uint32_t scflags;
>  
>  	ftm_read(ftm, FTM_SC, &scflags);
> @@ -131,7 +131,7 @@ static int ftm_quaddec_get_prescaler(struct counter_device *counter,
>  static int ftm_quaddec_set_prescaler(struct counter_device *counter,
>  				     struct counter_count *count, u32 cnt_mode)
>  {
> -	struct ftm_quaddec *ftm = counter->priv;
> +	struct ftm_quaddec *ftm = counter_priv(counter);
>  
>  	mutex_lock(&ftm->ftm_quaddec_mutex);
>  
> @@ -162,7 +162,7 @@ static int ftm_quaddec_count_read(struct counter_device *counter,
>  				  struct counter_count *count,
>  				  u64 *val)
>  {
> -	struct ftm_quaddec *const ftm = counter->priv;
> +	struct ftm_quaddec *const ftm = counter_priv(counter);
>  	uint32_t cntval;
>  
>  	ftm_read(ftm, FTM_CNT, &cntval);
> @@ -176,7 +176,7 @@ static int ftm_quaddec_count_write(struct counter_device *counter,
>  				   struct counter_count *count,
>  				   const u64 val)
>  {
> -	struct ftm_quaddec *const ftm = counter->priv;
> +	struct ftm_quaddec *const ftm = counter_priv(counter);
>  
>  	if (val != 0) {
>  		dev_warn(&ftm->pdev->dev, "Can only accept '0' as new counter value\n");
William Breathitt Gray Dec. 29, 2021, 7:36 a.m. UTC | #2
On Mon, Dec 27, 2021 at 10:45:12AM +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/ftm-quaddec.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/counter/ftm-quaddec.c b/drivers/counter/ftm-quaddec.c
> index 9272f7b58beb..f5d92df6a611 100644
> --- a/drivers/counter/ftm-quaddec.c
> +++ b/drivers/counter/ftm-quaddec.c
> @@ -118,7 +118,7 @@ static void ftm_quaddec_disable(void *ftm)
>  static int ftm_quaddec_get_prescaler(struct counter_device *counter,
>  				     struct counter_count *count, u32 *cnt_mode)
>  {
> -	struct ftm_quaddec *ftm = counter->priv;
> +	struct ftm_quaddec *ftm = counter_priv(counter);
>  	uint32_t scflags;
>  
>  	ftm_read(ftm, FTM_SC, &scflags);
> @@ -131,7 +131,7 @@ static int ftm_quaddec_get_prescaler(struct counter_device *counter,
>  static int ftm_quaddec_set_prescaler(struct counter_device *counter,
>  				     struct counter_count *count, u32 cnt_mode)
>  {
> -	struct ftm_quaddec *ftm = counter->priv;
> +	struct ftm_quaddec *ftm = counter_priv(counter);
>  
>  	mutex_lock(&ftm->ftm_quaddec_mutex);
>  
> @@ -162,7 +162,7 @@ static int ftm_quaddec_count_read(struct counter_device *counter,
>  				  struct counter_count *count,
>  				  u64 *val)
>  {
> -	struct ftm_quaddec *const ftm = counter->priv;
> +	struct ftm_quaddec *const ftm = counter_priv(counter);
>  	uint32_t cntval;
>  
>  	ftm_read(ftm, FTM_CNT, &cntval);
> @@ -176,7 +176,7 @@ static int ftm_quaddec_count_write(struct counter_device *counter,
>  				   struct counter_count *count,
>  				   const u64 val)
>  {
> -	struct ftm_quaddec *const ftm = counter->priv;
> +	struct ftm_quaddec *const ftm = counter_priv(counter);
>  
>  	if (val != 0) {
>  		dev_warn(&ftm->pdev->dev, "Can only accept '0' as new counter value\n");
> -- 
> 2.33.0
>
diff mbox series

Patch

diff --git a/drivers/counter/ftm-quaddec.c b/drivers/counter/ftm-quaddec.c
index 9272f7b58beb..f5d92df6a611 100644
--- a/drivers/counter/ftm-quaddec.c
+++ b/drivers/counter/ftm-quaddec.c
@@ -118,7 +118,7 @@  static void ftm_quaddec_disable(void *ftm)
 static int ftm_quaddec_get_prescaler(struct counter_device *counter,
 				     struct counter_count *count, u32 *cnt_mode)
 {
-	struct ftm_quaddec *ftm = counter->priv;
+	struct ftm_quaddec *ftm = counter_priv(counter);
 	uint32_t scflags;
 
 	ftm_read(ftm, FTM_SC, &scflags);
@@ -131,7 +131,7 @@  static int ftm_quaddec_get_prescaler(struct counter_device *counter,
 static int ftm_quaddec_set_prescaler(struct counter_device *counter,
 				     struct counter_count *count, u32 cnt_mode)
 {
-	struct ftm_quaddec *ftm = counter->priv;
+	struct ftm_quaddec *ftm = counter_priv(counter);
 
 	mutex_lock(&ftm->ftm_quaddec_mutex);
 
@@ -162,7 +162,7 @@  static int ftm_quaddec_count_read(struct counter_device *counter,
 				  struct counter_count *count,
 				  u64 *val)
 {
-	struct ftm_quaddec *const ftm = counter->priv;
+	struct ftm_quaddec *const ftm = counter_priv(counter);
 	uint32_t cntval;
 
 	ftm_read(ftm, FTM_CNT, &cntval);
@@ -176,7 +176,7 @@  static int ftm_quaddec_count_write(struct counter_device *counter,
 				   struct counter_count *count,
 				   const u64 val)
 {
-	struct ftm_quaddec *const ftm = counter->priv;
+	struct ftm_quaddec *const ftm = counter_priv(counter);
 
 	if (val != 0) {
 		dev_warn(&ftm->pdev->dev, "Can only accept '0' as new counter value\n");