From 327e58d1b2bebcf642d0cb865366e99040f2f7cc Mon Sep 17 00:00:00 2001 From: Nishanth Menon Date: Tue, 16 Apr 2013 16:45:16 -0500 Subject: [PATCH] --- yaml --- r: 365126 b: refs/heads/master c: 1e4b545cdd93318379c6b1fb0a99536fa3260f53 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/regulator/core.c | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 974b83162d83..92ee74182237 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0f7b87f0acc04e4f22ec5d3f2283a80993ca3aa8 +refs/heads/master: 1e4b545cdd93318379c6b1fb0a99536fa3260f53 diff --git a/trunk/drivers/regulator/core.c b/trunk/drivers/regulator/core.c index a51e1e5fdff3..73edb0ef6e17 100644 --- a/trunk/drivers/regulator/core.c +++ b/trunk/drivers/regulator/core.c @@ -1229,7 +1229,7 @@ static struct regulator *_regulator_get(struct device *dev, const char *id, struct regulator_dev *rdev; struct regulator *regulator = ERR_PTR(-EPROBE_DEFER); const char *devname = NULL; - int ret; + int ret = 0; if (id == NULL) { pr_err("get() with no identifier\n"); @@ -1245,6 +1245,15 @@ static struct regulator *_regulator_get(struct device *dev, const char *id, if (rdev) goto found; + /* + * If we have return value from dev_lookup fail, we do not expect to + * succeed, so, quit with appropriate error value + */ + if (ret) { + regulator = ERR_PTR(ret); + goto out; + } + if (board_wants_dummy_regulator) { rdev = dummy_regulator_rdev; goto found;