mfd: da9052: Simplify function return logic
authorJavier Martinez Canillas <javier@osg.samsung.com>
Tue, 29 Sep 2015 11:26:07 +0000 (13:26 +0200)
committerLee Jones <lee.jones@linaro.org>
Fri, 30 Oct 2015 17:19:46 +0000 (17:19 +0000)
The invoked functions already return zero on success or a negative
errno code so there is no need to open code the logic in the caller.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/da9052-i2c.c
drivers/mfd/da9052-spi.c

index 02887001e800b0a08bb70a30346585e1914f6e4a..2697ffb08009b48c3803dbfc9263b309f13ff444 100644 (file)
@@ -174,11 +174,7 @@ static int da9052_i2c_probe(struct i2c_client *client,
                return ret;
        }
 
-       ret = da9052_device_init(da9052, id->driver_data);
-       if (ret != 0)
-               return ret;
-
-       return 0;
+       return da9052_device_init(da9052, id->driver_data);
 }
 
 static int da9052_i2c_remove(struct i2c_client *client)
index b5de8a6856c0de07f29c10dbeaa4de67c0ac4617..0f5e2c2858c18deebfa65d00529fd61eead11620 100644 (file)
@@ -56,11 +56,7 @@ static int da9052_spi_probe(struct spi_device *spi)
                return ret;
        }
 
-       ret = da9052_device_init(da9052, id->driver_data);
-       if (ret != 0)
-               return ret;
-
-       return 0;
+       return da9052_device_init(da9052, id->driver_data);
 }
 
 static int da9052_spi_remove(struct spi_device *spi)