]> git.baikalelectronics.ru Git - kernel.git/commit
leds: is31fl319x: Wrap mutex_destroy() for devm_add_action_or_rest()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 28 Dec 2022 09:32:38 +0000 (11:32 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:33:26 +0000 (09:33 +0100)
commit0e2e46a47771f43c64959929ac9497fc1aeb9d47
tree0195967b690170a3ed5c0bd27e1971ebd8b3536c
parent03e748b80dc63e1bd83e72aa026f79a19250eada
leds: is31fl319x: Wrap mutex_destroy() for devm_add_action_or_rest()

[ Upstream commit 28a1cfe221a54223befd023309d1a6eb50691a07 ]

Clang complains that devm_add_action() takes a parameter with a wrong type:

warning: cast from 'void (*)(struct mutex *)' to 'void (*)(void *)' converts to incompatible function type [-Wcast-function-type-strict]
    err = devm_add_action(dev, (void (*)(void *))mutex_destroy, &is31->lock);
                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1 warning generated.

It appears that the commit ebbb9ee746fc ("leds: is31fl319x: Fix devm vs.
non-devm ordering") missed two things:

- whilst the commit mentions devm_add_action_or_reset() the actual change
  utilised devm_add_action() call by mistake
- strictly speaking the parameter is not compatible by type

Fix both issues by switching to devm_add_action_or_reset() and adding a
wrapper for mutex_destroy() call.

Reported-by: kernel test robot <lkp@intel.com>
Fixes: ebbb9ee746fc ("leds: is31fl319x: Fix devm vs. non-devm ordering")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Vincent Knecht <vincent.knecht@mailoo.org>
Signed-off-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/20221228093238.82713-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/leds/leds-is31fl319x.c