Skip to content

Commit

Permalink
Merge tag 'gpio-fixes-for-v5.7' of git://git.kernel.org/pub/scm/linux…
Browse files Browse the repository at this point in the history
…/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
  • Loading branch information
Linus Walleij committed May 27, 2020
2 parents e75dfba + 98f7d1b commit ad3073b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion drivers/gpio/gpio-bcm-kona.c
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ static int bcm_kona_gpio_probe(struct platform_device *pdev)

kona_gpio->reg_base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(kona_gpio->reg_base)) {
ret = -ENXIO;
ret = PTR_ERR(kona_gpio->reg_base);
goto err_irq_domain;
}

Expand Down
6 changes: 3 additions & 3 deletions drivers/gpio/gpio-mlxbf2.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,17 @@ 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);

/*
* 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;
}

Expand All @@ -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)
{
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);
}

/*
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpio/gpio-pxa.c
Original file line number Diff line number Diff line change
Expand Up @@ -660,8 +660,8 @@ static int pxa_gpio_probe(struct platform_device *pdev)
pchip->irq1 = irq1;

gpio_reg_base = devm_platform_ioremap_resource(pdev, 0);
if (!gpio_reg_base)
return -EINVAL;
if (IS_ERR(gpio_reg_base))
return PTR_ERR(gpio_reg_base);

clk = clk_get(&pdev->dev, NULL);
if (IS_ERR(clk)) {
Expand Down

0 comments on commit ad3073b

Please sign in to comment.