diff options
-rw-r--r-- | arch/mips/rb532/gpio.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/mips/rb532/gpio.c b/arch/mips/rb532/gpio.c index 0e84c8ab6a39..e35cb75a3ae7 100644 --- a/arch/mips/rb532/gpio.c +++ b/arch/mips/rb532/gpio.c | |||
@@ -119,13 +119,11 @@ static inline void rb532_set_bit(unsigned bitval, | |||
119 | unsigned long flags; | 119 | unsigned long flags; |
120 | u32 val; | 120 | u32 val; |
121 | 121 | ||
122 | bitval = !!bitval; /* map parameter to {0,1} */ | ||
123 | |||
124 | local_irq_save(flags); | 122 | local_irq_save(flags); |
125 | 123 | ||
126 | val = readl(ioaddr); | 124 | val = readl(ioaddr); |
127 | val &= ~( ~bitval << offset ); /* unset bit if bitval == 0 */ | 125 | val &= ~(!bitval << offset); /* unset bit if bitval == 0 */ |
128 | val |= ( bitval << offset ); /* set bit if bitval == 1 */ | 126 | val |= (!!bitval << offset); /* set bit if bitval == 1 */ |
129 | writel(val, ioaddr); | 127 | writel(val, ioaddr); |
130 | 128 | ||
131 | local_irq_restore(flags); | 129 | local_irq_restore(flags); |