sh-pfc: Remove check for impossible error condition
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Sat, 15 Dec 2012 22:50:51 +0000 (23:50 +0100)
committerSimon Horman <horms+renesas@verge.net.au>
Fri, 25 Jan 2013 00:24:21 +0000 (09:24 +0900)
The pfc pointer can't be NULL in the get and set value functions, remove
the error check.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
drivers/sh/pfc/gpio.c

index 37493e5fe2eeb10ed68f2369568327d58d7ea05f..c11c1bb97c71f2c6b14097a3ee63a455adc4ac65 100644 (file)
@@ -52,7 +52,7 @@ static void sh_gpio_set_value(struct sh_pfc *pfc, unsigned gpio, int value)
        struct pinmux_data_reg *dr = NULL;
        int bit = 0;
 
-       if (!pfc || sh_pfc_get_data_reg(pfc, gpio, &dr, &bit) != 0)
+       if (sh_pfc_get_data_reg(pfc, gpio, &dr, &bit) != 0)
                BUG();
        else
                sh_pfc_write_bit(dr, bit, value);
@@ -63,7 +63,7 @@ static int sh_gpio_get_value(struct sh_pfc *pfc, unsigned gpio)
        struct pinmux_data_reg *dr = NULL;
        int bit = 0;
 
-       if (!pfc || sh_pfc_get_data_reg(pfc, gpio, &dr, &bit) != 0)
+       if (sh_pfc_get_data_reg(pfc, gpio, &dr, &bit) != 0)
                return -EINVAL;
 
        return sh_pfc_read_bit(dr, bit);