Skip to content

Commit 37022f7

Browse files
Bartosz Golaszewskitsbogend
authored andcommitted
MIPS: txx9: gpio: use new line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return an integer, allowing to indicate failures. Convert the drivers to using them. Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Thomas Bogendoerfer <[email protected]>
1 parent 68bdc4d commit 37022f7

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

arch/mips/kernel/gpio_txx9.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,16 @@ static void txx9_gpio_set_raw(unsigned int offset, int value)
3232
__raw_writel(val, &txx9_pioptr->dout);
3333
}
3434

35-
static void txx9_gpio_set(struct gpio_chip *chip, unsigned int offset,
36-
int value)
35+
static int txx9_gpio_set(struct gpio_chip *chip, unsigned int offset,
36+
int value)
3737
{
3838
unsigned long flags;
3939
spin_lock_irqsave(&txx9_gpio_lock, flags);
4040
txx9_gpio_set_raw(offset, value);
4141
mmiowb();
4242
spin_unlock_irqrestore(&txx9_gpio_lock, flags);
43+
44+
return 0;
4345
}
4446

4547
static int txx9_gpio_dir_in(struct gpio_chip *chip, unsigned int offset)
@@ -68,7 +70,7 @@ static int txx9_gpio_dir_out(struct gpio_chip *chip, unsigned int offset,
6870

6971
static struct gpio_chip txx9_gpio_chip = {
7072
.get = txx9_gpio_get,
71-
.set = txx9_gpio_set,
73+
.set_rv = txx9_gpio_set,
7274
.direction_input = txx9_gpio_dir_in,
7375
.direction_output = txx9_gpio_dir_out,
7476
.label = "TXx9",

arch/mips/txx9/generic/setup.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -603,8 +603,8 @@ static int txx9_iocled_get(struct gpio_chip *chip, unsigned int offset)
603603
return !!(data->cur_val & (1 << offset));
604604
}
605605

606-
static void txx9_iocled_set(struct gpio_chip *chip, unsigned int offset,
607-
int value)
606+
static int txx9_iocled_set(struct gpio_chip *chip, unsigned int offset,
607+
int value)
608608
{
609609
struct txx9_iocled_data *data = gpiochip_get_data(chip);
610610
unsigned long flags;
@@ -616,6 +616,8 @@ static void txx9_iocled_set(struct gpio_chip *chip, unsigned int offset,
616616
writeb(data->cur_val, data->mmioaddr);
617617
mmiowb();
618618
spin_unlock_irqrestore(&txx9_iocled_lock, flags);
619+
620+
return 0;
619621
}
620622

621623
static int txx9_iocled_dir_in(struct gpio_chip *chip, unsigned int offset)
@@ -653,7 +655,7 @@ void __init txx9_iocled_init(unsigned long baseaddr,
653655
if (!iocled->mmioaddr)
654656
goto out_free;
655657
iocled->chip.get = txx9_iocled_get;
656-
iocled->chip.set = txx9_iocled_set;
658+
iocled->chip.set_rv = txx9_iocled_set;
657659
iocled->chip.direction_input = txx9_iocled_dir_in;
658660
iocled->chip.direction_output = txx9_iocled_dir_out;
659661
iocled->chip.label = "iocled";

0 commit comments

Comments
 (0)