Re: [PATCH v2 05/23] counter: 104-quad-8: Convert to counter_priv() wrapper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Dec 27, 2021 at 10:45:08AM +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@xxxxxxxxxxxxxx>

This patch results in a minor merge conflict with commit c95cc0d95702
("counter: 104-quad-8: Fix persistent enabled events bug") in linux-next
due to context changes in quad8_events_configure() and
quad8_watch_validate(). Fixing this after a rebase is trivial so I'll
give my Ack here.

Acked-by: William Breathitt Gray <vilhelm.gray@xxxxxxxxx>

> ---
>  drivers/counter/104-quad-8.c | 58 ++++++++++++++++++------------------
>  1 file changed, 29 insertions(+), 29 deletions(-)
> 
> diff --git a/drivers/counter/104-quad-8.c b/drivers/counter/104-quad-8.c
> index 1cbd60aaed69..6e5286cd1d4e 100644
> --- a/drivers/counter/104-quad-8.c
> +++ b/drivers/counter/104-quad-8.c
> @@ -113,7 +113,7 @@ static int quad8_signal_read(struct counter_device *counter,
>  			     struct counter_signal *signal,
>  			     enum counter_signal_level *level)
>  {
> -	const struct quad8 *const priv = counter->priv;
> +	const struct quad8 *const priv = counter_priv(counter);
>  	unsigned int state;
>  
>  	/* Only Index signal levels can be read */
> @@ -131,7 +131,7 @@ static int quad8_signal_read(struct counter_device *counter,
>  static int quad8_count_read(struct counter_device *counter,
>  			    struct counter_count *count, u64 *val)
>  {
> -	struct quad8 *const priv = counter->priv;
> +	struct quad8 *const priv = counter_priv(counter);
>  	const int base_offset = priv->base + 2 * count->id;
>  	unsigned int flags;
>  	unsigned int borrow;
> @@ -163,7 +163,7 @@ static int quad8_count_read(struct counter_device *counter,
>  static int quad8_count_write(struct counter_device *counter,
>  			     struct counter_count *count, u64 val)
>  {
> -	struct quad8 *const priv = counter->priv;
> +	struct quad8 *const priv = counter_priv(counter);
>  	const int base_offset = priv->base + 2 * count->id;
>  	unsigned long irqflags;
>  	int i;
> @@ -213,7 +213,7 @@ static int quad8_function_read(struct counter_device *counter,
>  			       struct counter_count *count,
>  			       enum counter_function *function)
>  {
> -	struct quad8 *const priv = counter->priv;
> +	struct quad8 *const priv = counter_priv(counter);
>  	const int id = count->id;
>  	unsigned long irqflags;
>  
> @@ -243,7 +243,7 @@ static int quad8_function_write(struct counter_device *counter,
>  				struct counter_count *count,
>  				enum counter_function function)
>  {
> -	struct quad8 *const priv = counter->priv;
> +	struct quad8 *const priv = counter_priv(counter);
>  	const int id = count->id;
>  	unsigned int *const quadrature_mode = priv->quadrature_mode + id;
>  	unsigned int *const scale = priv->quadrature_scale + id;
> @@ -305,7 +305,7 @@ static int quad8_direction_read(struct counter_device *counter,
>  				struct counter_count *count,
>  				enum counter_count_direction *direction)
>  {
> -	const struct quad8 *const priv = counter->priv;
> +	const struct quad8 *const priv = counter_priv(counter);
>  	unsigned int ud_flag;
>  	const unsigned int flag_addr = priv->base + 2 * count->id + 1;
>  
> @@ -335,7 +335,7 @@ static int quad8_action_read(struct counter_device *counter,
>  			     struct counter_synapse *synapse,
>  			     enum counter_synapse_action *action)
>  {
> -	struct quad8 *const priv = counter->priv;
> +	struct quad8 *const priv = counter_priv(counter);
>  	int err;
>  	enum counter_function function;
>  	const size_t signal_a_id = count->synapses[0].signal->id;
> @@ -399,7 +399,7 @@ enum {
>  
>  static int quad8_events_configure(struct counter_device *counter)
>  {
> -	struct quad8 *const priv = counter->priv;
> +	struct quad8 *const priv = counter_priv(counter);
>  	unsigned long irq_enabled = 0;
>  	unsigned long irqflags;
>  	size_t channel;
> @@ -442,7 +442,7 @@ static int quad8_events_configure(struct counter_device *counter)
>  static int quad8_watch_validate(struct counter_device *counter,
>  				const struct counter_watch *watch)
>  {
> -	struct quad8 *const priv = counter->priv;
> +	struct quad8 *const priv = counter_priv(counter);
>  
>  	if (watch->channel > QUAD8_NUM_COUNTERS - 1)
>  		return -EINVAL;
> @@ -497,7 +497,7 @@ static int quad8_index_polarity_get(struct counter_device *counter,
>  				    struct counter_signal *signal,
>  				    u32 *index_polarity)
>  {
> -	const struct quad8 *const priv = counter->priv;
> +	const struct quad8 *const priv = counter_priv(counter);
>  	const size_t channel_id = signal->id - 16;
>  
>  	*index_polarity = priv->index_polarity[channel_id];
> @@ -509,7 +509,7 @@ static int quad8_index_polarity_set(struct counter_device *counter,
>  				    struct counter_signal *signal,
>  				    u32 index_polarity)
>  {
> -	struct quad8 *const priv = counter->priv;
> +	struct quad8 *const priv = counter_priv(counter);
>  	const size_t channel_id = signal->id - 16;
>  	const int base_offset = priv->base + 2 * channel_id + 1;
>  	unsigned long irqflags;
> @@ -538,7 +538,7 @@ static int quad8_synchronous_mode_get(struct counter_device *counter,
>  				      struct counter_signal *signal,
>  				      u32 *synchronous_mode)
>  {
> -	const struct quad8 *const priv = counter->priv;
> +	const struct quad8 *const priv = counter_priv(counter);
>  	const size_t channel_id = signal->id - 16;
>  
>  	*synchronous_mode = priv->synchronous_mode[channel_id];
> @@ -550,7 +550,7 @@ static int quad8_synchronous_mode_set(struct counter_device *counter,
>  				      struct counter_signal *signal,
>  				      u32 synchronous_mode)
>  {
> -	struct quad8 *const priv = counter->priv;
> +	struct quad8 *const priv = counter_priv(counter);
>  	const size_t channel_id = signal->id - 16;
>  	const int base_offset = priv->base + 2 * channel_id + 1;
>  	unsigned long irqflags;
> @@ -589,7 +589,7 @@ static int quad8_count_mode_read(struct counter_device *counter,
>  				 struct counter_count *count,
>  				 enum counter_count_mode *cnt_mode)
>  {
> -	const struct quad8 *const priv = counter->priv;
> +	const struct quad8 *const priv = counter_priv(counter);
>  
>  	/* Map 104-QUAD-8 count mode to Generic Counter count mode */
>  	switch (priv->count_mode[count->id]) {
> @@ -614,7 +614,7 @@ static int quad8_count_mode_write(struct counter_device *counter,
>  				  struct counter_count *count,
>  				  enum counter_count_mode cnt_mode)
>  {
> -	struct quad8 *const priv = counter->priv;
> +	struct quad8 *const priv = counter_priv(counter);
>  	unsigned int count_mode;
>  	unsigned int mode_cfg;
>  	const int base_offset = priv->base + 2 * count->id + 1;
> @@ -661,7 +661,7 @@ static int quad8_count_mode_write(struct counter_device *counter,
>  static int quad8_count_enable_read(struct counter_device *counter,
>  				   struct counter_count *count, u8 *enable)
>  {
> -	const struct quad8 *const priv = counter->priv;
> +	const struct quad8 *const priv = counter_priv(counter);
>  
>  	*enable = priv->ab_enable[count->id];
>  
> @@ -671,7 +671,7 @@ static int quad8_count_enable_read(struct counter_device *counter,
>  static int quad8_count_enable_write(struct counter_device *counter,
>  				    struct counter_count *count, u8 enable)
>  {
> -	struct quad8 *const priv = counter->priv;
> +	struct quad8 *const priv = counter_priv(counter);
>  	const int base_offset = priv->base + 2 * count->id;
>  	unsigned long irqflags;
>  	unsigned int ior_cfg;
> @@ -699,7 +699,7 @@ static const char *const quad8_noise_error_states[] = {
>  static int quad8_error_noise_get(struct counter_device *counter,
>  				 struct counter_count *count, u32 *noise_error)
>  {
> -	const struct quad8 *const priv = counter->priv;
> +	const struct quad8 *const priv = counter_priv(counter);
>  	const int base_offset = priv->base + 2 * count->id + 1;
>  
>  	*noise_error = !!(inb(base_offset) & QUAD8_FLAG_E);
> @@ -710,7 +710,7 @@ static int quad8_error_noise_get(struct counter_device *counter,
>  static int quad8_count_preset_read(struct counter_device *counter,
>  				   struct counter_count *count, u64 *preset)
>  {
> -	const struct quad8 *const priv = counter->priv;
> +	const struct quad8 *const priv = counter_priv(counter);
>  
>  	*preset = priv->preset[count->id];
>  
> @@ -736,7 +736,7 @@ static void quad8_preset_register_set(struct quad8 *const priv, const int id,
>  static int quad8_count_preset_write(struct counter_device *counter,
>  				    struct counter_count *count, u64 preset)
>  {
> -	struct quad8 *const priv = counter->priv;
> +	struct quad8 *const priv = counter_priv(counter);
>  	unsigned long irqflags;
>  
>  	/* Only 24-bit values are supported */
> @@ -755,7 +755,7 @@ static int quad8_count_preset_write(struct counter_device *counter,
>  static int quad8_count_ceiling_read(struct counter_device *counter,
>  				    struct counter_count *count, u64 *ceiling)
>  {
> -	struct quad8 *const priv = counter->priv;
> +	struct quad8 *const priv = counter_priv(counter);
>  	unsigned long irqflags;
>  
>  	spin_lock_irqsave(&priv->lock, irqflags);
> @@ -780,7 +780,7 @@ static int quad8_count_ceiling_read(struct counter_device *counter,
>  static int quad8_count_ceiling_write(struct counter_device *counter,
>  				     struct counter_count *count, u64 ceiling)
>  {
> -	struct quad8 *const priv = counter->priv;
> +	struct quad8 *const priv = counter_priv(counter);
>  	unsigned long irqflags;
>  
>  	/* Only 24-bit values are supported */
> @@ -807,7 +807,7 @@ static int quad8_count_preset_enable_read(struct counter_device *counter,
>  					  struct counter_count *count,
>  					  u8 *preset_enable)
>  {
> -	const struct quad8 *const priv = counter->priv;
> +	const struct quad8 *const priv = counter_priv(counter);
>  
>  	*preset_enable = !priv->preset_enable[count->id];
>  
> @@ -818,7 +818,7 @@ static int quad8_count_preset_enable_write(struct counter_device *counter,
>  					   struct counter_count *count,
>  					   u8 preset_enable)
>  {
> -	struct quad8 *const priv = counter->priv;
> +	struct quad8 *const priv = counter_priv(counter);
>  	const int base_offset = priv->base + 2 * count->id + 1;
>  	unsigned long irqflags;
>  	unsigned int ior_cfg;
> @@ -845,7 +845,7 @@ static int quad8_signal_cable_fault_read(struct counter_device *counter,
>  					 struct counter_signal *signal,
>  					 u8 *cable_fault)
>  {
> -	struct quad8 *const priv = counter->priv;
> +	struct quad8 *const priv = counter_priv(counter);
>  	const size_t channel_id = signal->id / 2;
>  	unsigned long irqflags;
>  	bool disabled;
> @@ -875,7 +875,7 @@ static int quad8_signal_cable_fault_enable_read(struct counter_device *counter,
>  						struct counter_signal *signal,
>  						u8 *enable)
>  {
> -	const struct quad8 *const priv = counter->priv;
> +	const struct quad8 *const priv = counter_priv(counter);
>  	const size_t channel_id = signal->id / 2;
>  
>  	*enable = !!(priv->cable_fault_enable & BIT(channel_id));
> @@ -887,7 +887,7 @@ static int quad8_signal_cable_fault_enable_write(struct counter_device *counter,
>  						 struct counter_signal *signal,
>  						 u8 enable)
>  {
> -	struct quad8 *const priv = counter->priv;
> +	struct quad8 *const priv = counter_priv(counter);
>  	const size_t channel_id = signal->id / 2;
>  	unsigned long irqflags;
>  	unsigned int cable_fault_enable;
> @@ -913,7 +913,7 @@ static int quad8_signal_fck_prescaler_read(struct counter_device *counter,
>  					   struct counter_signal *signal,
>  					   u8 *prescaler)
>  {
> -	const struct quad8 *const priv = counter->priv;
> +	const struct quad8 *const priv = counter_priv(counter);
>  
>  	*prescaler = priv->fck_prescaler[signal->id / 2];
>  
> @@ -924,7 +924,7 @@ static int quad8_signal_fck_prescaler_write(struct counter_device *counter,
>  					    struct counter_signal *signal,
>  					    u8 prescaler)
>  {
> -	struct quad8 *const priv = counter->priv;
> +	struct quad8 *const priv = counter_priv(counter);
>  	const size_t channel_id = signal->id / 2;
>  	const int base_offset = priv->base + 2 * channel_id;
>  	unsigned long irqflags;
> -- 
> 2.33.0
> 

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux