pinctrl: use ERR_CAST instead of ERR_PTR/PTR_ERR
authorFabian Frederick <fabf@skynet.be>
Mon, 27 Apr 2015 16:04:05 +0000 (18:04 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 6 May 2015 13:34:51 +0000 (15:34 +0200)
Inspired by scripts/coccinelle/api/err_cast.cocci

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
include/linux/pinctrl/consumer.h

index 18eccefea06e40a0ea10f77e857105c6feaf4ff9..d7e5d608faa7db52543fbb4c7cc221171dca2744 100644 (file)
@@ -142,7 +142,7 @@ static inline struct pinctrl * __must_check pinctrl_get_select(
        s = pinctrl_lookup_state(p, name);
        if (IS_ERR(s)) {
                pinctrl_put(p);
-               return ERR_PTR(PTR_ERR(s));
+               return ERR_CAST(s);
        }
 
        ret = pinctrl_select_state(p, s);