aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/cros_ec.c
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2014-06-18 14:14:04 -0400
committerLee Jones <lee.jones@linaro.org>2014-07-09 09:58:18 -0400
commit5799f95a373a2752e5c732f531a6f40fe458b818 (patch)
tree70c4fcb0c05b37bab60d69dff8ce505d963fb3c4 /drivers/mfd/cros_ec.c
parent533cec8f34778de10412dfabac991cf458ebf3c9 (diff)
mfd: cros_ec: cleanup: Remove EC wrapper functions
Remove the three wrapper functions that talk to the EC without passing all the desired arguments and just use the underlying communication function that passes everything in a struct intead. This is internal code refactoring only. Nothing should change. Signed-off-by: Bill Richardson <wfrichar@chromium.org> Signed-off-by: Doug Anderson <dianders@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Wolfram Sang <wsa@the-dreams.de> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd/cros_ec.c')
-rw-r--r--drivers/mfd/cros_ec.c32
1 files changed, 0 insertions, 32 deletions
diff --git a/drivers/mfd/cros_ec.c b/drivers/mfd/cros_ec.c
index 49ed8c340868..4851ed2fbe31 100644
--- a/drivers/mfd/cros_ec.c
+++ b/drivers/mfd/cros_ec.c
@@ -44,34 +44,6 @@ int cros_ec_prepare_tx(struct cros_ec_device *ec_dev,
44} 44}
45EXPORT_SYMBOL(cros_ec_prepare_tx); 45EXPORT_SYMBOL(cros_ec_prepare_tx);
46 46
47static int cros_ec_command_sendrecv(struct cros_ec_device *ec_dev,
48 uint16_t cmd, void *out_buf, int out_len,
49 void *in_buf, int in_len)
50{
51 struct cros_ec_command msg;
52
53 msg.version = cmd >> 8;
54 msg.command = cmd & 0xff;
55 msg.outdata = out_buf;
56 msg.outsize = out_len;
57 msg.indata = in_buf;
58 msg.insize = in_len;
59
60 return ec_dev->cmd_xfer(ec_dev, &msg);
61}
62
63static int cros_ec_command_recv(struct cros_ec_device *ec_dev,
64 uint16_t cmd, void *buf, int buf_len)
65{
66 return cros_ec_command_sendrecv(ec_dev, cmd, NULL, 0, buf, buf_len);
67}
68
69static int cros_ec_command_send(struct cros_ec_device *ec_dev,
70 uint16_t cmd, void *buf, int buf_len)
71{
72 return cros_ec_command_sendrecv(ec_dev, cmd, buf, buf_len, NULL, 0);
73}
74
75static irqreturn_t ec_irq_thread(int irq, void *data) 47static irqreturn_t ec_irq_thread(int irq, void *data)
76{ 48{
77 struct cros_ec_device *ec_dev = data; 49 struct cros_ec_device *ec_dev = data;
@@ -104,10 +76,6 @@ int cros_ec_register(struct cros_ec_device *ec_dev)
104 76
105 BLOCKING_INIT_NOTIFIER_HEAD(&ec_dev->event_notifier); 77 BLOCKING_INIT_NOTIFIER_HEAD(&ec_dev->event_notifier);
106 78
107 ec_dev->command_send = cros_ec_command_send;
108 ec_dev->command_recv = cros_ec_command_recv;
109 ec_dev->command_sendrecv = cros_ec_command_sendrecv;
110
111 if (ec_dev->din_size) { 79 if (ec_dev->din_size) {
112 ec_dev->din = devm_kzalloc(dev, ec_dev->din_size, GFP_KERNEL); 80 ec_dev->din = devm_kzalloc(dev, ec_dev->din_size, GFP_KERNEL);
113 if (!ec_dev->din) 81 if (!ec_dev->din)