Skip to content

Commit 4863d75

Browse files
Bartosz Golaszewskiandy-shev
authored andcommitted
pinctrl: baytrail: use new GPIO line value setter callbacks
struct gpio_chip now has callbacks for setting line values that return an integer, allowing to indicate failures. Convert the driver to using them. Signed-off-by: Bartosz Golaszewski <[email protected]> Acked-by: Mika Westerberg <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
1 parent 19272b3 commit 4863d75

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/pinctrl/intel/pinctrl-baytrail.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,15 +1045,15 @@ static int byt_gpio_get(struct gpio_chip *chip, unsigned int offset)
10451045
return !!(val & BYT_LEVEL);
10461046
}
10471047

1048-
static void byt_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
1048+
static int byt_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
10491049
{
10501050
struct intel_pinctrl *vg = gpiochip_get_data(chip);
10511051
void __iomem *reg;
10521052
u32 old_val;
10531053

10541054
reg = byt_gpio_reg(vg, offset, BYT_VAL_REG);
10551055
if (!reg)
1056-
return;
1056+
return -EINVAL;
10571057

10581058
guard(raw_spinlock_irqsave)(&byt_lock);
10591059

@@ -1062,6 +1062,8 @@ static void byt_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
10621062
writel(old_val | BYT_LEVEL, reg);
10631063
else
10641064
writel(old_val & ~BYT_LEVEL, reg);
1065+
1066+
return 0;
10651067
}
10661068

10671069
static int byt_gpio_get_direction(struct gpio_chip *chip, unsigned int offset)
@@ -1229,7 +1231,7 @@ static const struct gpio_chip byt_gpio_chip = {
12291231
.direction_input = byt_gpio_direction_input,
12301232
.direction_output = byt_gpio_direction_output,
12311233
.get = byt_gpio_get,
1232-
.set = byt_gpio_set,
1234+
.set_rv = byt_gpio_set,
12331235
.set_config = gpiochip_generic_config,
12341236
.dbg_show = byt_gpio_dbg_show,
12351237
};

0 commit comments

Comments
 (0)