Re: [PATCH 20/33] staging: iio: ad5930: 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>

Another device with a power down mode that I'd expect to see called.
I supose for output devices one might just leave them running in
an uncontrolled fashion, but that ought to be configurable.


> ---
>  drivers/staging/iio/frequency/ad5930.c |   10 +---------
>  1 file changed, 1 insertion(+), 9 deletions(-)
> 
> diff --git a/drivers/staging/iio/frequency/ad5930.c b/drivers/staging/iio/frequency/ad5930.c
> index a4aeee6..662cfb9 100644
> --- a/drivers/staging/iio/frequency/ad5930.c
> +++ b/drivers/staging/iio/frequency/ad5930.c
> @@ -106,7 +106,7 @@ static int ad5930_probe(struct spi_device *spi)
>  	idev->info = &ad5930_info;
>  	idev->modes = INDIO_DIRECT_MODE;
>  
> -	ret = iio_device_register(idev);
> +	ret = devm_iio_device_register(&spi->dev, idev);
>  	if (ret)
>  		return ret;
>  	spi->max_speed_hz = 2000000;
> @@ -117,20 +117,12 @@ static int ad5930_probe(struct spi_device *spi)
>  	return 0;
>  }
>  
> -static int ad5930_remove(struct spi_device *spi)
> -{
> -	iio_device_unregister(spi_get_drvdata(spi));
> -
> -	return 0;
> -}
> -
>  static struct spi_driver ad5930_driver = {
>  	.driver = {
>  		.name = DRV_NAME,
>  		.owner = THIS_MODULE,
>  	},
>  	.probe = ad5930_probe,
> -	.remove = ad5930_remove,
>  };
>  module_spi_driver(ad5930_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