Skip to content

Commit

Permalink
gpio: Fix checkpatch.pl issues
Browse files Browse the repository at this point in the history
This patch fixes some issues given by checkpatch. Fixes include
bracket placement, spacing and indenting.

Signed-off-by: Daniel Lockyer <thisisdaniellockyer@gmail.com>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Daniel Lockyer authored and Linus Walleij committed Jun 16, 2015
1 parent 84f2899 commit 38e003f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 16 deletions.
3 changes: 2 additions & 1 deletion drivers/gpio/gpio-altera.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ static int altera_gpio_irq_set_type(struct irq_data *d,
return -EINVAL;
}

static unsigned int altera_gpio_irq_startup(struct irq_data *d) {
static unsigned int altera_gpio_irq_startup(struct irq_data *d)
{
altera_gpio_irq_unmask(d);

return 0;
Expand Down
3 changes: 1 addition & 2 deletions drivers/gpio/gpio-crystalcove.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,8 @@ static inline int to_reg(int gpio, enum ctrl_register reg_type)
{
int reg;

if (gpio == 94) {
if (gpio == 94)
return GPIOPANELCTL;
}

if (reg_type == CTRL_IN) {
if (gpio < 8)
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpio/gpio-f7188x.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,15 @@ static struct f7188x_gpio_bank f71869a_gpio_bank[] = {
};

static struct f7188x_gpio_bank f71882_gpio_bank[] = {
F7188X_GPIO_BANK(0 , 8, 0xF0),
F7188X_GPIO_BANK(0, 8, 0xF0),
F7188X_GPIO_BANK(10, 8, 0xE0),
F7188X_GPIO_BANK(20, 8, 0xD0),
F7188X_GPIO_BANK(30, 4, 0xC0),
F7188X_GPIO_BANK(40, 4, 0xB0),
};

static struct f7188x_gpio_bank f71889_gpio_bank[] = {
F7188X_GPIO_BANK(0 , 7, 0xF0),
F7188X_GPIO_BANK(0, 7, 0xF0),
F7188X_GPIO_BANK(10, 7, 0xE0),
F7188X_GPIO_BANK(20, 8, 0xD0),
F7188X_GPIO_BANK(30, 8, 0xC0),
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpio/gpio-it8761e.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ static void it8761e_gpio_set(struct gpio_chip *gc,

curr_vals = inb(reg);
if (val)
outb(curr_vals | (1 << bit) , reg);
outb(curr_vals | (1 << bit), reg);
else
outb(curr_vals & ~(1 << bit), reg);

Expand Down
17 changes: 7 additions & 10 deletions drivers/gpio/gpiolib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1309,9 +1309,8 @@ static void gpio_chip_set_multiple(struct gpio_chip *chip,
continue;
}
/* set outputs if the corresponding mask bit is set */
if (__test_and_clear_bit(i, mask)) {
if (__test_and_clear_bit(i, mask))
chip->set(chip, i, test_bit(i, bits));
}
}
}
}
Expand All @@ -1329,9 +1328,9 @@ static void gpiod_set_array_value_priv(bool raw, bool can_sleep,
unsigned long bits[BITS_TO_LONGS(chip->ngpio)];
int count = 0;

if (!can_sleep) {
if (!can_sleep)
WARN_ON(chip->can_sleep);
}

memset(mask, 0, sizeof(mask));
do {
struct gpio_desc *desc = desc_array[i];
Expand All @@ -1346,24 +1345,22 @@ static void gpiod_set_array_value_priv(bool raw, bool can_sleep,
* open drain and open source outputs are set individually
*/
if (test_bit(FLAG_OPEN_DRAIN, &desc->flags)) {
_gpio_set_open_drain_value(desc,value);
_gpio_set_open_drain_value(desc, value);
} else if (test_bit(FLAG_OPEN_SOURCE, &desc->flags)) {
_gpio_set_open_source_value(desc, value);
} else {
__set_bit(hwgpio, mask);
if (value) {
if (value)
__set_bit(hwgpio, bits);
} else {
else
__clear_bit(hwgpio, bits);
}
count++;
}
i++;
} while ((i < array_size) && (desc_array[i]->chip == chip));
/* push collected bits to outputs */
if (count != 0) {
if (count != 0)
gpio_chip_set_multiple(chip, mask, bits);
}
}
}

Expand Down

0 comments on commit 38e003f

Please sign in to comment.