Driver core: Fix device_move() vs. dpm list ordering, v2

dpm_list currently relies on the fact that child devices will
be registered after their parents to get a correct suspend
order. Using device_move() however destroys this assumption, as
an already registered device may be moved under a newly registered
one.

This patch adds a new argument to device_move(), allowing callers
to specify how dpm_list should be adapted.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Cornelia Huck
2009-03-04 12:44:00 +01:00
committed by Greg Kroah-Hartman
parent 60530afe1e
commit ffa6a7054d
8 changed files with 92 additions and 9 deletions

View File

@ -140,7 +140,7 @@ static void del_conn(struct work_struct *work)
dev = device_find_child(&conn->dev, NULL, __match_tty);
if (!dev)
break;
device_move(dev, NULL);
device_move(dev, NULL, DPM_ORDER_DEV_LAST);
put_device(dev);
}