gpio: mvebu: Add missing breaks in mvebu_gpio_irq_set_type
PATCH 1/1 gpio: mvebu: Add missing breaks in mvebu_gpio_irq_set_type
--- drivers/gpio/gpio-mvebu.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpio/gpio-mvebu.c +3 -0
@@ -381,11 +381,13 @@ static int mvebu_gpio_irq_set_type(struct irq_data *d, unsigned int type) u =readl_relaxed (mvebu_gpioreg_in_pol (mvchip)); u &= ~(1 << pin);writel_relaxed (u,mvebu_gpioreg_in_pol (mvchip)); +break ;case IRQ_TYPE_EDGE_FALLING :case IRQ_TYPE_LEVEL_LOW : u =readl_relaxed (mvebu_gpioreg_in_pol (mvchip)); u |=1 << pin;writel_relaxed (u,mvebu_gpioreg_in_pol (mvchip)); +break ;case IRQ_TYPE_EDGE_BOTH : {u32 v;
@@ -401,6 +403,7 @@ static int mvebu_gpio_irq_set_type(struct irq_data *d, unsigned int type)else u &= ~(1 << pin);/* rising */ writel_relaxed (u,mvebu_gpioreg_in_pol (mvchip)); +break ; } }return 0 ;
Signature · 1 line
1.7.9.5
Quoted 24 lines · Axel Lin
Signed-off-by Axel Lin <[email protected]>--- drivers/gpio/gpio-mvebu.c | 3 +++ 1 file changed, 3 insertions(+)drivers/gpio/gpio-mvebu.c +2
-0@@ -381,11 +381,13 @@ static int mvebu_gpio_irq_set_type(struct irq_data *d, unsigned int type) u =readl_relaxed (mvebu_gpioreg_in_pol (mvchip)); u &= ~(1 << pin);writel_relaxed (u,mvebu_gpioreg_in_pol (mvchip)); +break ;case IRQ_TYPE_EDGE_FALLING :case IRQ_TYPE_LEVEL_LOW : u =readl_relaxed (mvebu_gpioreg_in_pol (mvchip)); u |=1 << pin;writel_relaxed (u,mvebu_gpioreg_in_pol (mvchip)); +break ;case IRQ_TYPE_EDGE_BOTH : {u32 v;
drivers/gpio/gpio-mvebu.c static int mvebu_gpio_irq_set_type(struct irq_data *d, unsigned int type) · line 409
Quoted 7 lines
drivers/gpio/gpio-mvebu.c +1
-0@@ -401,6 +403,7 @@ static int mvebu_gpio_irq_set_type(struct irq_data *d, unsigned int type)else u &= ~(1 << pin);/* rising */ writel_relaxed (u,mvebu_gpioreg_in_pol (mvchip)); +break ; } }return 0 ;
Hi Axel
Good catch, thanks.
Andrew
Dear Axel Lin,
Quoted 24 lines · Axel Lin
Signed-off-by Axel Lin <[email protected]>--- drivers/gpio/gpio-mvebu.c | 3 +++ 1 file changed, 3 insertions(+)drivers/gpio/gpio-mvebu.c +2
-0@@ -381,11 +381,13 @@ static int mvebu_gpio_irq_set_type(struct irq_data *d, unsigned int type) u =readl_relaxed (mvebu_gpioreg_in_pol (mvchip)); u &= ~(1 << pin);writel_relaxed (u,mvebu_gpioreg_in_pol (mvchip)); +break ;case IRQ_TYPE_EDGE_FALLING :case IRQ_TYPE_LEVEL_LOW : u =readl_relaxed (mvebu_gpioreg_in_pol (mvchip)); u |=1 << pin;writel_relaxed (u,mvebu_gpioreg_in_pol (mvchip)); +break ;case IRQ_TYPE_EDGE_BOTH : {u32 v;
drivers/gpio/gpio-mvebu.c static int mvebu_gpio_irq_set_type(struct irq_data *d, unsigned int type) · line 409
Quoted 7 lines
drivers/gpio/gpio-mvebu.c +1
-0@@ -401,6 +403,7 @@ static int mvebu_gpio_irq_set_type(struct irq_data *d, unsigned int type)else u &= ~(1 << pin);/* rising */ writel_relaxed (u,mvebu_gpioreg_in_pol (mvchip)); +break ; } }return 0 ;
Doh, I missed this when converting the if() series to a switch() construct. It was just pure luck that it worked. Good catch indeed.
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
Quoted 1 line · Axel Lin
Signed-off-by Axel Lin <[email protected]>
Since this gpio-mvebu patch is in ARM SoC or somewhere I expect whoever put it there to safeguide the fix to its destination.
Else poke me after 3.7-rc1 and I'll take it as a GPIO fix...
Yours,
Linus Walleij
Quoted 8 lines · Linus Walleij
Quoted 1 line · Axel Lin
Signed-off-by Axel Lin <[email protected]>Acked-by Linus Walleij <[email protected]>Since this gpio-mvebu patch is in ARM SoC or somewhere I expect whoever put it there to safeguide the fix to its destination.
yep, I got it.
thx,
Jason.