driver core: always handle dpm_order
If !dev->class, device_move() does not respect the dpm_order. Fix it to do so. Acked-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com> Reviewed-by: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> [Fixed a small dangling label compile warning] Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
cfaf025112
commit
bdd4034df8
|
@ -1754,8 +1754,7 @@ int device_move(struct device *dev, struct device *new_parent,
|
||||||
set_dev_node(dev, dev_to_node(new_parent));
|
set_dev_node(dev, dev_to_node(new_parent));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!dev->class)
|
if (dev->class) {
|
||||||
goto out_put;
|
|
||||||
error = device_move_class_links(dev, old_parent, new_parent);
|
error = device_move_class_links(dev, old_parent, new_parent);
|
||||||
if (error) {
|
if (error) {
|
||||||
/* We ignore errors on cleanup since we're hosed anyway... */
|
/* 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);
|
put_device(new_parent);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
switch (dpm_order) {
|
switch (dpm_order) {
|
||||||
case DPM_ORDER_NONE:
|
case DPM_ORDER_NONE:
|
||||||
break;
|
break;
|
||||||
|
@ -1787,7 +1787,7 @@ int device_move(struct device *dev, struct device *new_parent,
|
||||||
device_pm_move_last(dev);
|
device_pm_move_last(dev);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
out_put:
|
|
||||||
put_device(old_parent);
|
put_device(old_parent);
|
||||||
out:
|
out:
|
||||||
device_pm_unlock();
|
device_pm_unlock();
|
||||||
|
|
Loading…
Reference in New Issue