Re: [PATCH 08/32] iio: dac: max517: Use devm_iio_device_register

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

 



On 09/25/13 11:49, Sachin Kamat wrote:
> devm_iio_device_register simplifies the code.
> 
> Signed-off-by: Sachin Kamat <sachin.kamat@xxxxxxxxxx>

This device clearly has a power down mode. Is it sensible to assume that if it is fine
to power it down in suspend it is fine to power it down if the remove is called?

If so that should happen after the unregister.

Sachin, you are doing a fine job of showing up where we don't have the best handling
in our remove functions!

A few devices seem to be so 'stupid' that there really is nothing to do (unless we cut
the power supply) but they aren't that common.

> ---
>  drivers/iio/dac/max517.c |    9 +--------
>  1 file changed, 1 insertion(+), 8 deletions(-)
> 
> diff --git a/drivers/iio/dac/max517.c b/drivers/iio/dac/max517.c
> index 83adcbf..959207f 100644
> --- a/drivers/iio/dac/max517.c
> +++ b/drivers/iio/dac/max517.c
> @@ -194,7 +194,7 @@ static int max517_probe(struct i2c_client *client,
>  		data->vref_mv[1] = platform_data->vref_mv[1];
>  	}
>  
> -	err = iio_device_register(indio_dev);
> +	err = devm_iio_device_register(&client->dev, indio_dev);
>  	if (err)
>  		return err;
>  
> @@ -203,12 +203,6 @@ static int max517_probe(struct i2c_client *client,
>  	return 0;
>  }
>  
> -static int max517_remove(struct i2c_client *client)
> -{
> -	iio_device_unregister(i2c_get_clientdata(client));
> -	return 0;
> -}
> -
>  static const struct i2c_device_id max517_id[] = {
>  	{ "max517", ID_MAX517 },
>  	{ "max518", ID_MAX518 },
> @@ -223,7 +217,6 @@ static struct i2c_driver max517_driver = {
>  		.pm		= MAX517_PM_OPS,
>  	},
>  	.probe		= max517_probe,
> -	.remove		= max517_remove,
>  	.id_table	= max517_id,
>  };
>  module_i2c_driver(max517_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