aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/w1/w1_netlink.c
diff options
context:
space:
mode:
authorEvgeniy Polyakov <zbr@ioremap.net>2009-01-07 21:09:01 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-08 11:31:13 -0500
commit9be62e0b2fadaf5ffeb32fd1b910ef1fe6bd43db (patch)
tree86d39cd9790a83275380d5f37495d76888c3153b /drivers/w1/w1_netlink.c
parent610705e780395ef30a1b8e53de150c37381ca31f (diff)
w1: add touch block command
Writes and returns sampled data back to userspace. Signed-off-by: Evgeniy Polyakov <zbr@ioremap.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/w1/w1_netlink.c')
-rw-r--r--drivers/w1/w1_netlink.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/w1/w1_netlink.c b/drivers/w1/w1_netlink.c
index 2e07b59b9859..cae556c8577b 100644
--- a/drivers/w1/w1_netlink.c
+++ b/drivers/w1/w1_netlink.c
@@ -108,6 +108,10 @@ static int w1_process_command_slave(struct w1_slave *sl, struct cn_msg *msg,
108 cmd->cmd, cmd->len); 108 cmd->cmd, cmd->len);
109 109
110 switch (cmd->cmd) { 110 switch (cmd->cmd) {
111 case W1_CMD_TOUCH:
112 w1_touch_block(sl->master, cmd->data, cmd->len);
113 w1_send_read_reply(sl, msg, hdr, cmd);
114 break;
111 case W1_CMD_READ: 115 case W1_CMD_READ:
112 w1_read_block(sl->master, cmd->data, cmd->len); 116 w1_read_block(sl->master, cmd->data, cmd->len);
113 w1_send_read_reply(sl, msg, hdr, cmd); 117 w1_send_read_reply(sl, msg, hdr, cmd);
@@ -208,9 +212,6 @@ static void w1_cn_callback(void *data)
208 break; 212 break;
209 } 213 }
210 214
211 if (!mlen)
212 goto out_cont;
213
214 if (m->type == W1_MASTER_CMD) { 215 if (m->type == W1_MASTER_CMD) {
215 dev = w1_search_master_id(m->id.mst.id); 216 dev = w1_search_master_id(m->id.mst.id);
216 } else if (m->type == W1_SLAVE_CMD) { 217 } else if (m->type == W1_SLAVE_CMD) {
@@ -227,6 +228,10 @@ static void w1_cn_callback(void *data)
227 goto out_cont; 228 goto out_cont;
228 } 229 }
229 230
231 err = 0;
232 if (!mlen)
233 goto out_cont;
234
230 mutex_lock(&dev->mutex); 235 mutex_lock(&dev->mutex);
231 236
232 if (sl && w1_reset_select_slave(sl)) { 237 if (sl && w1_reset_select_slave(sl)) {