diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2013-05-12 08:34:45 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-05-21 12:39:56 -0400 |
commit | db086fa926e57e1bd70e8c41235d230b3caa5e99 (patch) | |
tree | c8f414c1cb636034ac7ecdf0303a98103caddba8 /drivers/misc/mei | |
parent | e7d87ca1089165c05376df50f1be0f68d72ab08b (diff) |
mei: move mei_cl_complete to client.c
1. rename mei_cl_complete_handler to mei_cl_complete
2. move the function client.c where it belongs
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei')
-rw-r--r-- | drivers/misc/mei/client.c | 26 | ||||
-rw-r--r-- | drivers/misc/mei/client.h | 1 | ||||
-rw-r--r-- | drivers/misc/mei/interrupt.c | 28 |
3 files changed, 28 insertions, 27 deletions
diff --git a/drivers/misc/mei/client.c b/drivers/misc/mei/client.c index e310ca6ed1a3..c2534ca5c6f1 100644 --- a/drivers/misc/mei/client.c +++ b/drivers/misc/mei/client.c | |||
@@ -785,6 +785,32 @@ err: | |||
785 | } | 785 | } |
786 | 786 | ||
787 | 787 | ||
788 | /** | ||
789 | * mei_cl_complete - processes completed operation for a client | ||
790 | * | ||
791 | * @cl: private data of the file object. | ||
792 | * @cb: callback block. | ||
793 | */ | ||
794 | void mei_cl_complete(struct mei_cl *cl, struct mei_cl_cb *cb) | ||
795 | { | ||
796 | if (cb->fop_type == MEI_FOP_WRITE) { | ||
797 | mei_io_cb_free(cb); | ||
798 | cb = NULL; | ||
799 | cl->writing_state = MEI_WRITE_COMPLETE; | ||
800 | if (waitqueue_active(&cl->tx_wait)) | ||
801 | wake_up_interruptible(&cl->tx_wait); | ||
802 | |||
803 | } else if (cb->fop_type == MEI_FOP_READ && | ||
804 | MEI_READING == cl->reading_state) { | ||
805 | cl->reading_state = MEI_READ_COMPLETE; | ||
806 | if (waitqueue_active(&cl->rx_wait)) | ||
807 | wake_up_interruptible(&cl->rx_wait); | ||
808 | else | ||
809 | mei_cl_bus_rx_event(cl); | ||
810 | |||
811 | } | ||
812 | } | ||
813 | |||
788 | 814 | ||
789 | /** | 815 | /** |
790 | * mei_cl_all_disconnect - disconnect forcefully all connected clients | 816 | * mei_cl_all_disconnect - disconnect forcefully all connected clients |
diff --git a/drivers/misc/mei/client.h b/drivers/misc/mei/client.h index cfdb144526aa..7dc2af7b6fba 100644 --- a/drivers/misc/mei/client.h +++ b/drivers/misc/mei/client.h | |||
@@ -89,6 +89,7 @@ int mei_cl_disconnect(struct mei_cl *cl); | |||
89 | int mei_cl_connect(struct mei_cl *cl, struct file *file); | 89 | int mei_cl_connect(struct mei_cl *cl, struct file *file); |
90 | int mei_cl_read_start(struct mei_cl *cl, size_t length); | 90 | int mei_cl_read_start(struct mei_cl *cl, size_t length); |
91 | int mei_cl_write(struct mei_cl *cl, struct mei_cl_cb *cb, bool blocking); | 91 | int mei_cl_write(struct mei_cl *cl, struct mei_cl_cb *cb, bool blocking); |
92 | void mei_cl_complete(struct mei_cl *cl, struct mei_cl_cb *cb); | ||
92 | 93 | ||
93 | void mei_host_client_init(struct work_struct *work); | 94 | void mei_host_client_init(struct work_struct *work); |
94 | 95 | ||
diff --git a/drivers/misc/mei/interrupt.c b/drivers/misc/mei/interrupt.c index 2ad736989410..93da90a0986f 100644 --- a/drivers/misc/mei/interrupt.c +++ b/drivers/misc/mei/interrupt.c | |||
@@ -31,32 +31,6 @@ | |||
31 | 31 | ||
32 | 32 | ||
33 | /** | 33 | /** |
34 | * mei_cl_complete_handler - processes completed operation for a client | ||
35 | * | ||
36 | * @cl: private data of the file object. | ||
37 | * @cb: callback block. | ||
38 | */ | ||
39 | static void mei_cl_complete_handler(struct mei_cl *cl, struct mei_cl_cb *cb) | ||
40 | { | ||
41 | if (cb->fop_type == MEI_FOP_WRITE) { | ||
42 | mei_io_cb_free(cb); | ||
43 | cb = NULL; | ||
44 | cl->writing_state = MEI_WRITE_COMPLETE; | ||
45 | if (waitqueue_active(&cl->tx_wait)) | ||
46 | wake_up_interruptible(&cl->tx_wait); | ||
47 | |||
48 | } else if (cb->fop_type == MEI_FOP_READ && | ||
49 | MEI_READING == cl->reading_state) { | ||
50 | cl->reading_state = MEI_READ_COMPLETE; | ||
51 | if (waitqueue_active(&cl->rx_wait)) | ||
52 | wake_up_interruptible(&cl->rx_wait); | ||
53 | else | ||
54 | mei_cl_bus_rx_event(cl); | ||
55 | |||
56 | } | ||
57 | } | ||
58 | |||
59 | /** | ||
60 | * mei_irq_compl_handler - dispatch complete handelers | 34 | * mei_irq_compl_handler - dispatch complete handelers |
61 | * for the completed callbacks | 35 | * for the completed callbacks |
62 | * | 36 | * |
@@ -78,7 +52,7 @@ void mei_irq_compl_handler(struct mei_device *dev, struct mei_cl_cb *compl_list) | |||
78 | if (cl == &dev->iamthif_cl) | 52 | if (cl == &dev->iamthif_cl) |
79 | mei_amthif_complete(dev, cb); | 53 | mei_amthif_complete(dev, cb); |
80 | else | 54 | else |
81 | mei_cl_complete_handler(cl, cb); | 55 | mei_cl_complete(cl, cb); |
82 | } | 56 | } |
83 | } | 57 | } |
84 | EXPORT_SYMBOL_GPL(mei_irq_compl_handler); | 58 | EXPORT_SYMBOL_GPL(mei_irq_compl_handler); |