2011-02-24 17:38:51

by Mark Brown

[permalink] [raw]
Subject: [PATCH] regulator: If we fail when setting up a supply say which supply

Makes it a bit easier to identify if it's a problem with the supplies,
the usual error would be omitting the supply name entirely.

Signed-off-by: Mark Brown <[email protected]>
---
drivers/regulator/core.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 9fa2095..a2dc622 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -2565,8 +2565,11 @@ struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
init_data->consumer_supplies[i].dev,
init_data->consumer_supplies[i].dev_name,
init_data->consumer_supplies[i].supply);
- if (ret < 0)
+ if (ret < 0) {
+ dev_err(dev, "Failed to set supply %s\n",
+ init_data->consumer_supplies[i].supply);
goto unset_supplies;
+ }
}

list_add(&rdev->list, &regulator_list);
--
1.7.2.3


2011-02-25 09:00:28

by Liam Girdwood

[permalink] [raw]
Subject: Re: [PATCH] regulator: If we fail when setting up a supply say which supply

On Thu, 2011-02-24 at 17:39 +0000, Mark Brown wrote:
> Makes it a bit easier to identify if it's a problem with the supplies,
> the usual error would be omitting the supply name entirely.
>
> Signed-off-by: Mark Brown <[email protected]>
> ---
> drivers/regulator/core.c | 5 ++++-
> 1 files changed, 4 insertions(+), 1 deletions(-)

Applied.

Thanks

Liam