[RFC PATCH 02/11] regulator: Fix error check in set_consumer_device_supply

Rajendra Nayak
2011-09-15T11:22:36Z

The parameters to set_consumer_device_supply() can be considered
invalid (and hence it could return -EINVAL) if nether consumer_dev nor
consumer_dev_name are passed, not when *both* are passed.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
---
drivers/regulator/core.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index d8e6a42..9365359 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -981,7 +981,7 @@ static int set_consumer_device_supply(struct regulator_dev *rdev,
struct regulator_map *node;
int has_dev;

- if (consumer_dev && consumer_dev_name)
+ if (!consumer_dev && !consumer_dev_name)
return -EINVAL;

if (!consumer_dev_name && consumer_dev)
--
1.7.1