From 96670411a5fd461019e10d2d4bcbcfeb873d8294 Mon Sep 17 00:00:00 2001
From: Heiko Stuebner <heiko@sntech.de>
Date: Sun, 28 Aug 2011 14:47:46 +0200
Subject: [PATCH v2 1/4] bq24022: Evaluate returns of gpio_direction_output-calls

It wasn't done before.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 Changes since v1: use dev_err instead of dev_dbg
 drivers/regulator/bq24022.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/regulator/bq24022.c b/drivers/regulator/bq24022.c
index e24d1b7..56627d7 100644
--- a/drivers/regulator/bq24022.c
+++ b/drivers/regulator/bq24022.c
@@ -104,7 +104,17 @@ static int __init bq24022_probe(struct platform_device *pdev)
 		goto err_iset2;
 	}
 	ret = gpio_direction_output(pdata->gpio_iset2, 0);
+	if (ret) {
+		dev_err(&pdev->dev, "couldn't set ISET2 GPIO: %d\n",
+			pdata->gpio_iset2);
+		goto err_reg;
+	}
 	ret = gpio_direction_output(pdata->gpio_nce, 1);
+	if (ret) {
+		dev_err(&pdev->dev, "couldn't set nCE GPIO: %d\n",
+			pdata->gpio_nce);
+		goto err_reg;
+	}
 
 	bq24022 = regulator_register(&bq24022_desc, &pdev->dev,
 				     pdata->init_data, pdata);
-- 
1.7.2.3

