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