pinctrl: make pinctrl_register() return proper error code
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: NMasahiro Yamada <yamada.masahiro@socionext.com> Acked-by: NPatrice Chotard <patrice.chotard@st.com> Acked-by: NThierry Reding <treding@nvidia.com> Acked-by: NHeiko Stuebner <heiko@sntech.de> Tested-by: NMika Westerberg <mika.westerberg@linux.intel.com> Acked-by: NMika Westerberg <mika.westerberg@linux.intel.com> Acked-by: NLee Jones <lee@kernel.org> Acked-by: NSören Brinkmann <soren.brinkmann@xilinx.com> Acked-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: NRay Jui <rjui@broadcom.com> Acked-by: NAntoine Tenart <antoine.tenart@free-electrons.com> Acked-by: NHongzhou Yang <hongzhou.yang@mediatek.com> Acked-by: NWei Chen <Wei.Chen@csr.com> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
Showing
想要评论请 注册 或 登录