Re: [PATCH 28/33] staging: iio: tsl2583: 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>
This driver even has a convenient power off function (which
isn't and should be called after the unregister)

> ---
>  drivers/staging/iio/light/tsl2583.c |   10 +---------
>  1 file changed, 1 insertion(+), 9 deletions(-)
> 
> diff --git a/drivers/staging/iio/light/tsl2583.c b/drivers/staging/iio/light/tsl2583.c
> index f8c6595..aa5a437 100644
> --- a/drivers/staging/iio/light/tsl2583.c
> +++ b/drivers/staging/iio/light/tsl2583.c
> @@ -861,7 +861,7 @@ static int taos_probe(struct i2c_client *clientp,
>  	indio_dev->dev.parent = &clientp->dev;
>  	indio_dev->modes = INDIO_DIRECT_MODE;
>  	indio_dev->name = chip->client->name;
> -	ret = iio_device_register(indio_dev);
> +	ret = devm_iio_device_register(&clientp->dev, indio_dev);
>  	if (ret) {
>  		dev_err(&clientp->dev, "iio registration failed\n");
>  		return ret;
> @@ -916,13 +916,6 @@ static SIMPLE_DEV_PM_OPS(taos_pm_ops, taos_suspend, taos_resume);
>  #define TAOS_PM_OPS NULL
>  #endif
>  
> -static int taos_remove(struct i2c_client *client)
> -{
> -	iio_device_unregister(i2c_get_clientdata(client));
> -
> -	return 0;
> -}
> -
>  static struct i2c_device_id taos_idtable[] = {
>  	{ "tsl2580", 0 },
>  	{ "tsl2581", 1 },
> @@ -939,7 +932,6 @@ static struct i2c_driver taos_driver = {
>  	},
>  	.id_table = taos_idtable,
>  	.probe = taos_probe,
> -	.remove = taos_remove,
>  };
>  module_i2c_driver(taos_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