diff options
author | Cornelia Huck <cornelia.huck@de.ibm.com> | 2009-03-04 06:44:00 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-03-24 19:38:26 -0400 |
commit | ffa6a7054d172a2f57248dff2de600ca795c5656 (patch) | |
tree | f93c6234bb90295c52fcef09e367ed77ff6c3645 /net/bluetooth/rfcomm/tty.c | |
parent | 60530afe1ee8a5532cb09d0ab5bc3f1a6495b780 (diff) |
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>
Diffstat (limited to 'net/bluetooth/rfcomm/tty.c')
-rw-r--r-- | net/bluetooth/rfcomm/tty.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c index d030c69cb5a3..abdc703a11d2 100644 --- a/net/bluetooth/rfcomm/tty.c +++ b/net/bluetooth/rfcomm/tty.c | |||
@@ -731,7 +731,8 @@ static int rfcomm_tty_open(struct tty_struct *tty, struct file *filp) | |||
731 | remove_wait_queue(&dev->wait, &wait); | 731 | remove_wait_queue(&dev->wait, &wait); |
732 | 732 | ||
733 | if (err == 0) | 733 | if (err == 0) |
734 | device_move(dev->tty_dev, rfcomm_get_device(dev)); | 734 | device_move(dev->tty_dev, rfcomm_get_device(dev), |
735 | DPM_ORDER_DEV_AFTER_PARENT); | ||
735 | 736 | ||
736 | rfcomm_tty_copy_pending(dev); | 737 | rfcomm_tty_copy_pending(dev); |
737 | 738 | ||
@@ -751,7 +752,7 @@ static void rfcomm_tty_close(struct tty_struct *tty, struct file *filp) | |||
751 | 752 | ||
752 | if (atomic_dec_and_test(&dev->opened)) { | 753 | if (atomic_dec_and_test(&dev->opened)) { |
753 | if (dev->tty_dev->parent) | 754 | if (dev->tty_dev->parent) |
754 | device_move(dev->tty_dev, NULL); | 755 | device_move(dev->tty_dev, NULL, DPM_ORDER_DEV_LAST); |
755 | 756 | ||
756 | /* Close DLC and dettach TTY */ | 757 | /* Close DLC and dettach TTY */ |
757 | rfcomm_dlc_close(dev->dlc, 0); | 758 | rfcomm_dlc_close(dev->dlc, 0); |