Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7195c505 authored by Viresh Kumar's avatar Viresh Kumar Committed by Sebastian Reichel
Browse files

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: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
parent 464069ca
Loading
Loading
Loading
Loading
+0 −13
Original line number Original line Diff line number Diff line
@@ -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)
static int power_supply_find_supply_from_node(struct device_node *supply_node)
{
{
	int error;
	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
	 * class_for_each_device() either returns its own errors or values