Re: [PATCH 8/9] iio: imu: adis16475: make use of the new lock helpers

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

 



On Tue, 18 Jun 2024 15:32:11 +0200
Nuno Sa <nuno.sa@xxxxxxxxxx> wrote:

> Use the new auto cleanup based locks so error paths are simpler.
> 
> Signed-off-by: Nuno Sa <nuno.sa@xxxxxxxxxx>
This failed a build test...

>  static int adis16475_set_freq(struct adis16475 *st, const u32 freq)
> @@ -340,7 +335,7 @@ static int adis16475_set_freq(struct adis16475 *st, const u32 freq)
>  	if (!freq)
>  		return -EINVAL;
>  
> -	adis_dev_lock(&st->adis);
> +	adis_dev_auto_lock(&st->adis);
>  	/*
>  	 * When using sync scaled mode, the input clock needs to be scaled so that we have
>  	 * an IMU sample rate between (optimally) int_clk - 100 and int_clk + 100.
> @@ -385,7 +380,7 @@ static int adis16475_set_freq(struct adis16475 *st, const u32 freq)
>  		sync_scale = scaled_rate / st->clk_freq;
>  		ret = __adis_write_reg_16(&st->adis, ADIS16475_REG_UP_SCALE, sync_scale);
>  		if (ret)
> -			goto error;
> +			return ret;
>  
>  		sample_rate = scaled_rate;
>  	}
> @@ -400,7 +395,7 @@ static int adis16475_set_freq(struct adis16475 *st, const u32 freq)
>  
>  	ret = __adis_write_reg_16(&st->adis, ADIS16475_REG_DEC_RATE, dec);
>  	if (ret)
> -		goto error;
> +		return ret;
>  
>  	adis_dev_unlock(&st->adis);
You missed this one... I dropped it whilst applying.

>  	/*
> @@ -410,9 +405,6 @@ static int adis16475_set_freq(struct adis16475 *st, const u32 freq)
>  	assign_bit(ADIS16475_LSB_DEC_MASK, &st->lsb_flag, dec);
>  
>  	return 0;
> -error:
> -	adis_dev_unlock(&st->adis);
> -	return ret;
>  }




[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