diff options
Diffstat (limited to 'drivers/base/dd.c')
| -rw-r--r-- | drivers/base/dd.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/base/dd.c b/drivers/base/dd.c index 442b7641a086..9fa888e08059 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c | |||
| @@ -45,7 +45,7 @@ | |||
| 45 | * retry them. | 45 | * retry them. |
| 46 | * | 46 | * |
| 47 | * The deferred_probe_mutex must be held any time the deferred_probe_*_list | 47 | * The deferred_probe_mutex must be held any time the deferred_probe_*_list |
| 48 | * of the (struct device*)->deferred_probe pointers are manipulated | 48 | * of the (struct device*)->p->deferred_probe pointers are manipulated |
| 49 | */ | 49 | */ |
| 50 | static DEFINE_MUTEX(deferred_probe_mutex); | 50 | static DEFINE_MUTEX(deferred_probe_mutex); |
| 51 | static LIST_HEAD(deferred_probe_pending_list); | 51 | static LIST_HEAD(deferred_probe_pending_list); |
| @@ -58,6 +58,7 @@ static struct workqueue_struct *deferred_wq; | |||
| 58 | static void deferred_probe_work_func(struct work_struct *work) | 58 | static void deferred_probe_work_func(struct work_struct *work) |
| 59 | { | 59 | { |
| 60 | struct device *dev; | 60 | struct device *dev; |
| 61 | struct device_private *private; | ||
| 61 | /* | 62 | /* |
| 62 | * This block processes every device in the deferred 'active' list. | 63 | * This block processes every device in the deferred 'active' list. |
| 63 | * Each device is removed from the active list and passed to | 64 | * Each device is removed from the active list and passed to |
| @@ -72,9 +73,10 @@ static void deferred_probe_work_func(struct work_struct *work) | |||
| 72 | */ | 73 | */ |
| 73 | mutex_lock(&deferred_probe_mutex); | 74 | mutex_lock(&deferred_probe_mutex); |
| 74 | while (!list_empty(&deferred_probe_active_list)) { | 75 | while (!list_empty(&deferred_probe_active_list)) { |
| 75 | dev = list_first_entry(&deferred_probe_active_list, | 76 | private = list_first_entry(&deferred_probe_active_list, |
| 76 | typeof(*dev), deferred_probe); | 77 | typeof(*dev->p), deferred_probe); |
| 77 | list_del_init(&dev->deferred_probe); | 78 | dev = private->device; |
| 79 | list_del_init(&private->deferred_probe); | ||
| 78 | 80 | ||
| 79 | get_device(dev); | 81 | get_device(dev); |
| 80 | 82 | ||
| @@ -94,9 +96,9 @@ static DECLARE_WORK(deferred_probe_work, deferred_probe_work_func); | |||
| 94 | static void driver_deferred_probe_add(struct device *dev) | 96 | static void driver_deferred_probe_add(struct device *dev) |
| 95 | { | 97 | { |
| 96 | mutex_lock(&deferred_probe_mutex); | 98 | mutex_lock(&deferred_probe_mutex); |
| 97 | if (list_empty(&dev->deferred_probe)) { | 99 | if (list_empty(&dev->p->deferred_probe)) { |
| 98 | dev_dbg(dev, "Added to deferred list\n"); | 100 | dev_dbg(dev, "Added to deferred list\n"); |
| 99 | list_add(&dev->deferred_probe, &deferred_probe_pending_list); | 101 | list_add(&dev->p->deferred_probe, &deferred_probe_pending_list); |
| 100 | } | 102 | } |
| 101 | mutex_unlock(&deferred_probe_mutex); | 103 | mutex_unlock(&deferred_probe_mutex); |
| 102 | } | 104 | } |
| @@ -104,9 +106,9 @@ static void driver_deferred_probe_add(struct device *dev) | |||
| 104 | void driver_deferred_probe_del(struct device *dev) | 106 | void driver_deferred_probe_del(struct device *dev) |
| 105 | { | 107 | { |
| 106 | mutex_lock(&deferred_probe_mutex); | 108 | mutex_lock(&deferred_probe_mutex); |
| 107 | if (!list_empty(&dev->deferred_probe)) { | 109 | if (!list_empty(&dev->p->deferred_probe)) { |
| 108 | dev_dbg(dev, "Removed from deferred list\n"); | 110 | dev_dbg(dev, "Removed from deferred list\n"); |
| 109 | list_del_init(&dev->deferred_probe); | 111 | list_del_init(&dev->p->deferred_probe); |
| 110 | } | 112 | } |
| 111 | mutex_unlock(&deferred_probe_mutex); | 113 | mutex_unlock(&deferred_probe_mutex); |
| 112 | } | 114 | } |
