public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] regulator: Report error codes for bulk operations
@ 2009-10-13 12:06 Mark Brown
  2009-10-13 12:06 ` [PATCH 2/2] regulator: Handle missing constraints in _regulator_disable() Mark Brown
  2009-10-18 13:54 ` [PATCH 1/2] regulator: Report error codes for bulk operations Liam Girdwood
  0 siblings, 2 replies; 3+ messages in thread
From: Mark Brown @ 2009-10-13 12:06 UTC (permalink / raw)
  To: Liam Girdwood; +Cc: linux-kernel, Mark Brown

If we're going to log an error we may as well log what the error
code that we're failing on is.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 drivers/regulator/core.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 942af6e..25e35c7 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1890,9 +1890,9 @@ int regulator_bulk_get(struct device *dev, int num_consumers,
 		consumers[i].consumer = regulator_get(dev,
 						      consumers[i].supply);
 		if (IS_ERR(consumers[i].consumer)) {
-			dev_err(dev, "Failed to get supply '%s'\n",
-				consumers[i].supply);
 			ret = PTR_ERR(consumers[i].consumer);
+			dev_err(dev, "Failed to get supply '%s': %d\n",
+				consumers[i].supply, ret);
 			consumers[i].consumer = NULL;
 			goto err;
 		}
@@ -1935,7 +1935,7 @@ int regulator_bulk_enable(int num_consumers,
 	return 0;
 
 err:
-	printk(KERN_ERR "Failed to enable %s\n", consumers[i].supply);
+	printk(KERN_ERR "Failed to enable %s: %d\n", consumers[i].supply, ret);
 	for (i = 0; i < num_consumers; i++)
 		regulator_disable(consumers[i].consumer);
 
@@ -1970,7 +1970,8 @@ int regulator_bulk_disable(int num_consumers,
 	return 0;
 
 err:
-	printk(KERN_ERR "Failed to disable %s\n", consumers[i].supply);
+	printk(KERN_ERR "Failed to disable %s: %d\n", consumers[i].supply,
+	       ret);
 	for (i = 0; i < num_consumers; i++)
 		regulator_enable(consumers[i].consumer);
 
-- 
1.6.4.3


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

* [PATCH 2/2] regulator: Handle missing constraints in _regulator_disable()
  2009-10-13 12:06 [PATCH 1/2] regulator: Report error codes for bulk operations Mark Brown
@ 2009-10-13 12:06 ` Mark Brown
  2009-10-18 13:54 ` [PATCH 1/2] regulator: Report error codes for bulk operations Liam Girdwood
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2009-10-13 12:06 UTC (permalink / raw)
  To: Liam Girdwood; +Cc: linux-kernel, Mark Brown

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 drivers/regulator/core.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 25e35c7..1ac37f5 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1289,7 +1289,8 @@ static int _regulator_disable(struct regulator_dev *rdev)
 		return -EIO;
 
 	/* are we the last user and permitted to disable ? */
-	if (rdev->use_count == 1 && !rdev->constraints->always_on) {
+	if (rdev->use_count == 1 &&
+	    (rdev->constraints && !rdev->constraints->always_on)) {
 
 		/* we are last user */
 		if (_regulator_can_change_status(rdev) &&
-- 
1.6.4.3


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

* Re: [PATCH 1/2] regulator: Report error codes for bulk operations
  2009-10-13 12:06 [PATCH 1/2] regulator: Report error codes for bulk operations Mark Brown
  2009-10-13 12:06 ` [PATCH 2/2] regulator: Handle missing constraints in _regulator_disable() Mark Brown
@ 2009-10-18 13:54 ` Liam Girdwood
  1 sibling, 0 replies; 3+ messages in thread
From: Liam Girdwood @ 2009-10-18 13:54 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-kernel

On Tue, 2009-10-13 at 13:06 +0100, Mark Brown wrote:
> If we're going to log an error we may as well log what the error
> code that we're failing on is.
> 
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

Both Applied.

Thanks

Liam


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

end of thread, other threads:[~2009-10-18 13:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-13 12:06 [PATCH 1/2] regulator: Report error codes for bulk operations Mark Brown
2009-10-13 12:06 ` [PATCH 2/2] regulator: Handle missing constraints in _regulator_disable() Mark Brown
2009-10-18 13:54 ` [PATCH 1/2] regulator: Report error codes for bulk operations Liam Girdwood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox