diff options
author | Evgeniy Polyakov <zbr@ioremap.net> | 2009-01-08 05:09:01 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-08 19:31:13 +0300 |
commit | 9be62e0b2fadaf5ffeb32fd1b910ef1fe6bd43db (patch) | |
tree | 86d39cd9790a83275380d5f37495d76888c3153b /drivers/w1/w1_netlink.c | |
parent | 610705e780395ef30a1b8e53de150c37381ca31f (diff) | |
download | linux-9be62e0b2fadaf5ffeb32fd1b910ef1fe6bd43db.tar.xz |
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.c | 11 |
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, cmd->cmd, cmd->len); switch (cmd->cmd) { + case W1_CMD_TOUCH: + w1_touch_block(sl->master, cmd->data, cmd->len); + w1_send_read_reply(sl, msg, hdr, cmd); + break; case W1_CMD_READ: w1_read_block(sl->master, cmd->data, cmd->len); w1_send_read_reply(sl, msg, hdr, cmd); @@ -208,9 +212,6 @@ static void w1_cn_callback(void *data) break; } - if (!mlen) - goto out_cont; - if (m->type == W1_MASTER_CMD) { dev = w1_search_master_id(m->id.mst.id); } else if (m->type == W1_SLAVE_CMD) { @@ -227,6 +228,10 @@ static void w1_cn_callback(void *data) goto out_cont; } + err = 0; + if (!mlen) + goto out_cont; + mutex_lock(&dev->mutex); if (sl && w1_reset_select_slave(sl)) { |