[PATCH 4/8] pinctrl: Add third argument label for pinctrl_gpio_request() function

Stefan Roese sr at denx.de
Thu Jul 28 15:07:51 CEST 2022


Hi Pali.

On 25.07.22 13:56, Pali Rohár wrote:
> This change allows to use pinctrl_gpio_request() function as a direct
> pointer for dm_gpio_ops's .request callback.
> 
> Signed-off-by: Pali Rohár <pali at kernel.org>

Running a CI build on Azure, I see these errors at least for this
target:

rzg2_beacon

drivers/gpio/gpio-rcar.c: In function 'rcar_gpio_request':
drivers/gpio/gpio-rcar.c:136:16: error: too few arguments to function 
'pinctrl_gpio_request'
   136 |         return pinctrl_gpio_request(dev, offset);
       |                ^~~~~~~~~~~~~~~~~~~~
In file included from drivers/gpio/gpio-rcar.c:12:
include/dm/pinctrl.h:618:5: note: declared here
   618 | int pinctrl_gpio_request(struct udevice *dev, unsigned offset, 
const char *label);
       |     ^~~~~~~~~~~~~~~~~~~~
drivers/gpio/gpio-rcar.c:137:1: warning: control reaches end of non-void 
function [-Wreturn-type]
   137 | }
       | ^


Please run this (and if possible all more complex) patchset via some
world build / CI.

Thanks,
Stefan

> ---
>   drivers/pinctrl/pinctrl-uclass.c | 3 ++-
>   include/dm/pinctrl.h             | 3 ++-
>   2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pinctrl/pinctrl-uclass.c b/drivers/pinctrl/pinctrl-uclass.c
> index 38ce2b5e0ad9..ce2d5ddf6d92 100644
> --- a/drivers/pinctrl/pinctrl-uclass.c
> +++ b/drivers/pinctrl/pinctrl-uclass.c
> @@ -222,9 +222,10 @@ pinctrl_gpio_get_pinctrl_and_offset(struct udevice *dev, unsigned offset,
>    *
>    * @dev: GPIO peripheral device
>    * @offset: the GPIO pin offset from the GPIO controller
> + * @label: the GPIO pin label
>    * @return: 0 on success, or negative error code on failure
>    */
> -int pinctrl_gpio_request(struct udevice *dev, unsigned offset)
> +int pinctrl_gpio_request(struct udevice *dev, unsigned offset, const char *label)
>   {
>   	const struct pinctrl_ops *ops;
>   	struct udevice *pctldev;
> diff --git a/include/dm/pinctrl.h b/include/dm/pinctrl.h
> index 5436dc4a9a71..e3e50afeaff0 100644
> --- a/include/dm/pinctrl.h
> +++ b/include/dm/pinctrl.h
> @@ -611,10 +611,11 @@ int pinctrl_get_pin_name(struct udevice *dev, int selector, char *buf,
>    * pinctrl_gpio_request() - Request a single pin to be used as GPIO
>    * @dev:	GPIO peripheral device
>    * @offset:	GPIO pin offset from the GPIO controller
> + * @label:	GPIO label
>    *
>    * Return: 0 on success, or negative error code on failure
>    */
> -int pinctrl_gpio_request(struct udevice *dev, unsigned offset);
> +int pinctrl_gpio_request(struct udevice *dev, unsigned offset, const char *label);
>   
>   /**
>    * pinctrl_gpio_free() - Free a single pin used as GPIO

Viele Grüße,
Stefan Roese

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de


More information about the U-Boot mailing list