diff mbox series

[v2,07/23] counter: microchip-tcb-capture: Convert to counter_priv() wrapper

Message ID 20211227094526.698714-8-u.kleine-koenig@pengutronix.de (mailing list archive)
State New, archived
Headers show
Series None | 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/microchip-tcb-capture.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Jonathan Cameron Dec. 28, 2021, 6:05 p.m. UTC | #1
On Mon, 27 Dec 2021 10:45:10 +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>
(doing these individually in case your use b4 to pick up tags
as I don't think it can interpret a tag for last N patches :)


> ---
>  drivers/counter/microchip-tcb-capture.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/counter/microchip-tcb-capture.c b/drivers/counter/microchip-tcb-capture.c
> index bb69f2e0ba93..1b56b7444668 100644
> --- a/drivers/counter/microchip-tcb-capture.c
> +++ b/drivers/counter/microchip-tcb-capture.c
> @@ -72,7 +72,7 @@ static int mchp_tc_count_function_read(struct counter_device *counter,
>  				       struct counter_count *count,
>  				       enum counter_function *function)
>  {
> -	struct mchp_tc_data *const priv = counter->priv;
> +	struct mchp_tc_data *const priv = counter_priv(counter);
>  
>  	if (priv->qdec_mode)
>  		*function = COUNTER_FUNCTION_QUADRATURE_X4;
> @@ -86,7 +86,7 @@ static int mchp_tc_count_function_write(struct counter_device *counter,
>  					struct counter_count *count,
>  					enum counter_function function)
>  {
> -	struct mchp_tc_data *const priv = counter->priv;
> +	struct mchp_tc_data *const priv = counter_priv(counter);
>  	u32 bmr, cmr;
>  
>  	regmap_read(priv->regmap, ATMEL_TC_BMR, &bmr);
> @@ -148,7 +148,7 @@ static int mchp_tc_count_signal_read(struct counter_device *counter,
>  				     struct counter_signal *signal,
>  				     enum counter_signal_level *lvl)
>  {
> -	struct mchp_tc_data *const priv = counter->priv;
> +	struct mchp_tc_data *const priv = counter_priv(counter);
>  	bool sigstatus;
>  	u32 sr;
>  
> @@ -169,7 +169,7 @@ static int mchp_tc_count_action_read(struct counter_device *counter,
>  				     struct counter_synapse *synapse,
>  				     enum counter_synapse_action *action)
>  {
> -	struct mchp_tc_data *const priv = counter->priv;
> +	struct mchp_tc_data *const priv = counter_priv(counter);
>  	u32 cmr;
>  
>  	regmap_read(priv->regmap, ATMEL_TC_REG(priv->channel[0], CMR), &cmr);
> @@ -197,7 +197,7 @@ static int mchp_tc_count_action_write(struct counter_device *counter,
>  				      struct counter_synapse *synapse,
>  				      enum counter_synapse_action action)
>  {
> -	struct mchp_tc_data *const priv = counter->priv;
> +	struct mchp_tc_data *const priv = counter_priv(counter);
>  	u32 edge = ATMEL_TC_ETRGEDG_NONE;
>  
>  	/* QDEC mode is rising edge only */
> @@ -230,7 +230,7 @@ static int mchp_tc_count_action_write(struct counter_device *counter,
>  static int mchp_tc_count_read(struct counter_device *counter,
>  			      struct counter_count *count, u64 *val)
>  {
> -	struct mchp_tc_data *const priv = counter->priv;
> +	struct mchp_tc_data *const priv = counter_priv(counter);
>  	u32 cnt;
>  
>  	regmap_read(priv->regmap, ATMEL_TC_REG(priv->channel[0], CV), &cnt);
William Breathitt Gray Dec. 29, 2021, 7:35 a.m. UTC | #2
On Mon, Dec 27, 2021 at 10:45:10AM +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/microchip-tcb-capture.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/counter/microchip-tcb-capture.c b/drivers/counter/microchip-tcb-capture.c
> index bb69f2e0ba93..1b56b7444668 100644
> --- a/drivers/counter/microchip-tcb-capture.c
> +++ b/drivers/counter/microchip-tcb-capture.c
> @@ -72,7 +72,7 @@ static int mchp_tc_count_function_read(struct counter_device *counter,
>  				       struct counter_count *count,
>  				       enum counter_function *function)
>  {
> -	struct mchp_tc_data *const priv = counter->priv;
> +	struct mchp_tc_data *const priv = counter_priv(counter);
>  
>  	if (priv->qdec_mode)
>  		*function = COUNTER_FUNCTION_QUADRATURE_X4;
> @@ -86,7 +86,7 @@ static int mchp_tc_count_function_write(struct counter_device *counter,
>  					struct counter_count *count,
>  					enum counter_function function)
>  {
> -	struct mchp_tc_data *const priv = counter->priv;
> +	struct mchp_tc_data *const priv = counter_priv(counter);
>  	u32 bmr, cmr;
>  
>  	regmap_read(priv->regmap, ATMEL_TC_BMR, &bmr);
> @@ -148,7 +148,7 @@ static int mchp_tc_count_signal_read(struct counter_device *counter,
>  				     struct counter_signal *signal,
>  				     enum counter_signal_level *lvl)
>  {
> -	struct mchp_tc_data *const priv = counter->priv;
> +	struct mchp_tc_data *const priv = counter_priv(counter);
>  	bool sigstatus;
>  	u32 sr;
>  
> @@ -169,7 +169,7 @@ static int mchp_tc_count_action_read(struct counter_device *counter,
>  				     struct counter_synapse *synapse,
>  				     enum counter_synapse_action *action)
>  {
> -	struct mchp_tc_data *const priv = counter->priv;
> +	struct mchp_tc_data *const priv = counter_priv(counter);
>  	u32 cmr;
>  
>  	regmap_read(priv->regmap, ATMEL_TC_REG(priv->channel[0], CMR), &cmr);
> @@ -197,7 +197,7 @@ static int mchp_tc_count_action_write(struct counter_device *counter,
>  				      struct counter_synapse *synapse,
>  				      enum counter_synapse_action action)
>  {
> -	struct mchp_tc_data *const priv = counter->priv;
> +	struct mchp_tc_data *const priv = counter_priv(counter);
>  	u32 edge = ATMEL_TC_ETRGEDG_NONE;
>  
>  	/* QDEC mode is rising edge only */
> @@ -230,7 +230,7 @@ static int mchp_tc_count_action_write(struct counter_device *counter,
>  static int mchp_tc_count_read(struct counter_device *counter,
>  			      struct counter_count *count, u64 *val)
>  {
> -	struct mchp_tc_data *const priv = counter->priv;
> +	struct mchp_tc_data *const priv = counter_priv(counter);
>  	u32 cnt;
>  
>  	regmap_read(priv->regmap, ATMEL_TC_REG(priv->channel[0], CV), &cnt);
> -- 
> 2.33.0
>
diff mbox series

Patch

diff --git a/drivers/counter/microchip-tcb-capture.c b/drivers/counter/microchip-tcb-capture.c
index bb69f2e0ba93..1b56b7444668 100644
--- a/drivers/counter/microchip-tcb-capture.c
+++ b/drivers/counter/microchip-tcb-capture.c
@@ -72,7 +72,7 @@  static int mchp_tc_count_function_read(struct counter_device *counter,
 				       struct counter_count *count,
 				       enum counter_function *function)
 {
-	struct mchp_tc_data *const priv = counter->priv;
+	struct mchp_tc_data *const priv = counter_priv(counter);
 
 	if (priv->qdec_mode)
 		*function = COUNTER_FUNCTION_QUADRATURE_X4;
@@ -86,7 +86,7 @@  static int mchp_tc_count_function_write(struct counter_device *counter,
 					struct counter_count *count,
 					enum counter_function function)
 {
-	struct mchp_tc_data *const priv = counter->priv;
+	struct mchp_tc_data *const priv = counter_priv(counter);
 	u32 bmr, cmr;
 
 	regmap_read(priv->regmap, ATMEL_TC_BMR, &bmr);
@@ -148,7 +148,7 @@  static int mchp_tc_count_signal_read(struct counter_device *counter,
 				     struct counter_signal *signal,
 				     enum counter_signal_level *lvl)
 {
-	struct mchp_tc_data *const priv = counter->priv;
+	struct mchp_tc_data *const priv = counter_priv(counter);
 	bool sigstatus;
 	u32 sr;
 
@@ -169,7 +169,7 @@  static int mchp_tc_count_action_read(struct counter_device *counter,
 				     struct counter_synapse *synapse,
 				     enum counter_synapse_action *action)
 {
-	struct mchp_tc_data *const priv = counter->priv;
+	struct mchp_tc_data *const priv = counter_priv(counter);
 	u32 cmr;
 
 	regmap_read(priv->regmap, ATMEL_TC_REG(priv->channel[0], CMR), &cmr);
@@ -197,7 +197,7 @@  static int mchp_tc_count_action_write(struct counter_device *counter,
 				      struct counter_synapse *synapse,
 				      enum counter_synapse_action action)
 {
-	struct mchp_tc_data *const priv = counter->priv;
+	struct mchp_tc_data *const priv = counter_priv(counter);
 	u32 edge = ATMEL_TC_ETRGEDG_NONE;
 
 	/* QDEC mode is rising edge only */
@@ -230,7 +230,7 @@  static int mchp_tc_count_action_write(struct counter_device *counter,
 static int mchp_tc_count_read(struct counter_device *counter,
 			      struct counter_count *count, u64 *val)
 {
-	struct mchp_tc_data *const priv = counter->priv;
+	struct mchp_tc_data *const priv = counter_priv(counter);
 	u32 cnt;
 
 	regmap_read(priv->regmap, ATMEL_TC_REG(priv->channel[0], CV), &cnt);