diff options
Diffstat (limited to 'drivers/xen/xenbus/xenbus_probe.c')
-rw-r--r-- | drivers/xen/xenbus/xenbus_probe.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c index 3800da7dabfe..19bce3e1b333 100644 --- a/drivers/xen/xenbus/xenbus_probe.c +++ b/drivers/xen/xenbus/xenbus_probe.c | |||
@@ -843,7 +843,7 @@ postcore_initcall(xenbus_probe_init); | |||
843 | 843 | ||
844 | MODULE_LICENSE("GPL"); | 844 | MODULE_LICENSE("GPL"); |
845 | 845 | ||
846 | static int is_disconnected_device(struct device *dev, void *data) | 846 | static int is_device_connecting(struct device *dev, void *data) |
847 | { | 847 | { |
848 | struct xenbus_device *xendev = to_xenbus_device(dev); | 848 | struct xenbus_device *xendev = to_xenbus_device(dev); |
849 | struct device_driver *drv = data; | 849 | struct device_driver *drv = data; |
@@ -861,14 +861,15 @@ static int is_disconnected_device(struct device *dev, void *data) | |||
861 | return 0; | 861 | return 0; |
862 | 862 | ||
863 | xendrv = to_xenbus_driver(dev->driver); | 863 | xendrv = to_xenbus_driver(dev->driver); |
864 | return (xendev->state != XenbusStateConnected || | 864 | return (xendev->state < XenbusStateConnected || |
865 | (xendrv->is_ready && !xendrv->is_ready(xendev))); | 865 | (xendev->state == XenbusStateConnected && |
866 | xendrv->is_ready && !xendrv->is_ready(xendev))); | ||
866 | } | 867 | } |
867 | 868 | ||
868 | static int exists_disconnected_device(struct device_driver *drv) | 869 | static int exists_connecting_device(struct device_driver *drv) |
869 | { | 870 | { |
870 | return bus_for_each_dev(&xenbus_frontend.bus, NULL, drv, | 871 | return bus_for_each_dev(&xenbus_frontend.bus, NULL, drv, |
871 | is_disconnected_device); | 872 | is_device_connecting); |
872 | } | 873 | } |
873 | 874 | ||
874 | static int print_device_status(struct device *dev, void *data) | 875 | static int print_device_status(struct device *dev, void *data) |
@@ -918,7 +919,7 @@ static void wait_for_devices(struct xenbus_driver *xendrv) | |||
918 | if (!ready_to_wait_for_devices || !xen_domain()) | 919 | if (!ready_to_wait_for_devices || !xen_domain()) |
919 | return; | 920 | return; |
920 | 921 | ||
921 | while (exists_disconnected_device(drv)) { | 922 | while (exists_connecting_device(drv)) { |
922 | if (time_after(jiffies, timeout)) | 923 | if (time_after(jiffies, timeout)) |
923 | break; | 924 | break; |
924 | schedule_timeout_interruptible(HZ/10); | 925 | schedule_timeout_interruptible(HZ/10); |