Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpio: 104-idio-16: Use lowercase symbol names for const variables

To prevent confusion, and to match the existing coding style used in
other GPIO drivers, symbol names within the 104-idio-16 GPIO driver
should be lowercase.

Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

William Breathitt Gray and committed by
Linus Walleij
6e0171b4 5ed41cc4

+18 -19
+18 -19
drivers/gpio/gpio-104-idio-16.c
··· 80 80 static int idio_16_gpio_get(struct gpio_chip *chip, unsigned offset) 81 81 { 82 82 struct idio_16_gpio *const idio16gpio = to_idio16gpio(chip); 83 - const unsigned BIT_MASK = 1U << (offset-16); 83 + const unsigned mask = BIT(offset-16); 84 84 85 85 if (offset < 16) 86 86 return -EINVAL; 87 87 88 88 if (offset < 24) 89 - return !!(inb(idio16gpio->base + 1) & BIT_MASK); 89 + return !!(inb(idio16gpio->base + 1) & mask); 90 90 91 - return !!(inb(idio16gpio->base + 5) & (BIT_MASK>>8)); 91 + return !!(inb(idio16gpio->base + 5) & (mask>>8)); 92 92 } 93 93 94 94 static void idio_16_gpio_set(struct gpio_chip *chip, unsigned offset, int value) 95 95 { 96 96 struct idio_16_gpio *const idio16gpio = to_idio16gpio(chip); 97 - const unsigned BIT_MASK = 1U << offset; 97 + const unsigned mask = BIT(offset); 98 98 unsigned long flags; 99 99 100 100 if (offset > 15) ··· 103 103 spin_lock_irqsave(&idio16gpio->lock, flags); 104 104 105 105 if (value) 106 - idio16gpio->out_state |= BIT_MASK; 106 + idio16gpio->out_state |= mask; 107 107 else 108 - idio16gpio->out_state &= ~BIT_MASK; 108 + idio16gpio->out_state &= ~mask; 109 109 110 110 if (offset > 7) 111 111 outb(idio16gpio->out_state >> 8, idio16gpio->base + 4); ··· 200 200 { 201 201 struct device *dev = &pdev->dev; 202 202 struct idio_16_gpio *idio16gpio; 203 + const unsigned base = idio_16_base; 204 + const unsigned extent = 8; 205 + const char *const name = dev_name(dev); 203 206 int err; 204 - 205 - const unsigned BASE = idio_16_base; 206 - const unsigned EXTENT = 8; 207 - const unsigned IRQ = idio_16_irq; 208 - const char *const NAME = dev_name(dev); 207 + const unsigned irq = idio_16_irq; 209 208 210 209 idio16gpio = devm_kzalloc(dev, sizeof(*idio16gpio), GFP_KERNEL); 211 210 if (!idio16gpio) 212 211 return -ENOMEM; 213 212 214 - if (!request_region(BASE, EXTENT, NAME)) { 213 + if (!request_region(base, extent, name)) { 215 214 dev_err(dev, "Unable to lock %s port addresses (0x%X-0x%X)\n", 216 - NAME, BASE, BASE + EXTENT); 215 + name, base, base + extent); 217 216 err = -EBUSY; 218 217 goto err_lock_io_port; 219 218 } 220 219 221 - idio16gpio->chip.label = NAME; 220 + idio16gpio->chip.label = name; 222 221 idio16gpio->chip.parent = dev; 223 222 idio16gpio->chip.owner = THIS_MODULE; 224 223 idio16gpio->chip.base = -1; ··· 227 228 idio16gpio->chip.direction_output = idio_16_gpio_direction_output; 228 229 idio16gpio->chip.get = idio_16_gpio_get; 229 230 idio16gpio->chip.set = idio_16_gpio_set; 230 - idio16gpio->base = BASE; 231 - idio16gpio->extent = EXTENT; 232 - idio16gpio->irq = IRQ; 231 + idio16gpio->base = base; 232 + idio16gpio->extent = extent; 233 + idio16gpio->irq = irq; 233 234 idio16gpio->out_state = 0xFFFF; 234 235 235 236 spin_lock_init(&idio16gpio->lock); ··· 249 250 goto err_gpiochip_irqchip_add; 250 251 } 251 252 252 - err = request_irq(IRQ, idio_16_irq_handler, 0, NAME, idio16gpio); 253 + err = request_irq(irq, idio_16_irq_handler, 0, name, idio16gpio); 253 254 if (err) { 254 255 dev_err(dev, "IRQ handler registering failed (%d)\n", err); 255 256 goto err_request_irq; ··· 261 262 err_gpiochip_irqchip_add: 262 263 gpiochip_remove(&idio16gpio->chip); 263 264 err_gpio_register: 264 - release_region(BASE, EXTENT); 265 + release_region(base, extent); 265 266 err_lock_io_port: 266 267 return err; 267 268 }