Re: [PATCH v6 2/2] iio: light: Add support for ltrf216a sensor

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

 



On 6/15/22 16:51, Shreeya Patel wrote:
> +static int ltrf216a_remove(struct i2c_client *client)
> +{
> +	struct iio_dev *indio_dev = i2c_get_clientdata(client);
> +
> +	iio_device_unregister(indio_dev);
> +	pm_runtime_disable(&client->dev);
> +	pm_runtime_set_suspended(&client->dev);
> +	ltrf216a_disable(indio_dev);
> +
> +	return 0;
> +}

As Jonathan said, there is no need to disable sensor in the remove()
since you're using devm_add_action_or_reset().

If you're going to use devm_pm_runtime_enable(), then let's also use
devm_iio_device_register() and in this case the ltrf216a_remove() is not
needed anymore at all since the removal will be handled by the driver
core entirely, i.e. you'll need to drop ltrf216a_remove().

-- 
Best regards,
Dmitry



[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