On 10/29/13 11:39, Sachin Kamat wrote: > devm_iio_device_register simplifies the code. > > Signed-off-by: Sachin Kamat <sachin.kamat@xxxxxxxxxx> The power off should be after the unregister given that until the unregister, the userspace interface is there, but won't work. Hence, here you have highlighted a bug... > --- > drivers/staging/iio/light/tsl2x7x_core.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/staging/iio/light/tsl2x7x_core.c b/drivers/staging/iio/light/tsl2x7x_core.c > index 1880502..cec7595 100644 > --- a/drivers/staging/iio/light/tsl2x7x_core.c > +++ b/drivers/staging/iio/light/tsl2x7x_core.c > @@ -1935,7 +1935,7 @@ static int tsl2x7x_probe(struct i2c_client *clientp, > /* Make sure the chip is on */ > tsl2x7x_chip_on(indio_dev); > > - ret = iio_device_register(indio_dev); > + ret = devm_iio_device_register(&clientp->dev, indio_dev); > if (ret) { > dev_err(&clientp->dev, > "%s: iio registration failed\n", __func__); > @@ -1989,8 +1989,6 @@ static int tsl2x7x_remove(struct i2c_client *client) > > tsl2x7x_chip_off(indio_dev); > > - iio_device_unregister(indio_dev); > - > return 0; > } > > -- 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