diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2014-09-04 16:01:36 +0400 |
---|---|---|
committer | Sebastian Reichel <sre@kernel.org> | 2014-09-16 13:01:38 +0400 |
commit | 7195c505c2e8e2dd372f7b1737f2a788e74889fb (patch) | |
tree | 44484e99a487b039929336af33d31ca086c6d5c0 /drivers | |
parent | 464069cae95f71ba670c7e3a90d919b18fb48d66 (diff) | |
download | linux-7195c505c2e8e2dd372f7b1737f2a788e74889fb.tar.xz |
power_supply: Don't iterate over devices to return -EPROBE_DEFER
This piece of code was added so that we return -EPROBE_DEFER when no devices are
registered. But even if class_for_each_device() returns 0, we are going to
return -EPROBE_DEFER only.
And so this code isn't required at all. Remove it.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/power/power_supply_core.c | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/drivers/power/power_supply_core.c b/drivers/power/power_supply_core.c index 81177e299230..6cb7fe5c022d 100644 --- a/drivers/power/power_supply_core.c +++ b/drivers/power/power_supply_core.c @@ -179,19 +179,6 @@ static int __power_supply_find_supply_from_node(struct device *dev, static int power_supply_find_supply_from_node(struct device_node *supply_node) { int error; - struct device *dev; - struct class_dev_iter iter; - - /* - * Use iterator to see if any other device is registered. - * This is required since class_for_each_device returns 0 - * if there are no devices registered. - */ - class_dev_iter_init(&iter, power_supply_class, NULL, NULL); - dev = class_dev_iter_next(&iter); - - if (!dev) - return -EPROBE_DEFER; /* * class_for_each_device() either returns its own errors or values |