diff options
author | Mark Brown <broonie@kernel.org> | 2020-06-17 14:39:12 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-06-17 14:39:12 +0300 |
commit | 6870112c46c867f50cd27570860a05bd82614b5c (patch) | |
tree | bd9f13f6ab25072809564460a34bf0fb40900069 /drivers/gpio/gpio-mlxbf2.c | |
parent | 6f1cf5257acc6e6242ddf2f52bc7912aed77b79f (diff) | |
parent | b3a9e3b9622ae10064826dccb4f7a52bd88c7407 (diff) | |
download | linux-6870112c46c867f50cd27570860a05bd82614b5c.tar.xz |
Merge tag 'v5.8-rc1' into regulator-5.8
Linux 5.8-rc1
Diffstat (limited to 'drivers/gpio/gpio-mlxbf2.c')
-rw-r--r-- | drivers/gpio/gpio-mlxbf2.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/gpio/gpio-mlxbf2.c b/drivers/gpio/gpio-mlxbf2.c index 7b7085050219..94d5efce1721 100644 --- a/drivers/gpio/gpio-mlxbf2.c +++ b/drivers/gpio/gpio-mlxbf2.c @@ -14,7 +14,6 @@ #include <linux/resource.h> #include <linux/spinlock.h> #include <linux/types.h> -#include <linux/version.h> /* * There are 3 YU GPIO blocks: @@ -110,8 +109,8 @@ static int mlxbf2_gpio_get_lock_res(struct platform_device *pdev) } yu_arm_gpio_lock_param.io = devm_ioremap(dev, res->start, size); - if (IS_ERR(yu_arm_gpio_lock_param.io)) - ret = PTR_ERR(yu_arm_gpio_lock_param.io); + if (!yu_arm_gpio_lock_param.io) + ret = -ENOMEM; exit: mutex_unlock(yu_arm_gpio_lock_param.lock); @@ -127,8 +126,8 @@ static int mlxbf2_gpio_lock_acquire(struct mlxbf2_gpio_context *gs) { u32 arm_gpio_lock_val; - spin_lock(&gs->gc.bgpio_lock); mutex_lock(yu_arm_gpio_lock_param.lock); + spin_lock(&gs->gc.bgpio_lock); arm_gpio_lock_val = readl(yu_arm_gpio_lock_param.io); @@ -136,8 +135,8 @@ static int mlxbf2_gpio_lock_acquire(struct mlxbf2_gpio_context *gs) * When lock active bit[31] is set, ModeX is write enabled */ if (YU_LOCK_ACTIVE_BIT(arm_gpio_lock_val)) { - mutex_unlock(yu_arm_gpio_lock_param.lock); spin_unlock(&gs->gc.bgpio_lock); + mutex_unlock(yu_arm_gpio_lock_param.lock); return -EINVAL; } @@ -152,8 +151,8 @@ static int mlxbf2_gpio_lock_acquire(struct mlxbf2_gpio_context *gs) static void mlxbf2_gpio_lock_release(struct mlxbf2_gpio_context *gs) { writel(YU_ARM_GPIO_LOCK_RELEASE, yu_arm_gpio_lock_param.io); - mutex_unlock(yu_arm_gpio_lock_param.lock); spin_unlock(&gs->gc.bgpio_lock); + mutex_unlock(yu_arm_gpio_lock_param.lock); } /* |