[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aErJXcDTEytpRY6z@opensource.cirrus.com>
Date: Thu, 12 Jun 2025 13:34:37 +0100
From: Charles Keepax <ckeepax@...nsource.cirrus.com>
To: Bartosz Golaszewski <brgl@...ev.pl>
Cc: Richard Fitzgerald <rf@...nsource.cirrus.com>,
Linus Walleij <linus.walleij@...aro.org>,
David Rhodes <david.rhodes@...rus.com>, patches@...nsource.cirrus.com,
linux-sound@...r.kernel.org, linux-gpio@...r.kernel.org,
linux-kernel@...r.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
Subject: Re: [PATCH 1/2] pinctrl: cirrus: lochnagar: use new GPIO line value
setter callbacks
On Thu, Jun 12, 2025 at 02:19:53PM +0200, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
>
> 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 <bartosz.golaszewski@...aro.org>
> ---
> @@ -1075,29 +1074,31 @@ static void lochnagar_gpio_set(struct gpio_chip *chip,
> case LN_PTYPE_MUX:
> value |= LN2_OP_GPIO;
>
> - ret = lochnagar_pin_set_mux(priv, pin, value);
> + return lochnagar_pin_set_mux(priv, pin, value);
> break;
> case LN_PTYPE_GPIO:
> if (pin->invert)
> value = !value;
>
> - ret = regmap_update_bits(lochnagar->regmap, pin->reg,
> - BIT(pin->shift), value << pin->shift);
> + return regmap_update_bits(lochnagar->regmap, pin->reg,
> + BIT(pin->shift),
> + value << pin->shift);
> break;
> default:
> - ret = -EINVAL;
> break;
> }
>
> - if (ret < 0)
> - dev_err(chip->parent, "Failed to set %s value: %d\n",
> - pin->name, ret);
> + return -EINVAL;
Nit: I would be tempted just to move this return up into the
default case, the other two cases return so its slightly more
symmetical that way. But I don't feel super strongly:
Reviewed-by: Charles Keepax <ckeepax@...nsource.cirrus.com>
Thanks,
Charles
Powered by blists - more mailing lists