Re: [PATCH 28/32] staging: iio: tsl2x7x_core: Use devm_iio_device_register

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

 




Sachin Kamat <sachin.kamat@xxxxxxxxxx> wrote:
>devm_iio_device_register simplifies the code.
>
>Signed-off-by: Sachin Kamat <sachin.kamat@xxxxxxxxxx>
>---
> 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 9c43dcf..ba2079e 100644
>--- a/drivers/staging/iio/light/tsl2x7x_core.c
>+++ b/drivers/staging/iio/light/tsl2x7x_core.c
>@@ -1909,7 +1909,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__);
>@@ -1963,8 +1963,6 @@ static int tsl2x7x_remove(struct i2c_client
>*client)
> 
> 	tsl2x7x_chip_off(indio_dev);

This order is wrong in the driver. Should remove interfaces before powering down the chip!
> 
>-	iio_device_unregister(indio_dev);
>-
> 	return 0;
> }
> 

-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
--
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