i2c: at91_i2c: Change error return -ENODEV to -EINVAL
authorWenyou Yang <wenyou.yang@atmel.com>
Tue, 27 Sep 2016 03:00:32 +0000 (11:00 +0800)
committerAndreas Bießmann <andreas@biessmann.org>
Fri, 28 Oct 2016 16:37:14 +0000 (18:37 +0200)
Change the error return value -ENODEV from to -EINVAL for more
reasonable.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
drivers/i2c/at91_i2c.c

index dcd3ce8627b9846326699c3390c5757c5977765d..4bc54eea596eb6b2a63bae682de7feb6550f9b25 100644 (file)
@@ -190,7 +190,7 @@ static int at91_i2c_enable_clk(struct udevice *dev)
 
        clk_rate = clk_get_rate(&clk);
        if (!clk_rate)
-               return -ENODEV;
+               return -EINVAL;
 
        bus->bus_clk_rate = clk_rate;