Skip to content

Commit ad3073b

Browse files
committed
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
2 parents e75dfba + 98f7d1b commit ad3073b

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

drivers/gpio/gpio-bcm-kona.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ static int bcm_kona_gpio_probe(struct platform_device *pdev)
625625

626626
kona_gpio->reg_base = devm_platform_ioremap_resource(pdev, 0);
627627
if (IS_ERR(kona_gpio->reg_base)) {
628-
ret = -ENXIO;
628+
ret = PTR_ERR(kona_gpio->reg_base);
629629
goto err_irq_domain;
630630
}
631631

drivers/gpio/gpio-mlxbf2.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,17 +127,17 @@ static int mlxbf2_gpio_lock_acquire(struct mlxbf2_gpio_context *gs)
127127
{
128128
u32 arm_gpio_lock_val;
129129

130-
spin_lock(&gs->gc.bgpio_lock);
131130
mutex_lock(yu_arm_gpio_lock_param.lock);
131+
spin_lock(&gs->gc.bgpio_lock);
132132

133133
arm_gpio_lock_val = readl(yu_arm_gpio_lock_param.io);
134134

135135
/*
136136
* When lock active bit[31] is set, ModeX is write enabled
137137
*/
138138
if (YU_LOCK_ACTIVE_BIT(arm_gpio_lock_val)) {
139-
mutex_unlock(yu_arm_gpio_lock_param.lock);
140139
spin_unlock(&gs->gc.bgpio_lock);
140+
mutex_unlock(yu_arm_gpio_lock_param.lock);
141141
return -EINVAL;
142142
}
143143

@@ -152,8 +152,8 @@ static int mlxbf2_gpio_lock_acquire(struct mlxbf2_gpio_context *gs)
152152
static void mlxbf2_gpio_lock_release(struct mlxbf2_gpio_context *gs)
153153
{
154154
writel(YU_ARM_GPIO_LOCK_RELEASE, yu_arm_gpio_lock_param.io);
155-
mutex_unlock(yu_arm_gpio_lock_param.lock);
156155
spin_unlock(&gs->gc.bgpio_lock);
156+
mutex_unlock(yu_arm_gpio_lock_param.lock);
157157
}
158158

159159
/*

drivers/gpio/gpio-pxa.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -660,8 +660,8 @@ static int pxa_gpio_probe(struct platform_device *pdev)
660660
pchip->irq1 = irq1;
661661

662662
gpio_reg_base = devm_platform_ioremap_resource(pdev, 0);
663-
if (!gpio_reg_base)
664-
return -EINVAL;
663+
if (IS_ERR(gpio_reg_base))
664+
return PTR_ERR(gpio_reg_base);
665665

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

0 commit comments

Comments
 (0)