diff options
author | Michal Simek <michal.simek@xilinx.com> | 2013-06-03 08:31:19 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2013-06-17 01:47:33 -0400 |
commit | 9f7f0b2bbcff719233e6724d756a8c93d3285ade (patch) | |
tree | 38a6c736cca4ee8598783decfd16495bda07341f /drivers/gpio | |
parent | cc090d61d1a88f30f2fb75a91bce684ad1bd2e94 (diff) |
GPIO: xilinx: Use BIT macro
Use BIT macro from linux/bitops.h.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpio-xilinx.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpio/gpio-xilinx.c b/drivers/gpio/gpio-xilinx.c index 791ddaedbfb4..792a05ad4649 100644 --- a/drivers/gpio/gpio-xilinx.c +++ b/drivers/gpio/gpio-xilinx.c | |||
@@ -94,9 +94,9 @@ static void xgpio_set(struct gpio_chip *gc, unsigned int gpio, int val) | |||
94 | 94 | ||
95 | /* Write to GPIO signal and set its direction to output */ | 95 | /* Write to GPIO signal and set its direction to output */ |
96 | if (val) | 96 | if (val) |
97 | chip->gpio_state |= 1 << gpio; | 97 | chip->gpio_state |= BIT(gpio); |
98 | else | 98 | else |
99 | chip->gpio_state &= ~(1 << gpio); | 99 | chip->gpio_state &= ~BIT(gpio); |
100 | 100 | ||
101 | xgpio_writereg(regs + chip->offset + XGPIO_DATA_OFFSET, | 101 | xgpio_writereg(regs + chip->offset + XGPIO_DATA_OFFSET, |
102 | chip->gpio_state); | 102 | chip->gpio_state); |
@@ -124,7 +124,7 @@ static int xgpio_dir_in(struct gpio_chip *gc, unsigned int gpio) | |||
124 | spin_lock_irqsave(&chip->gpio_lock, flags); | 124 | spin_lock_irqsave(&chip->gpio_lock, flags); |
125 | 125 | ||
126 | /* Set the GPIO bit in shadow register and set direction as input */ | 126 | /* Set the GPIO bit in shadow register and set direction as input */ |
127 | chip->gpio_dir |= (1 << gpio); | 127 | chip->gpio_dir |= BIT(gpio); |
128 | xgpio_writereg(regs + chip->offset + XGPIO_TRI_OFFSET, chip->gpio_dir); | 128 | xgpio_writereg(regs + chip->offset + XGPIO_TRI_OFFSET, chip->gpio_dir); |
129 | 129 | ||
130 | spin_unlock_irqrestore(&chip->gpio_lock, flags); | 130 | spin_unlock_irqrestore(&chip->gpio_lock, flags); |
@@ -154,14 +154,14 @@ static int xgpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val) | |||
154 | 154 | ||
155 | /* Write state of GPIO signal */ | 155 | /* Write state of GPIO signal */ |
156 | if (val) | 156 | if (val) |
157 | chip->gpio_state |= 1 << gpio; | 157 | chip->gpio_state |= BIT(gpio); |
158 | else | 158 | else |
159 | chip->gpio_state &= ~(1 << gpio); | 159 | chip->gpio_state &= ~BIT(gpio); |
160 | xgpio_writereg(regs + chip->offset + XGPIO_DATA_OFFSET, | 160 | xgpio_writereg(regs + chip->offset + XGPIO_DATA_OFFSET, |
161 | chip->gpio_state); | 161 | chip->gpio_state); |
162 | 162 | ||
163 | /* Clear the GPIO bit in shadow register and set direction as output */ | 163 | /* Clear the GPIO bit in shadow register and set direction as output */ |
164 | chip->gpio_dir &= (~(1 << gpio)); | 164 | chip->gpio_dir &= ~BIT(gpio); |
165 | xgpio_writereg(regs + chip->offset + XGPIO_TRI_OFFSET, chip->gpio_dir); | 165 | xgpio_writereg(regs + chip->offset + XGPIO_TRI_OFFSET, chip->gpio_dir); |
166 | 166 | ||
167 | spin_unlock_irqrestore(&chip->gpio_lock, flags); | 167 | spin_unlock_irqrestore(&chip->gpio_lock, flags); |