Commit ad3073bc authored by Linus Walleij's avatar Linus Walleij

Merge tag 'gpio-fixes-for-v5.7' of...

Merge tag 'gpio-fixes-for-v5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into fixes

gpio fixes for v5.7

- fix mutex and spinlock ordering in gpio-mlxbf2
- fix the return value checks on devm_platform_ioremap_resource in
  gpio-pxa and gpio-bcm-kona
parents e75dfba3 98f7d1b1
...@@ -625,7 +625,7 @@ static int bcm_kona_gpio_probe(struct platform_device *pdev) ...@@ -625,7 +625,7 @@ static int bcm_kona_gpio_probe(struct platform_device *pdev)
kona_gpio->reg_base = devm_platform_ioremap_resource(pdev, 0); kona_gpio->reg_base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(kona_gpio->reg_base)) { if (IS_ERR(kona_gpio->reg_base)) {
ret = -ENXIO; ret = PTR_ERR(kona_gpio->reg_base);
goto err_irq_domain; goto err_irq_domain;
} }
......
...@@ -127,8 +127,8 @@ static int mlxbf2_gpio_lock_acquire(struct mlxbf2_gpio_context *gs) ...@@ -127,8 +127,8 @@ static int mlxbf2_gpio_lock_acquire(struct mlxbf2_gpio_context *gs)
{ {
u32 arm_gpio_lock_val; u32 arm_gpio_lock_val;
spin_lock(&gs->gc.bgpio_lock);
mutex_lock(yu_arm_gpio_lock_param.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); arm_gpio_lock_val = readl(yu_arm_gpio_lock_param.io);
...@@ -136,8 +136,8 @@ static int mlxbf2_gpio_lock_acquire(struct mlxbf2_gpio_context *gs) ...@@ -136,8 +136,8 @@ static int mlxbf2_gpio_lock_acquire(struct mlxbf2_gpio_context *gs)
* When lock active bit[31] is set, ModeX is write enabled * When lock active bit[31] is set, ModeX is write enabled
*/ */
if (YU_LOCK_ACTIVE_BIT(arm_gpio_lock_val)) { if (YU_LOCK_ACTIVE_BIT(arm_gpio_lock_val)) {
mutex_unlock(yu_arm_gpio_lock_param.lock);
spin_unlock(&gs->gc.bgpio_lock); spin_unlock(&gs->gc.bgpio_lock);
mutex_unlock(yu_arm_gpio_lock_param.lock);
return -EINVAL; return -EINVAL;
} }
...@@ -152,8 +152,8 @@ static int mlxbf2_gpio_lock_acquire(struct mlxbf2_gpio_context *gs) ...@@ -152,8 +152,8 @@ static int mlxbf2_gpio_lock_acquire(struct mlxbf2_gpio_context *gs)
static void mlxbf2_gpio_lock_release(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); 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); spin_unlock(&gs->gc.bgpio_lock);
mutex_unlock(yu_arm_gpio_lock_param.lock);
} }
/* /*
......
...@@ -660,8 +660,8 @@ static int pxa_gpio_probe(struct platform_device *pdev) ...@@ -660,8 +660,8 @@ static int pxa_gpio_probe(struct platform_device *pdev)
pchip->irq1 = irq1; pchip->irq1 = irq1;
gpio_reg_base = devm_platform_ioremap_resource(pdev, 0); gpio_reg_base = devm_platform_ioremap_resource(pdev, 0);
if (!gpio_reg_base) if (IS_ERR(gpio_reg_base))
return -EINVAL; return PTR_ERR(gpio_reg_base);
clk = clk_get(&pdev->dev, NULL); clk = clk_get(&pdev->dev, NULL);
if (IS_ERR(clk)) { if (IS_ERR(clk)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment