bq24022: Evaluate returns of gpio_direction_output-calls
From: Heiko Stuebner <heiko@...> Date: Sun, 28 Aug 2011 14:47:46 +0200
Commit-Message
It wasn't done before. Signed-off-by: Heiko Stuebner <heiko@...> Acked-by: Mark Brown <broonie@...>
Patch-Comment
Changes since v1: use dev_err instead of dev_dbg drivers/regulator/bq24022.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-)
Statistics
- 10 lines added
- 0 lines removed
Changes
------------------------- drivers/regulator/bq24022.c --------------------------
index e24d1b7..56627d7 100644
@@ -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);