]> www.infradead.org Git - users/willy/xarray.git/commit
power: supply: ds2782: Use devm_delayed_work_autocancel() helper
authorAndrew Davis <afd@ti.com>
Mon, 2 Dec 2024 21:15:19 +0000 (15:15 -0600)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Wed, 4 Dec 2024 21:31:32 +0000 (22:31 +0100)
commit1c44832979a70570f2e652013877c7b15000494e
treea5b0cf46c39a415a3aed35568109a77495796631
parent8571178e9adf3128d70d14359b965f370cfd522d
power: supply: ds2782: Use devm_delayed_work_autocancel() helper

Use the device lifecycle managed work init function. This helps prevent
mistakes like canceling out of order in cleanup functions and
forgetting to canceling on error paths.

Note we move this to after the registering the power supply so that
the cancel is called before unregistering.

This was the last thing the .remove() function did, so remove that too.

Signed-off-by: Andrew Davis <afd@ti.com>
Link: https://lore.kernel.org/r/20241202211519.199635-5-afd@ti.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/ds2782_battery.c