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

Commit bdd4034d authored by Rabin Vincent's avatar Rabin Vincent Committed by Greg Kroah-Hartman
Browse files

driver core: always handle dpm_order



If !dev->class, device_move() does not respect the dpm_order.
Fix it to do so.

Acked-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: default avatarRabin Vincent <rabin.vincent@stericsson.com>
Reviewed-by: default avatarSrinidhi Kasagar <srinidhi.kasagar@stericsson.com>
[Fixed a small dangling label compile warning]
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent cfaf0251
Loading
Loading
Loading
Loading
+18 −18
Original line number Diff line number Diff line
@@ -1754,8 +1754,7 @@ int device_move(struct device *dev, struct device *new_parent,
		set_dev_node(dev, dev_to_node(new_parent));
	}

	if (!dev->class)
		goto out_put;
	if (dev->class) {
		error = device_move_class_links(dev, old_parent, new_parent);
		if (error) {
			/* We ignore errors on cleanup since we're hosed anyway... */
@@ -1774,6 +1773,7 @@ int device_move(struct device *dev, struct device *new_parent,
			put_device(new_parent);
			goto out;
		}
	}
	switch (dpm_order) {
	case DPM_ORDER_NONE:
		break;
@@ -1787,7 +1787,7 @@ int device_move(struct device *dev, struct device *new_parent,
		device_pm_move_last(dev);
		break;
	}
out_put:

	put_device(old_parent);
out:
	device_pm_unlock();