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 driver where it should probably be putting the device into power down mode on driver removal. The give away again is that there is something that makes sense when going into suspend. Jonathan > --- > 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 6e19035..073b705 100644 > --- a/drivers/iio/dac/max517.c > +++ b/drivers/iio/dac/max517.c > @@ -191,13 +191,7 @@ static int max517_probe(struct i2c_client *client, > data->vref_mv[1] = platform_data->vref_mv[1]; > } > > - return iio_device_register(indio_dev); > -} > - > -static int max517_remove(struct i2c_client *client) > -{ > - iio_device_unregister(i2c_get_clientdata(client)); > - return 0; > + return devm_iio_device_register(&client->dev, indio_dev); > } > > static const struct i2c_device_id max517_id[] = { > @@ -214,7 +208,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