[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1457434405-30372-4-git-send-email-ldewangan@nvidia.com>
Date: Tue, 8 Mar 2016 16:23:23 +0530
From: Laxman Dewangan <ldewangan@...dia.com>
To: <broonie@...nel.org>, <robh+dt@...nel.org>, <pawel.moll@....com>
CC: <lgirdwood@...il.com>, <lee.jones@...aro.org>,
<devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
Laxman Dewangan <ldewangan@...dia.com>
Subject: [PATCH 3/5] regulator: pwm: Prints error number when it fails
Prints the error number along with error message when any
error occurs. This helps on getting the reason of failure
quickly from log without any code instrument.
Signed-off-by: Laxman Dewangan <ldewangan@...dia.com>
Cc: Lee Jones <lee.jones@...aro.org>
---
drivers/regulator/pwm-regulator.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/regulator/pwm-regulator.c b/drivers/regulator/pwm-regulator.c
index 4689d62..9db67a1 100644
--- a/drivers/regulator/pwm-regulator.c
+++ b/drivers/regulator/pwm-regulator.c
@@ -277,16 +277,18 @@ static int pwm_regulator_probe(struct platform_device *pdev)
drvdata->pwm = devm_pwm_get(&pdev->dev, NULL);
if (IS_ERR(drvdata->pwm)) {
- dev_err(&pdev->dev, "Failed to get PWM\n");
- return PTR_ERR(drvdata->pwm);
+ ret = PTR_ERR(drvdata->pwm);
+ dev_err(&pdev->dev, "Failed to get PWM, %d\n", ret);
+ return ret;
}
regulator = devm_regulator_register(&pdev->dev,
&drvdata->desc, &config);
if (IS_ERR(regulator)) {
- dev_err(&pdev->dev, "Failed to register regulator %s\n",
- drvdata->desc.name);
- return PTR_ERR(regulator);
+ ret = PTR_ERR(regulator);
+ dev_err(&pdev->dev, "Failed to register regulator %s, %d\n",
+ drvdata->desc.name, ret);
+ return ret;
}
return 0;
--
2.1.4
Powered by blists - more mailing lists