[PATCH] pinctrl: zynq: change error code for pinctrl_register failure

Arnd Bergmann arnd at arndb.de
Tue May 26 01:12:13 PDT 2015


On Tuesday 26 May 2015 13:18:29 Masahiro Yamada wrote:
> diff --git a/drivers/pinctrl/pinctrl-zynq.c b/drivers/pinctrl/pinctrl-zynq.c
> index 04748a4..0ff653c 100644
> --- a/drivers/pinctrl/pinctrl-zynq.c
> +++ b/drivers/pinctrl/pinctrl-zynq.c
> @@ -1141,7 +1141,7 @@ static int zynq_pinctrl_probe(struct platform_device *pdev)
>  
>         pctrl->pctrl = pinctrl_register(&zynq_desc, &pdev->dev, pctrl);
>         if (!pctrl->pctrl)
> -               return -ENOMEM;
> +               return -EINVAL;
>  
>         platform_set_drvdata(pdev, pctrl);
>  
> 

One choice seems as bad as the other to me ;-)

Could we add a pinctrl_register_reason() variant that returns a meaningful
error code as ERR_PTR?

	Arnd



More information about the linux-arm-kernel mailing list