diff mbox

[v2,1/4] bq24022: Evaluate returns of gpio_direction_output-calls

Message ID 201108291756.17516.heiko@sntech.de (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Heiko Stuebner Aug. 29, 2011, 3:56 p.m. UTC
It wasn't done before.

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

Comments

Mark Brown Aug. 30, 2011, 10:39 a.m. UTC | #1
On Mon, Aug 29, 2011 at 05:56:17PM +0200, Heiko Stübner wrote:
> It wasn't done before.
> 
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>

Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
diff mbox

Patch

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);