Re: [PATCH AUTOSEL 4.19 482/671] iio: tsl2772: Use devm_add_action_or_reset for tsl2772_chip_off

From: Sasha Levin
Date: Thu Jan 16 2020 - 21:43:31 EST


On Thu, Jan 16, 2020 at 06:16:18PM +0000, Jonathan Cameron wrote:
On Thu, 16 Jan 2020 12:02:00 -0500
Sasha Levin <sashal@xxxxxxxxxx> wrote:

From: Chuhong Yuan <hslester96@xxxxxxxxx>

[ Upstream commit 338084135aeddb103624a6841972fb8588295cc6 ]

Use devm_add_action_or_reset to call tsl2772_chip_off
when the device is removed.
This also fixes the issue that the chip is turned off
before the device is unregistered.

Not marked for stable as fairly hard to hit the bug and
this is in the middle of a set making other cleanups
to the driver. Hence will probably need explicit backporting.

Guess I was wrong and it does go on cleanly. I took a quick
look at current 4.19 driver and looks like it's fine on it's
own.

We need to be careful with this one in general though.

Acked-by: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx> for 4.19

Thanks Jonathan. I saw the comment, but it applied and built cleanly,
and looked sane enough without any related changes.

--
Thanks,
Sasha