29
29
#include <linux/interrupt.h>
30
30
#include <linux/list.h>
31
31
#include <linux/bitops.h>
32
- #include <linux/pinctrl/pinctrl.h>
33
32
#include <linux/pinctrl/pinconf.h>
34
33
#include <linux/pinctrl/pinconf-generic.h>
35
34
@@ -119,8 +118,9 @@ static void amd_gpio_set_value(struct gpio_chip *gc, unsigned offset, int value)
119
118
static int amd_gpio_set_debounce (struct gpio_chip * gc , unsigned offset ,
120
119
unsigned debounce )
121
120
{
122
- u32 pin_reg ;
123
121
u32 time ;
122
+ u32 pin_reg ;
123
+ int ret = 0 ;
124
124
unsigned long flags ;
125
125
struct amd_gpio * gpio_dev = to_amd_gpio (gc );
126
126
@@ -166,7 +166,7 @@ static int amd_gpio_set_debounce(struct gpio_chip *gc, unsigned offset,
166
166
pin_reg |= BIT (DB_TMR_LARGE_OFF );
167
167
} else {
168
168
pin_reg &= ~DB_CNTRl_MASK ;
169
- return - EINVAL ;
169
+ ret = - EINVAL ;
170
170
}
171
171
} else {
172
172
pin_reg &= ~BIT (DB_TMR_OUT_UNIT_OFF );
@@ -177,7 +177,7 @@ static int amd_gpio_set_debounce(struct gpio_chip *gc, unsigned offset,
177
177
writel (pin_reg , gpio_dev -> base + offset * 4 );
178
178
spin_unlock_irqrestore (& gpio_dev -> lock , flags );
179
179
180
- return 0 ;
180
+ return ret ;
181
181
}
182
182
183
183
#ifdef CONFIG_DEBUG_FS
@@ -463,14 +463,12 @@ static int amd_gpio_irq_set_type(struct irq_data *d, unsigned int type)
463
463
default :
464
464
dev_err (& gpio_dev -> pdev -> dev , "Invalid type value\n" );
465
465
ret = - EINVAL ;
466
- goto exit ;
467
466
}
468
467
469
468
pin_reg |= CLR_INTR_STAT << INTERRUPT_STS_OFF ;
470
469
writel (pin_reg , gpio_dev -> base + (d -> hwirq )* 4 );
471
470
spin_unlock_irqrestore (& gpio_dev -> lock , flags );
472
471
473
- exit :
474
472
return ret ;
475
473
}
476
474
@@ -635,8 +633,9 @@ static int amd_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
635
633
unsigned long * configs , unsigned num_configs )
636
634
{
637
635
int i ;
638
- u32 pin_reg ;
639
636
u32 arg ;
637
+ int ret = 0 ;
638
+ u32 pin_reg ;
640
639
unsigned long flags ;
641
640
enum pin_config_param param ;
642
641
struct amd_gpio * gpio_dev = pinctrl_dev_get_drvdata (pctldev );
@@ -675,14 +674,14 @@ static int amd_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
675
674
default :
676
675
dev_err (& gpio_dev -> pdev -> dev ,
677
676
"Invalid config param %04x\n" , param );
678
- return - ENOTSUPP ;
677
+ ret = - ENOTSUPP ;
679
678
}
680
679
681
680
writel (pin_reg , gpio_dev -> base + pin * 4 );
682
681
}
683
682
spin_unlock_irqrestore (& gpio_dev -> lock , flags );
684
683
685
- return 0 ;
684
+ return ret ;
686
685
}
687
686
688
687
static int amd_pinconf_group_get (struct pinctrl_dev * pctldev ,
@@ -739,7 +738,7 @@ static struct pinctrl_desc amd_pinctrl_desc = {
739
738
static int amd_gpio_probe (struct platform_device * pdev )
740
739
{
741
740
int ret = 0 ;
742
- u32 irq_base ;
741
+ int irq_base ;
743
742
struct resource * res ;
744
743
struct amd_gpio * gpio_dev ;
745
744
0 commit comments