leds: is31fl319x: Fix devm vs. non-devm ordering
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 12 Jul 2022 10:08:36 +0000 (12:08 +0200)
committerPavel Machek <pavel@ucw.cz>
Tue, 2 Aug 2022 14:43:31 +0000 (16:43 +0200)
commite1af5c8155867e6773474649c76e5c68940008d5
treed777e38296dcff67e32d7de55d3da8f1295caf47
parent0d77252bc4d28b6b80b4c9b56927cbf74a4d0eb1
leds: is31fl319x: Fix devm vs. non-devm ordering

When non-devm resources are allocated they mustn't be followed by
devm allocations, otherwise it will break the tear down ordering
and might lead to crashes or other bugs during ->remove() stage.
Fix this by wrapping mutex_destroy() call with
devm_add_action_or_reset().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
drivers/leds/leds-is31fl319x.c