[PATCH] pinctrl: make pinctrl_register() return proper error code

Patrice Chotard patrice.chotard at st.com
Tue Jun 9 00:29:59 PDT 2015


Hi Masahiro

On 06/09/2015 06:01 AM, Masahiro Yamada wrote:
> Currently, pinctrl_register() just returns NULL on error, so the
> callers can not know the exact reason of the failure.
>
> Some of the pinctrl drivers return -EINVAL, some -ENODEV, and some
> -ENOMEM on error of pinctrl_register(), although the error code
> might be different from the real cause of the error.
>
> This commit reworks pinctrl_register() to return the appropriate
> error code and modifies all of the pinctrl drivers to use IS_ERR()
> for the error checking and PTR_ERR() for getting the error code.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro at socionext.com>
> ---
>
> This patch is based on linux-pinctrl/devel
> (Commit 7164873e7c69d6bab74726debc3b495a86332b1f).
>
> I think I converted all of the pinctrl drivers, but just in case,
> I'd like the driver maintainers to check this patch out.
>
>
>   drivers/pinctrl/bcm/pinctrl-bcm281xx.c        |  4 ++--
>   drivers/pinctrl/bcm/pinctrl-bcm2835.c         |  4 ++--
>   drivers/pinctrl/bcm/pinctrl-cygnus-gpio.c     |  4 ++--
>   drivers/pinctrl/bcm/pinctrl-cygnus-mux.c      |  4 ++--
>   drivers/pinctrl/berlin/berlin.c               |  4 ++--
>   drivers/pinctrl/core.c                        | 17 ++++++++++-------
>   drivers/pinctrl/freescale/pinctrl-imx.c       |  4 ++--
>   drivers/pinctrl/freescale/pinctrl-imx1-core.c |  4 ++--
>   drivers/pinctrl/freescale/pinctrl-mxs.c       |  4 ++--
>   drivers/pinctrl/intel/pinctrl-cherryview.c    |  4 ++--
>   drivers/pinctrl/intel/pinctrl-intel.c         |  4 ++--
>   drivers/pinctrl/mediatek/pinctrl-mtk-common.c |  4 ++--
>   drivers/pinctrl/meson/pinctrl-meson.c         |  4 ++--
>   drivers/pinctrl/mvebu/pinctrl-mvebu.c         |  4 ++--
>   drivers/pinctrl/nomadik/pinctrl-abx500.c      |  4 ++--
>   drivers/pinctrl/nomadik/pinctrl-nomadik.c     |  4 ++--
>   drivers/pinctrl/pinctrl-adi2.c                |  4 ++--
>   drivers/pinctrl/pinctrl-amd.c                 |  4 ++--
>   drivers/pinctrl/pinctrl-as3722.c              |  4 ++--
>   drivers/pinctrl/pinctrl-at91.c                |  4 ++--
>   drivers/pinctrl/pinctrl-lantiq.c              |  4 ++--
>   drivers/pinctrl/pinctrl-lpc18xx.c             |  4 ++--
>   drivers/pinctrl/pinctrl-palmas.c              |  4 ++--
>   drivers/pinctrl/pinctrl-pistachio.c           |  4 ++--
>   drivers/pinctrl/pinctrl-rockchip.c            |  4 ++--
>   drivers/pinctrl/pinctrl-single.c              |  4 ++--
>   drivers/pinctrl/pinctrl-st.c                  |  4 ++--
>   drivers/pinctrl/pinctrl-tb10x.c               |  4 ++--
>   drivers/pinctrl/pinctrl-tegra-xusb.c          |  4 ++--
>   drivers/pinctrl/pinctrl-tegra.c               |  4 ++--
>   drivers/pinctrl/pinctrl-tz1090-pdc.c          |  4 ++--
>   drivers/pinctrl/pinctrl-tz1090.c              |  4 ++--
>   drivers/pinctrl/pinctrl-u300.c                |  4 ++--
>   drivers/pinctrl/pinctrl-zynq.c                |  4 ++--
>   drivers/pinctrl/qcom/pinctrl-msm.c            |  4 ++--
>   drivers/pinctrl/qcom/pinctrl-spmi-gpio.c      |  4 ++--
>   drivers/pinctrl/qcom/pinctrl-spmi-mpp.c       |  4 ++--
>   drivers/pinctrl/samsung/pinctrl-exynos5440.c  |  4 ++--
>   drivers/pinctrl/samsung/pinctrl-samsung.c     |  4 ++--
>   drivers/pinctrl/sh-pfc/pinctrl.c              |  4 ++--
>   drivers/pinctrl/sirf/pinctrl-atlas7.c         |  4 ++--
>   drivers/pinctrl/sirf/pinctrl-sirf.c           |  4 ++--
>   drivers/pinctrl/spear/pinctrl-spear.c         |  4 ++--
>   drivers/pinctrl/sunxi/pinctrl-sunxi.c         |  4 ++--
>   drivers/pinctrl/vt8500/pinctrl-wmt.c          |  4 ++--
>   45 files changed, 98 insertions(+), 95 deletions(-)
>
> <snip>


for

  drivers/pinctrl/nomadik/pinctrl-abx500.c      |  4 ++--

and

  drivers/pinctrl/pinctrl-st.c                  |  4 ++--

Acked-by: Patrice Chotard <patrice.chotard at st.com>

Thanks

Patrice




More information about the linux-rpi-kernel mailing list