devm_iio_device_register simplifies the code. Signed-off-by: Sachin Kamat <sachin.kamat@xxxxxxxxxx> --- drivers/iio/adc/ti-adc081c.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iio/adc/ti-adc081c.c b/drivers/iio/adc/ti-adc081c.c index ee5f72b..f0b7e73 100644 --- a/drivers/iio/adc/ti-adc081c.c +++ b/drivers/iio/adc/ti-adc081c.c @@ -97,7 +97,7 @@ static int adc081c_probe(struct i2c_client *client, iio->channels = &adc081c_channel; iio->num_channels = 1; - err = iio_device_register(iio); + err = devm_iio_device_register(&client->dev, iio); if (err < 0) goto regulator_disable; @@ -116,7 +116,6 @@ static int adc081c_remove(struct i2c_client *client) struct iio_dev *iio = i2c_get_clientdata(client); struct adc081c *adc = iio_priv(iio); - iio_device_unregister(iio); regulator_disable(adc->ref); return 0; -- 1.7.9.5 -- 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