clk: sunxi: tcon-ch1: Do not return a negative error in get_parent
authorMaxime Ripard <maxime.ripard@free-electrons.com>
Wed, 11 May 2016 18:57:44 +0000 (20:57 +0200)
committerMaxime Ripard <maxime.ripard@free-electrons.com>
Fri, 10 Jun 2016 09:49:15 +0000 (11:49 +0200)
get_parent is supposed to return an unsigned 8 bit integer, so returning
-EINVAL is a bad idea.

Remove it.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
drivers/clk/sunxi/clk-sun4i-tcon-ch1.c

index 98a4582..2485852 100644 (file)
@@ -85,9 +85,6 @@ static u8 tcon_ch1_get_parent(struct clk_hw *hw)
        reg = readl(tclk->reg) >> TCON_CH1_SCLK2_MUX_SHIFT;
        reg &= reg >> TCON_CH1_SCLK2_MUX_MASK;
 
-       if (reg >= num_parents)
-               return -EINVAL;
-
        return reg;
 }