diff options
Diffstat (limited to 'drivers/pinctrl/pinctrl-ocelot.c')
-rw-r--r-- | drivers/pinctrl/pinctrl-ocelot.c | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/drivers/pinctrl/pinctrl-ocelot.c b/drivers/pinctrl/pinctrl-ocelot.c index 61532a7a612a..fbb3d43746bb 100644 --- a/drivers/pinctrl/pinctrl-ocelot.c +++ b/drivers/pinctrl/pinctrl-ocelot.c @@ -1777,7 +1777,7 @@ static const struct pinctrl_ops ocelot_pctl_ops = { .dt_free_map = pinconf_generic_dt_free_map, }; -static struct ocelot_match_data luton_desc = { +static const struct ocelot_match_data luton_desc = { .desc = { .name = "luton-pinctrl", .pins = luton_pins, @@ -1788,7 +1788,7 @@ static struct ocelot_match_data luton_desc = { }, }; -static struct ocelot_match_data serval_desc = { +static const struct ocelot_match_data serval_desc = { .desc = { .name = "serval-pinctrl", .pins = serval_pins, @@ -1799,7 +1799,7 @@ static struct ocelot_match_data serval_desc = { }, }; -static struct ocelot_match_data ocelot_desc = { +static const struct ocelot_match_data ocelot_desc = { .desc = { .name = "ocelot-pinctrl", .pins = ocelot_pins, @@ -1810,7 +1810,7 @@ static struct ocelot_match_data ocelot_desc = { }, }; -static struct ocelot_match_data jaguar2_desc = { +static const struct ocelot_match_data jaguar2_desc = { .desc = { .name = "jaguar2-pinctrl", .pins = jaguar2_pins, @@ -1821,7 +1821,7 @@ static struct ocelot_match_data jaguar2_desc = { }, }; -static struct ocelot_match_data servalt_desc = { +static const struct ocelot_match_data servalt_desc = { .desc = { .name = "servalt-pinctrl", .pins = servalt_pins, @@ -1832,7 +1832,7 @@ static struct ocelot_match_data servalt_desc = { }, }; -static struct ocelot_match_data sparx5_desc = { +static const struct ocelot_match_data sparx5_desc = { .desc = { .name = "sparx5-pinctrl", .pins = sparx5_pins, @@ -1850,7 +1850,7 @@ static struct ocelot_match_data sparx5_desc = { }, }; -static struct ocelot_match_data lan966x_desc = { +static const struct ocelot_match_data lan966x_desc = { .desc = { .name = "lan966x-pinctrl", .pins = lan966x_pins, @@ -1867,7 +1867,7 @@ static struct ocelot_match_data lan966x_desc = { }, }; -static struct ocelot_match_data lan969x_desc = { +static const struct ocelot_match_data lan969x_desc = { .desc = { .name = "lan969x-pinctrl", .pins = lan969x_pins, @@ -1950,17 +1950,18 @@ static int ocelot_gpio_get(struct gpio_chip *chip, unsigned int offset) return !!(val & BIT(offset % 32)); } -static void ocelot_gpio_set(struct gpio_chip *chip, unsigned int offset, - int value) +static int ocelot_gpio_set(struct gpio_chip *chip, unsigned int offset, + int value) { struct ocelot_pinctrl *info = gpiochip_get_data(chip); if (value) - regmap_write(info->map, REG(OCELOT_GPIO_OUT_SET, info, offset), - BIT(offset % 32)); - else - regmap_write(info->map, REG(OCELOT_GPIO_OUT_CLR, info, offset), - BIT(offset % 32)); + return regmap_write(info->map, + REG(OCELOT_GPIO_OUT_SET, info, offset), + BIT(offset % 32)); + + return regmap_write(info->map, REG(OCELOT_GPIO_OUT_CLR, info, offset), + BIT(offset % 32)); } static int ocelot_gpio_get_direction(struct gpio_chip *chip, @@ -1996,7 +1997,7 @@ static int ocelot_gpio_direction_output(struct gpio_chip *chip, static const struct gpio_chip ocelot_gpiolib_chip = { .request = gpiochip_generic_request, .free = gpiochip_generic_free, - .set = ocelot_gpio_set, + .set_rv = ocelot_gpio_set, .get = ocelot_gpio_get, .get_direction = ocelot_gpio_get_direction, .direction_input = pinctrl_gpio_direction_input, @@ -2116,7 +2117,7 @@ static void ocelot_irq_ack(struct irq_data *data) static int ocelot_irq_set_type(struct irq_data *data, unsigned int type); -static struct irq_chip ocelot_level_irqchip = { +static const struct irq_chip ocelot_level_irqchip = { .name = "gpio", .irq_mask = ocelot_irq_mask, .irq_ack = ocelot_irq_ack, @@ -2126,7 +2127,7 @@ static struct irq_chip ocelot_level_irqchip = { GPIOCHIP_IRQ_RESOURCE_HELPERS }; -static struct irq_chip ocelot_irqchip = { +static const struct irq_chip ocelot_irqchip = { .name = "gpio", .irq_mask = ocelot_irq_mask, .irq_ack = ocelot_irq_ack, |