2 * Intel Management Engine Interface (Intel MEI) Linux driver
3 * Copyright (c) 2012-2013, Intel Corporation.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 #include <linux/module.h>
17 #include <linux/device.h>
18 #include <linux/kernel.h>
19 #include <linux/sched.h>
20 #include <linux/init.h>
21 #include <linux/errno.h>
22 #include <linux/slab.h>
23 #include <linux/mutex.h>
24 #include <linux/interrupt.h>
25 #include <linux/mei_cl_bus.h>
30 #define to_mei_cl_driver(d) container_of(d, struct mei_cl_driver, driver)
31 #define to_mei_cl_device(d) container_of(d, struct mei_cl_device, dev)
34 * __mei_cl_send - internal client send (write)
37 * @buf: buffer to send
38 * @length: buffer length
41 * Return: written size bytes or < 0 on error
43 ssize_t
__mei_cl_send(struct mei_cl
*cl
, u8
*buf
, size_t length
,
46 struct mei_device
*bus
;
50 if (WARN_ON(!cl
|| !cl
->dev
))
55 mutex_lock(&bus
->device_lock
);
56 if (bus
->dev_state
!= MEI_DEV_ENABLED
) {
61 if (!mei_cl_is_connected(cl
)) {
66 /* Check if we have an ME client device */
67 if (!mei_me_cl_is_active(cl
->me_cl
)) {
72 if (length
> mei_cl_mtu(cl
)) {
77 cb
= mei_cl_alloc_cb(cl
, length
, MEI_FOP_WRITE
, NULL
);
83 cb
->internal
= !!(mode
& MEI_CL_IO_TX_INTERNAL
);
84 cb
->blocking
= !!(mode
& MEI_CL_IO_TX_BLOCKING
);
85 memcpy(cb
->buf
.data
, buf
, length
);
87 rets
= mei_cl_write(cl
, cb
);
90 mutex_unlock(&bus
->device_lock
);
96 * __mei_cl_recv - internal client receive (read)
99 * @buf: buffer to receive
100 * @length: buffer length
102 * Return: read size in bytes of < 0 on error
104 ssize_t
__mei_cl_recv(struct mei_cl
*cl
, u8
*buf
, size_t length
)
106 struct mei_device
*bus
;
107 struct mei_cl_cb
*cb
;
111 if (WARN_ON(!cl
|| !cl
->dev
))
116 mutex_lock(&bus
->device_lock
);
117 if (bus
->dev_state
!= MEI_DEV_ENABLED
) {
122 cb
= mei_cl_read_cb(cl
, NULL
);
126 rets
= mei_cl_read_start(cl
, length
, NULL
);
127 if (rets
&& rets
!= -EBUSY
)
130 /* wait on event only if there is no other waiter */
131 /* synchronized under device mutex */
132 if (!waitqueue_active(&cl
->rx_wait
)) {
134 mutex_unlock(&bus
->device_lock
);
136 if (wait_event_interruptible(cl
->rx_wait
,
137 (!list_empty(&cl
->rd_completed
)) ||
138 (!mei_cl_is_connected(cl
)))) {
140 if (signal_pending(current
))
145 mutex_lock(&bus
->device_lock
);
147 if (!mei_cl_is_connected(cl
)) {
153 cb
= mei_cl_read_cb(cl
, NULL
);
165 r_length
= min_t(size_t, length
, cb
->buf_idx
);
166 memcpy(buf
, cb
->buf
.data
, r_length
);
172 mutex_unlock(&bus
->device_lock
);
178 * mei_cldev_send - me device send (write)
180 * @cldev: me client device
181 * @buf: buffer to send
182 * @length: buffer length
184 * Return: written size in bytes or < 0 on error
186 ssize_t
mei_cldev_send(struct mei_cl_device
*cldev
, u8
*buf
, size_t length
)
188 struct mei_cl
*cl
= cldev
->cl
;
190 return __mei_cl_send(cl
, buf
, length
, MEI_CL_IO_TX_BLOCKING
);
192 EXPORT_SYMBOL_GPL(mei_cldev_send
);
195 * mei_cldev_recv - client receive (read)
197 * @cldev: me client device
198 * @buf: buffer to receive
199 * @length: buffer length
201 * Return: read size in bytes of < 0 on error
203 ssize_t
mei_cldev_recv(struct mei_cl_device
*cldev
, u8
*buf
, size_t length
)
205 struct mei_cl
*cl
= cldev
->cl
;
207 return __mei_cl_recv(cl
, buf
, length
);
209 EXPORT_SYMBOL_GPL(mei_cldev_recv
);
212 * mei_cl_bus_rx_work - dispatch rx event for a bus device
216 static void mei_cl_bus_rx_work(struct work_struct
*work
)
218 struct mei_cl_device
*cldev
;
219 struct mei_device
*bus
;
221 cldev
= container_of(work
, struct mei_cl_device
, rx_work
);
228 mutex_lock(&bus
->device_lock
);
229 mei_cl_read_start(cldev
->cl
, mei_cl_mtu(cldev
->cl
), NULL
);
230 mutex_unlock(&bus
->device_lock
);
234 * mei_cl_bus_notif_work - dispatch FW notif event for a bus device
238 static void mei_cl_bus_notif_work(struct work_struct
*work
)
240 struct mei_cl_device
*cldev
;
242 cldev
= container_of(work
, struct mei_cl_device
, notif_work
);
245 cldev
->notif_cb(cldev
);
249 * mei_cl_bus_notify_event - schedule notify cb on bus client
253 * Return: true if event was scheduled
254 * false if the client is not waiting for event
256 bool mei_cl_bus_notify_event(struct mei_cl
*cl
)
258 struct mei_cl_device
*cldev
= cl
->cldev
;
260 if (!cldev
|| !cldev
->notif_cb
)
266 schedule_work(&cldev
->notif_work
);
268 cl
->notify_ev
= false;
274 * mei_cl_bus_rx_event - schedule rx event
278 * Return: true if event was scheduled
279 * false if the client is not waiting for event
281 bool mei_cl_bus_rx_event(struct mei_cl
*cl
)
283 struct mei_cl_device
*cldev
= cl
->cldev
;
285 if (!cldev
|| !cldev
->rx_cb
)
288 schedule_work(&cldev
->rx_work
);
294 * mei_cldev_register_rx_cb - register Rx event callback
296 * @cldev: me client devices
297 * @rx_cb: callback function
299 * Return: 0 on success
300 * -EALREADY if an callback is already registered
303 int mei_cldev_register_rx_cb(struct mei_cl_device
*cldev
, mei_cldev_cb_t rx_cb
)
305 struct mei_device
*bus
= cldev
->bus
;
313 cldev
->rx_cb
= rx_cb
;
314 INIT_WORK(&cldev
->rx_work
, mei_cl_bus_rx_work
);
316 mutex_lock(&bus
->device_lock
);
317 ret
= mei_cl_read_start(cldev
->cl
, mei_cl_mtu(cldev
->cl
), NULL
);
318 mutex_unlock(&bus
->device_lock
);
319 if (ret
&& ret
!= -EBUSY
)
324 EXPORT_SYMBOL_GPL(mei_cldev_register_rx_cb
);
327 * mei_cldev_register_notif_cb - register FW notification event callback
329 * @cldev: me client devices
330 * @notif_cb: callback function
332 * Return: 0 on success
333 * -EALREADY if an callback is already registered
336 int mei_cldev_register_notif_cb(struct mei_cl_device
*cldev
,
337 mei_cldev_cb_t notif_cb
)
339 struct mei_device
*bus
= cldev
->bus
;
348 cldev
->notif_cb
= notif_cb
;
349 INIT_WORK(&cldev
->notif_work
, mei_cl_bus_notif_work
);
351 mutex_lock(&bus
->device_lock
);
352 ret
= mei_cl_notify_request(cldev
->cl
, NULL
, 1);
353 mutex_unlock(&bus
->device_lock
);
359 EXPORT_SYMBOL_GPL(mei_cldev_register_notif_cb
);
362 * mei_cldev_get_drvdata - driver data getter
364 * @cldev: mei client device
366 * Return: driver private data
368 void *mei_cldev_get_drvdata(const struct mei_cl_device
*cldev
)
370 return dev_get_drvdata(&cldev
->dev
);
372 EXPORT_SYMBOL_GPL(mei_cldev_get_drvdata
);
375 * mei_cldev_set_drvdata - driver data setter
377 * @cldev: mei client device
378 * @data: data to store
380 void mei_cldev_set_drvdata(struct mei_cl_device
*cldev
, void *data
)
382 dev_set_drvdata(&cldev
->dev
, data
);
384 EXPORT_SYMBOL_GPL(mei_cldev_set_drvdata
);
387 * mei_cldev_uuid - return uuid of the underlying me client
389 * @cldev: mei client device
391 * Return: me client uuid
393 const uuid_le
*mei_cldev_uuid(const struct mei_cl_device
*cldev
)
395 return mei_me_cl_uuid(cldev
->me_cl
);
397 EXPORT_SYMBOL_GPL(mei_cldev_uuid
);
400 * mei_cldev_ver - return protocol version of the underlying me client
402 * @cldev: mei client device
404 * Return: me client protocol version
406 u8
mei_cldev_ver(const struct mei_cl_device
*cldev
)
408 return mei_me_cl_ver(cldev
->me_cl
);
410 EXPORT_SYMBOL_GPL(mei_cldev_ver
);
413 * mei_cldev_enabled - check whether the device is enabled
415 * @cldev: mei client device
417 * Return: true if me client is initialized and connected
419 bool mei_cldev_enabled(struct mei_cl_device
*cldev
)
421 return mei_cl_is_connected(cldev
->cl
);
423 EXPORT_SYMBOL_GPL(mei_cldev_enabled
);
426 * mei_cldev_enable_device - enable me client device
427 * create connection with me client
429 * @cldev: me client device
431 * Return: 0 on success and < 0 on error
433 int mei_cldev_enable(struct mei_cl_device
*cldev
)
435 struct mei_device
*bus
= cldev
->bus
;
441 if (cl
->state
== MEI_FILE_UNINITIALIZED
) {
442 mutex_lock(&bus
->device_lock
);
443 ret
= mei_cl_link(cl
);
444 mutex_unlock(&bus
->device_lock
);
447 /* update pointers */
451 mutex_lock(&bus
->device_lock
);
452 if (mei_cl_is_connected(cl
)) {
457 if (!mei_me_cl_is_active(cldev
->me_cl
)) {
458 dev_err(&cldev
->dev
, "me client is not active\n");
463 ret
= mei_cl_connect(cl
, cldev
->me_cl
, NULL
);
465 dev_err(&cldev
->dev
, "cannot connect\n");
468 mutex_unlock(&bus
->device_lock
);
472 EXPORT_SYMBOL_GPL(mei_cldev_enable
);
475 * mei_cldev_disable - disable me client device
476 * disconnect form the me client
478 * @cldev: me client device
480 * Return: 0 on success and < 0 on error
482 int mei_cldev_disable(struct mei_cl_device
*cldev
)
484 struct mei_device
*bus
;
495 mutex_lock(&bus
->device_lock
);
497 if (!mei_cl_is_connected(cl
)) {
498 dev_dbg(bus
->dev
, "Already disconnected");
503 err
= mei_cl_disconnect(cl
);
505 dev_err(bus
->dev
, "Could not disconnect from the ME client");
508 /* Flush queues and remove any pending read */
509 mei_cl_flush_queues(cl
, NULL
);
512 mutex_unlock(&bus
->device_lock
);
515 EXPORT_SYMBOL_GPL(mei_cldev_disable
);
518 * mei_cl_device_find - find matching entry in the driver id table
520 * @cldev: me client device
521 * @cldrv: me client driver
523 * Return: id on success; NULL if no id is matching
526 struct mei_cl_device_id
*mei_cl_device_find(struct mei_cl_device
*cldev
,
527 struct mei_cl_driver
*cldrv
)
529 const struct mei_cl_device_id
*id
;
534 uuid
= mei_me_cl_uuid(cldev
->me_cl
);
535 version
= mei_me_cl_ver(cldev
->me_cl
);
537 id
= cldrv
->id_table
;
538 while (uuid_le_cmp(NULL_UUID_LE
, id
->uuid
)) {
539 if (!uuid_le_cmp(*uuid
, id
->uuid
)) {
543 if (strncmp(cldev
->name
, id
->name
,
547 if (id
->version
!= MEI_CL_VERSION_ANY
)
548 if (id
->version
!= version
)
561 * mei_cl_device_match - device match function
566 * Return: 1 if matching device was found 0 otherwise
568 static int mei_cl_device_match(struct device
*dev
, struct device_driver
*drv
)
570 struct mei_cl_device
*cldev
= to_mei_cl_device(dev
);
571 struct mei_cl_driver
*cldrv
= to_mei_cl_driver(drv
);
572 const struct mei_cl_device_id
*found_id
;
577 if (!cldev
->do_match
)
580 if (!cldrv
|| !cldrv
->id_table
)
583 found_id
= mei_cl_device_find(cldev
, cldrv
);
591 * mei_cl_device_probe - bus probe function
595 * Return: 0 on success; < 0 otherwise
597 static int mei_cl_device_probe(struct device
*dev
)
599 struct mei_cl_device
*cldev
;
600 struct mei_cl_driver
*cldrv
;
601 const struct mei_cl_device_id
*id
;
604 cldev
= to_mei_cl_device(dev
);
605 cldrv
= to_mei_cl_driver(dev
->driver
);
610 if (!cldrv
|| !cldrv
->probe
)
613 id
= mei_cl_device_find(cldev
, cldrv
);
617 ret
= cldrv
->probe(cldev
, id
);
621 __module_get(THIS_MODULE
);
626 * mei_cl_device_remove - remove device from the bus
630 * Return: 0 on success; < 0 otherwise
632 static int mei_cl_device_remove(struct device
*dev
)
634 struct mei_cl_device
*cldev
= to_mei_cl_device(dev
);
635 struct mei_cl_driver
*cldrv
;
638 if (!cldev
|| !dev
->driver
)
642 cancel_work_sync(&cldev
->rx_work
);
645 if (cldev
->notif_cb
) {
646 cancel_work_sync(&cldev
->notif_work
);
647 cldev
->notif_cb
= NULL
;
650 cldrv
= to_mei_cl_driver(dev
->driver
);
652 ret
= cldrv
->remove(cldev
);
654 module_put(THIS_MODULE
);
660 static ssize_t
name_show(struct device
*dev
, struct device_attribute
*a
,
663 struct mei_cl_device
*cldev
= to_mei_cl_device(dev
);
665 return scnprintf(buf
, PAGE_SIZE
, "%s", cldev
->name
);
667 static DEVICE_ATTR_RO(name
);
669 static ssize_t
uuid_show(struct device
*dev
, struct device_attribute
*a
,
672 struct mei_cl_device
*cldev
= to_mei_cl_device(dev
);
673 const uuid_le
*uuid
= mei_me_cl_uuid(cldev
->me_cl
);
675 return scnprintf(buf
, PAGE_SIZE
, "%pUl", uuid
);
677 static DEVICE_ATTR_RO(uuid
);
679 static ssize_t
version_show(struct device
*dev
, struct device_attribute
*a
,
682 struct mei_cl_device
*cldev
= to_mei_cl_device(dev
);
683 u8 version
= mei_me_cl_ver(cldev
->me_cl
);
685 return scnprintf(buf
, PAGE_SIZE
, "%02X", version
);
687 static DEVICE_ATTR_RO(version
);
689 static ssize_t
modalias_show(struct device
*dev
, struct device_attribute
*a
,
692 struct mei_cl_device
*cldev
= to_mei_cl_device(dev
);
693 const uuid_le
*uuid
= mei_me_cl_uuid(cldev
->me_cl
);
695 return scnprintf(buf
, PAGE_SIZE
, "mei:%s:%pUl:", cldev
->name
, uuid
);
697 static DEVICE_ATTR_RO(modalias
);
699 static struct attribute
*mei_cldev_attrs
[] = {
702 &dev_attr_version
.attr
,
703 &dev_attr_modalias
.attr
,
706 ATTRIBUTE_GROUPS(mei_cldev
);
709 * mei_cl_device_uevent - me client bus uevent handler
712 * @env: uevent kobject
714 * Return: 0 on success -ENOMEM on when add_uevent_var fails
716 static int mei_cl_device_uevent(struct device
*dev
, struct kobj_uevent_env
*env
)
718 struct mei_cl_device
*cldev
= to_mei_cl_device(dev
);
719 const uuid_le
*uuid
= mei_me_cl_uuid(cldev
->me_cl
);
720 u8 version
= mei_me_cl_ver(cldev
->me_cl
);
722 if (add_uevent_var(env
, "MEI_CL_VERSION=%d", version
))
725 if (add_uevent_var(env
, "MEI_CL_UUID=%pUl", uuid
))
728 if (add_uevent_var(env
, "MEI_CL_NAME=%s", cldev
->name
))
731 if (add_uevent_var(env
, "MODALIAS=mei:%s:%pUl:%02X:",
732 cldev
->name
, uuid
, version
))
738 static struct bus_type mei_cl_bus_type
= {
740 .dev_groups
= mei_cldev_groups
,
741 .match
= mei_cl_device_match
,
742 .probe
= mei_cl_device_probe
,
743 .remove
= mei_cl_device_remove
,
744 .uevent
= mei_cl_device_uevent
,
747 static struct mei_device
*mei_dev_bus_get(struct mei_device
*bus
)
750 get_device(bus
->dev
);
755 static void mei_dev_bus_put(struct mei_device
*bus
)
758 put_device(bus
->dev
);
761 static void mei_cl_bus_dev_release(struct device
*dev
)
763 struct mei_cl_device
*cldev
= to_mei_cl_device(dev
);
768 mei_me_cl_put(cldev
->me_cl
);
769 mei_dev_bus_put(cldev
->bus
);
774 static struct device_type mei_cl_device_type
= {
775 .release
= mei_cl_bus_dev_release
,
779 * mei_cl_bus_set_name - set device name for me client device
781 * @cldev: me client device
783 static inline void mei_cl_bus_set_name(struct mei_cl_device
*cldev
)
785 dev_set_name(&cldev
->dev
, "mei:%s:%pUl:%02X",
787 mei_me_cl_uuid(cldev
->me_cl
),
788 mei_me_cl_ver(cldev
->me_cl
));
792 * mei_cl_bus_dev_alloc - initialize and allocate mei client device
797 * Return: allocated device structur or NULL on allocation failure
799 static struct mei_cl_device
*mei_cl_bus_dev_alloc(struct mei_device
*bus
,
800 struct mei_me_client
*me_cl
)
802 struct mei_cl_device
*cldev
;
805 cldev
= kzalloc(sizeof(struct mei_cl_device
), GFP_KERNEL
);
809 cl
= mei_cl_allocate(bus
);
815 device_initialize(&cldev
->dev
);
816 cldev
->dev
.parent
= bus
->dev
;
817 cldev
->dev
.bus
= &mei_cl_bus_type
;
818 cldev
->dev
.type
= &mei_cl_device_type
;
819 cldev
->bus
= mei_dev_bus_get(bus
);
820 cldev
->me_cl
= mei_me_cl_get(me_cl
);
822 mei_cl_bus_set_name(cldev
);
824 INIT_LIST_HEAD(&cldev
->bus_list
);
830 * mei_cl_dev_setup - setup me client device
831 * run fix up routines and set the device name
834 * @cldev: me client device
836 * Return: true if the device is eligible for enumeration
838 static bool mei_cl_bus_dev_setup(struct mei_device
*bus
,
839 struct mei_cl_device
*cldev
)
842 mei_cl_bus_dev_fixup(cldev
);
844 /* the device name can change during fix up */
846 mei_cl_bus_set_name(cldev
);
848 return cldev
->do_match
== 1;
852 * mei_cl_bus_dev_add - add me client devices
854 * @cldev: me client device
856 * Return: 0 on success; < 0 on failre
858 static int mei_cl_bus_dev_add(struct mei_cl_device
*cldev
)
862 dev_dbg(cldev
->bus
->dev
, "adding %pUL:%02X\n",
863 mei_me_cl_uuid(cldev
->me_cl
),
864 mei_me_cl_ver(cldev
->me_cl
));
865 ret
= device_add(&cldev
->dev
);
873 * mei_cl_bus_dev_stop - stop the driver
875 * @cldev: me client device
877 static void mei_cl_bus_dev_stop(struct mei_cl_device
*cldev
)
880 device_release_driver(&cldev
->dev
);
884 * mei_cl_bus_dev_destroy - destroy me client devices object
886 * @cldev: me client device
888 * Locking: called under "dev->cl_bus_lock" lock
890 static void mei_cl_bus_dev_destroy(struct mei_cl_device
*cldev
)
893 WARN_ON(!mutex_is_locked(&cldev
->bus
->cl_bus_lock
));
895 if (!cldev
->is_added
)
898 device_del(&cldev
->dev
);
900 list_del_init(&cldev
->bus_list
);
903 put_device(&cldev
->dev
);
907 * mei_cl_bus_remove_device - remove a devices form the bus
909 * @cldev: me client device
911 static void mei_cl_bus_remove_device(struct mei_cl_device
*cldev
)
913 mei_cl_bus_dev_stop(cldev
);
914 mei_cl_bus_dev_destroy(cldev
);
918 * mei_cl_bus_remove_devices - remove all devices form the bus
922 void mei_cl_bus_remove_devices(struct mei_device
*bus
)
924 struct mei_cl_device
*cldev
, *next
;
926 mutex_lock(&bus
->cl_bus_lock
);
927 list_for_each_entry_safe(cldev
, next
, &bus
->device_list
, bus_list
)
928 mei_cl_bus_remove_device(cldev
);
929 mutex_unlock(&bus
->cl_bus_lock
);
934 * mei_cl_bus_dev_init - allocate and initializes an mei client devices
940 * Locking: called under "dev->cl_bus_lock" lock
942 static void mei_cl_bus_dev_init(struct mei_device
*bus
,
943 struct mei_me_client
*me_cl
)
945 struct mei_cl_device
*cldev
;
947 WARN_ON(!mutex_is_locked(&bus
->cl_bus_lock
));
949 dev_dbg(bus
->dev
, "initializing %pUl", mei_me_cl_uuid(me_cl
));
951 if (me_cl
->bus_added
)
954 cldev
= mei_cl_bus_dev_alloc(bus
, me_cl
);
958 me_cl
->bus_added
= true;
959 list_add_tail(&cldev
->bus_list
, &bus
->device_list
);
964 * mei_cl_bus_rescan - scan me clients list and add create
965 * devices for eligible clients
969 void mei_cl_bus_rescan(struct mei_device
*bus
)
971 struct mei_cl_device
*cldev
, *n
;
972 struct mei_me_client
*me_cl
;
974 mutex_lock(&bus
->cl_bus_lock
);
976 down_read(&bus
->me_clients_rwsem
);
977 list_for_each_entry(me_cl
, &bus
->me_clients
, list
)
978 mei_cl_bus_dev_init(bus
, me_cl
);
979 up_read(&bus
->me_clients_rwsem
);
981 list_for_each_entry_safe(cldev
, n
, &bus
->device_list
, bus_list
) {
983 if (!mei_me_cl_is_active(cldev
->me_cl
)) {
984 mei_cl_bus_remove_device(cldev
);
991 if (mei_cl_bus_dev_setup(bus
, cldev
))
992 mei_cl_bus_dev_add(cldev
);
994 list_del_init(&cldev
->bus_list
);
995 put_device(&cldev
->dev
);
998 mutex_unlock(&bus
->cl_bus_lock
);
1000 dev_dbg(bus
->dev
, "rescan end");
1003 void mei_cl_bus_rescan_work(struct work_struct
*work
)
1005 struct mei_device
*bus
=
1006 container_of(work
, struct mei_device
, bus_rescan_work
);
1007 struct mei_me_client
*me_cl
;
1009 me_cl
= mei_me_cl_by_uuid(bus
, &mei_amthif_guid
);
1011 mei_amthif_host_init(bus
, me_cl
);
1012 mei_me_cl_put(me_cl
);
1014 mei_cl_bus_rescan(bus
);
1017 int __mei_cldev_driver_register(struct mei_cl_driver
*cldrv
,
1018 struct module
*owner
)
1022 cldrv
->driver
.name
= cldrv
->name
;
1023 cldrv
->driver
.owner
= owner
;
1024 cldrv
->driver
.bus
= &mei_cl_bus_type
;
1026 err
= driver_register(&cldrv
->driver
);
1030 pr_debug("mei: driver [%s] registered\n", cldrv
->driver
.name
);
1034 EXPORT_SYMBOL_GPL(__mei_cldev_driver_register
);
1036 void mei_cldev_driver_unregister(struct mei_cl_driver
*cldrv
)
1038 driver_unregister(&cldrv
->driver
);
1040 pr_debug("mei: driver [%s] unregistered\n", cldrv
->driver
.name
);
1042 EXPORT_SYMBOL_GPL(mei_cldev_driver_unregister
);
1045 int __init
mei_cl_bus_init(void)
1047 return bus_register(&mei_cl_bus_type
);
1050 void __exit
mei_cl_bus_exit(void)
1052 bus_unregister(&mei_cl_bus_type
);