Re: [PATCH 12/15] iio: imu: st_lsm9ds0: Make st_lsm9ds0_remove() return void

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

 



On Wed, 13 Oct 2021 22:32:20 +0200
Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx> wrote:

> Up to now st_lsm9ds0_remove() returns zero unconditionally. Make it
> return void instead which makes it easier to see in the callers that
> there is no error to handle.
> 
> Also the return value of i2c and spi remove callbacks is ignored anyway.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>
Skipped as I've accepted a patch in the meantime that removes this
code by doing a full devm_ handled remove path.

Thanks,

Jonathan

> ---
>  drivers/iio/imu/st_lsm9ds0/st_lsm9ds0.h      | 2 +-
>  drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c | 4 +---
>  drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c  | 4 +++-
>  drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c  | 4 +++-
>  4 files changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0.h b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0.h
> index 146393afd9a7..3f0b24e9eeea 100644
> --- a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0.h
> +++ b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0.h
> @@ -18,6 +18,6 @@ struct st_lsm9ds0 {
>  };
>  
>  int st_lsm9ds0_probe(struct st_lsm9ds0 *lsm9ds0, struct regmap *regmap);
> -int st_lsm9ds0_remove(struct st_lsm9ds0 *lsm9ds0);
> +void st_lsm9ds0_remove(struct st_lsm9ds0 *lsm9ds0);
>  
>  #endif /* ST_LSM9DS0_H */
> diff --git a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c
> index 5e6625140db7..bfd7da4353a8 100644
> --- a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c
> +++ b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_core.c
> @@ -150,12 +150,10 @@ int st_lsm9ds0_probe(struct st_lsm9ds0 *lsm9ds0, struct regmap *regmap)
>  }
>  EXPORT_SYMBOL_GPL(st_lsm9ds0_probe);
>  
> -int st_lsm9ds0_remove(struct st_lsm9ds0 *lsm9ds0)
> +void st_lsm9ds0_remove(struct st_lsm9ds0 *lsm9ds0)
>  {
>  	st_magn_common_remove(lsm9ds0->magn);
>  	st_accel_common_remove(lsm9ds0->accel);
> -
> -	return 0;
>  }
>  EXPORT_SYMBOL_GPL(st_lsm9ds0_remove);
>  
> diff --git a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c
> index 78bede358747..e9205b46a4e6 100644
> --- a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c
> +++ b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_i2c.c
> @@ -66,7 +66,9 @@ static int st_lsm9ds0_i2c_probe(struct i2c_client *client)
>  
>  static int st_lsm9ds0_i2c_remove(struct i2c_client *client)
>  {
> -	return st_lsm9ds0_remove(i2c_get_clientdata(client));
> +	st_lsm9ds0_remove(i2c_get_clientdata(client));
> +
> +	return 0;
>  }
>  
>  static struct i2c_driver st_lsm9ds0_driver = {
> diff --git a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c
> index 180b54e66438..c51164c9f151 100644
> --- a/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c
> +++ b/drivers/iio/imu/st_lsm9ds0/st_lsm9ds0_spi.c
> @@ -65,7 +65,9 @@ static int st_lsm9ds0_spi_probe(struct spi_device *spi)
>  
>  static int st_lsm9ds0_spi_remove(struct spi_device *spi)
>  {
> -	return st_lsm9ds0_remove(spi_get_drvdata(spi));
> +	st_lsm9ds0_remove(spi_get_drvdata(spi));
> +
> +	return 0;
>  }
>  
>  static struct spi_driver st_lsm9ds0_driver = {




[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