]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
power_supply: Don't iterate over devices to return -EPROBE_DEFER
authorViresh Kumar <viresh.kumar@linaro.org>
Thu, 4 Sep 2014 12:01:36 +0000 (17:31 +0530)
committerSebastian Reichel <sre@kernel.org>
Tue, 16 Sep 2014 09:01:38 +0000 (11:01 +0200)
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>
drivers/power/power_supply_core.c

index 81177e299230d38b7afb26bcb0a1021fde380c1d..6cb7fe5c022d48ca237e31eb89e78f8f70665776 100644 (file)
@@ -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