Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1234980 > unrolled thread

[PATCH 7/8] mfd: da9052: Simplify function return logic

Started byJavier Martinez Canillas <javier@osg.samsung.com>
First post2015-09-29 13:30 +0200
Last post2015-09-29 14:30 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 7/8] mfd: da9052: Simplify function return logic Javier Martinez Canillas <javier@osg.samsung.com> - 2015-09-29 13:30 +0200
    RE: [PATCH 7/8] mfd: da9052: Simplify function return logic "Opensource [Adam Thomson]" <Adam.Thomson.Opensource@diasemi.com> - 2015-09-29 14:30 +0200

#1234980 — [PATCH 7/8] mfd: da9052: Simplify function return logic

FromJavier Martinez Canillas <javier@osg.samsung.com>
Date2015-09-29 13:30 +0200
Subject[PATCH 7/8] mfd: da9052: Simplify function return logic
Message-ID<qe1gC-53J-15@gated-at.bofh.it>
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>
---

 drivers/mfd/da9052-i2c.c | 6 +-----
 drivers/mfd/da9052-spi.c | 6 +-----
 2 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/mfd/da9052-i2c.c b/drivers/mfd/da9052-i2c.c
index 02887001e800..2697ffb08009 100644
--- a/drivers/mfd/da9052-i2c.c
+++ b/drivers/mfd/da9052-i2c.c
@@ -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)
diff --git a/drivers/mfd/da9052-spi.c b/drivers/mfd/da9052-spi.c
index b5de8a6856c0..0f5e2c2858c1 100644
--- a/drivers/mfd/da9052-spi.c
+++ b/drivers/mfd/da9052-spi.c
@@ -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)
-- 
2.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1235017

From"Opensource [Adam Thomson]" <Adam.Thomson.Opensource@diasemi.com>
Date2015-09-29 14:30 +0200
Message-ID<qe2cH-6p2-13@gated-at.bofh.it>
In reply to#1234980
T24gU2VwdGVtYmVyIDI5LCAyMDE1IDEyOjI2LCBKYXZpZXIgTWFydGluZXogQ2FuaWxsYXMgd3Jv
dGU6DQoNCj4gVGhlIGludm9rZWQgZnVuY3Rpb25zIGFscmVhZHkgcmV0dXJuIHplcm8gb24gc3Vj
Y2VzcyBvciBhIG5lZ2F0aXZlDQo+IGVycm5vIGNvZGUgc28gdGhlcmUgaXMgbm8gbmVlZCB0byBv
cGVuIGNvZGUgdGhlIGxvZ2ljIGluIHRoZSBjYWxsZXIuDQo+IA0KPiBTaWduZWQtb2ZmLWJ5OiBK
YXZpZXIgTWFydGluZXogQ2FuaWxsYXMgPGphdmllckBvc2cuc2Ftc3VuZy5jb20+DQo+IC0tLQ0K
DQpBY2tlZC1ieTogQWRhbSBUaG9tc29uIDxBZGFtLlRob21zb24uT3BlbnNvdXJjZUBkaWFzZW1p
LmNvbT4NCg==
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web