diff options
Diffstat (limited to 'drivers/misc/mei/bus.c')
-rw-r--r-- | drivers/misc/mei/bus.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c index 4bc7d620d695..ddc5ac92a200 100644 --- a/drivers/misc/mei/bus.c +++ b/drivers/misc/mei/bus.c | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <linux/mei_cl_bus.h> | 26 | #include <linux/mei_cl_bus.h> |
27 | 27 | ||
28 | #include "mei_dev.h" | 28 | #include "mei_dev.h" |
29 | #include "hw-me.h" | ||
30 | #include "client.h" | 29 | #include "client.h" |
31 | 30 | ||
32 | #define to_mei_cl_driver(d) container_of(d, struct mei_cl_driver, driver) | 31 | #define to_mei_cl_driver(d) container_of(d, struct mei_cl_driver, driver) |
@@ -145,9 +144,9 @@ static struct device_type mei_cl_device_type = { | |||
145 | static struct mei_cl *mei_bus_find_mei_cl_by_uuid(struct mei_device *dev, | 144 | static struct mei_cl *mei_bus_find_mei_cl_by_uuid(struct mei_device *dev, |
146 | uuid_le uuid) | 145 | uuid_le uuid) |
147 | { | 146 | { |
148 | struct mei_cl *cl, *next; | 147 | struct mei_cl *cl; |
149 | 148 | ||
150 | list_for_each_entry_safe(cl, next, &dev->device_list, device_link) { | 149 | list_for_each_entry(cl, &dev->device_list, device_link) { |
151 | if (!uuid_le_cmp(uuid, cl->device_uuid)) | 150 | if (!uuid_le_cmp(uuid, cl->device_uuid)) |
152 | return cl; | 151 | return cl; |
153 | } | 152 | } |
@@ -524,6 +523,22 @@ void mei_cl_bus_rx_event(struct mei_cl *cl) | |||
524 | schedule_work(&device->event_work); | 523 | schedule_work(&device->event_work); |
525 | } | 524 | } |
526 | 525 | ||
526 | void mei_cl_bus_remove_devices(struct mei_device *dev) | ||
527 | { | ||
528 | struct mei_cl *cl, *next; | ||
529 | |||
530 | mutex_lock(&dev->device_lock); | ||
531 | list_for_each_entry_safe(cl, next, &dev->device_list, device_link) { | ||
532 | if (cl->device) | ||
533 | mei_cl_remove_device(cl->device); | ||
534 | |||
535 | list_del(&cl->device_link); | ||
536 | mei_cl_unlink(cl); | ||
537 | kfree(cl); | ||
538 | } | ||
539 | mutex_unlock(&dev->device_lock); | ||
540 | } | ||
541 | |||
527 | int __init mei_cl_bus_init(void) | 542 | int __init mei_cl_bus_init(void) |
528 | { | 543 | { |
529 | return bus_register(&mei_cl_bus_type); | 544 | return bus_register(&mei_cl_bus_type); |