summaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-mlxbf2.c
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2020-06-30 15:33:45 +0200
committerLinus Walleij <linus.walleij@linaro.org>2020-07-08 09:24:08 +0200
commita7a9ad232f02e6aa659cc9b58b72b1a30dccd1a6 (patch)
tree1974858c72ff6bad3cf0b4b3e9edbec5341f6876 /drivers/gpio/gpio-mlxbf2.c
parentgpio: gpio-mlxbf2: Tell the compiler that ACPI functions may not be use (diff)
downloadlinux-a7a9ad232f02e6aa659cc9b58b72b1a30dccd1a6.tar.xz
linux-a7a9ad232f02e6aa659cc9b58b72b1a30dccd1a6.zip
gpio: gpio-mlxbf2.c: Provide __releases() annotation to stop confusing Sparse
Sparse cannot peer into other functions to see when and if locks are acquired and released, thus it simply warns that a 'context imbalance' is detected instead. Let's be kind to Sparse and let it know that this behaviour is intentional. drivers/gpio/gpio-mlxbf2.c:125:12: warning: context imbalance in 'mlxbf2_gpio_lock_acquire' - different lock contexts for basic block drivers/gpio/gpio-mlxbf2.c:151:13: warning: context imbalance in 'mlxbf2_gpio_lock_release' - unexpected unlock Signed-off-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Asmaa Mnebhi <asmaa@mellanox.com> Cc: Asmaa Mnebhi <Asmaa@mellanox.com> Link: https://lore.kernel.org/r/20200630133345.2232932-11-lee.jones@linaro.org Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to '')
-rw-r--r--drivers/gpio/gpio-mlxbf2.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpio/gpio-mlxbf2.c b/drivers/gpio/gpio-mlxbf2.c
index 861a8d0a84be..befa5e109943 100644
--- a/drivers/gpio/gpio-mlxbf2.c
+++ b/drivers/gpio/gpio-mlxbf2.c
@@ -149,6 +149,8 @@ static int mlxbf2_gpio_lock_acquire(struct mlxbf2_gpio_context *gs)
* Release the YU arm_gpio_lock after changing the direction mode.
*/
static void mlxbf2_gpio_lock_release(struct mlxbf2_gpio_context *gs)
+ __releases(&gs->gc.bgpio_lock)
+ __releases(yu_arm_gpio_lock_param.lock)
{
writel(YU_ARM_GPIO_LOCK_RELEASE, yu_arm_gpio_lock_param.io);
spin_unlock(&gs->gc.bgpio_lock);