Re: [PATCH 18/33] staging: iio: ad7150: Use devm_iio_device_register

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

 



On 10/29/13 11:39, Sachin Kamat wrote:
> devm_iio_device_register simplifies the code.
> 
> Signed-off-by: Sachin Kamat <sachin.kamat@xxxxxxxxxx>
Whilst not implemented, this device has an explicit power down control that I'd
like to see called in the remove function after the unregister.
As such I'm not taking this one.


> ---
>  drivers/staging/iio/cdc/ad7150.c |   12 +-----------
>  1 file changed, 1 insertion(+), 11 deletions(-)
> 
> diff --git a/drivers/staging/iio/cdc/ad7150.c b/drivers/staging/iio/cdc/ad7150.c
> index 7e7f989..d9f2191 100644
> --- a/drivers/staging/iio/cdc/ad7150.c
> +++ b/drivers/staging/iio/cdc/ad7150.c
> @@ -640,7 +640,7 @@ static int ad7150_probe(struct i2c_client *client,
>  			return ret;
>  	}
>  
> -	ret = iio_device_register(indio_dev);
> +	ret = devm_iio_device_register(&client->dev, indio_dev);
>  	if (ret)
>  		return ret;
>  
> @@ -650,15 +650,6 @@ static int ad7150_probe(struct i2c_client *client,
>  	return 0;
>  }
>  
> -static int ad7150_remove(struct i2c_client *client)
> -{
> -	struct iio_dev *indio_dev = i2c_get_clientdata(client);
> -
> -	iio_device_unregister(indio_dev);
> -
> -	return 0;
> -}
> -
>  static const struct i2c_device_id ad7150_id[] = {
>  	{ "ad7150", 0 },
>  	{ "ad7151", 0 },
> @@ -673,7 +664,6 @@ static struct i2c_driver ad7150_driver = {
>  		.name = "ad7150",
>  	},
>  	.probe = ad7150_probe,
> -	.remove = ad7150_remove,
>  	.id_table = ad7150_id,
>  };
>  module_i2c_driver(ad7150_driver);
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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