linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] regulator: act8865: Remove error variable in act8865_pmic_probe
@ 2014-06-30  7:32 Axel Lin
  2014-06-30  7:33 ` [PATCH 2/2] regulator: act8865: Explictly initialize of_node array Axel Lin
  2014-07-02 11:38 ` [PATCH 1/2] regulator: act8865: Remove error variable in act8865_pmic_probe Mark Brown
  0 siblings, 2 replies; 4+ messages in thread
From: Axel Lin @ 2014-06-30  7:32 UTC (permalink / raw)
  To: Mark Brown; +Cc: Beniamino Galvani, Wenyou.Yang, Liam Girdwood, linux-kernel

Simply use ret variable instead.
Also remove unneeded initialize for ret variable.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/regulator/act8865-regulator.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/regulator/act8865-regulator.c b/drivers/regulator/act8865-regulator.c
index fe2c038..f07be36 100644
--- a/drivers/regulator/act8865-regulator.c
+++ b/drivers/regulator/act8865-regulator.c
@@ -278,8 +278,7 @@ static int act8865_pmic_probe(struct i2c_client *client,
 	struct act8865 *act8865;
 	struct device_node *of_node[ACT8865_REG_NUM];
 	int i;
-	int ret = -EINVAL;
-	int error;
+	int ret;
 
 	if (dev->of_node && !pdata) {
 		const struct of_device_id *id;
@@ -307,10 +306,10 @@ static int act8865_pmic_probe(struct i2c_client *client,
 
 	act8865->regmap = devm_regmap_init_i2c(client, &act8865_regmap_config);
 	if (IS_ERR(act8865->regmap)) {
-		error = PTR_ERR(act8865->regmap);
+		ret = PTR_ERR(act8865->regmap);
 		dev_err(&client->dev, "Failed to allocate register map: %d\n",
-			error);
-		return error;
+			ret);
+		return ret;
 	}
 
 	/* Finally register devices */
-- 
1.9.1




^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-07-02 11:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-30  7:32 [PATCH 1/2] regulator: act8865: Remove error variable in act8865_pmic_probe Axel Lin
2014-06-30  7:33 ` [PATCH 2/2] regulator: act8865: Explictly initialize of_node array Axel Lin
2014-06-30 21:23   ` Beniamino Galvani
2014-07-02 11:38 ` [PATCH 1/2] regulator: act8865: Remove error variable in act8865_pmic_probe Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).