summaryrefslogtreecommitdiffstats
path: root/drivers/media/rc
diff options
context:
space:
mode:
authorSean Young <sean@mess.org>2021-09-08 15:05:52 +0200
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2021-09-30 10:08:01 +0200
commit1d37c85425122cdb56f6448286cc41419a34d621 (patch)
treebc820ad1e1f6a7ca6f306c9afbfba4e952831dc9 /drivers/media/rc
parent5173cca012b018e2acf5da3f928807618e367dae (diff)
downloadlinux-stable-1d37c85425122cdb56f6448286cc41419a34d621.tar.gz
linux-stable-1d37c85425122cdb56f6448286cc41419a34d621.tar.bz2
linux-stable-1d37c85425122cdb56f6448286cc41419a34d621.zip
media: ir_toy: deal with residual irdata before expected response
After sending the start transmit command, the device is supposed to respond with the length of the buffer which can be sent. There might be some residual ir data there. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/rc')
-rw-r--r--drivers/media/rc/ir_toy.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/media/rc/ir_toy.c b/drivers/media/rc/ir_toy.c
index 45d39b6e49c0..2b7c8bba4d6a 100644
--- a/drivers/media/rc/ir_toy.c
+++ b/drivers/media/rc/ir_toy.c
@@ -122,6 +122,7 @@ static void irtoy_response(struct irtoy *irtoy, u32 len)
len, irtoy->in);
}
break;
+ case STATE_COMMAND_NO_RESP:
case STATE_IRDATA: {
struct ir_raw_event rawir = { .pulse = irtoy->pulse };
__be16 *in = (__be16 *)irtoy->in;
@@ -167,10 +168,8 @@ static void irtoy_response(struct irtoy *irtoy, u32 len)
int err;
if (len != 1 || space > MAX_PACKET || space == 0) {
- dev_err(irtoy->dev, "packet length expected: %*phN\n",
+ dev_dbg(irtoy->dev, "packet length expected: %*phN\n",
len, irtoy->in);
- irtoy->state = STATE_IRDATA;
- complete(&irtoy->command_done);
break;
}
@@ -194,9 +193,6 @@ static void irtoy_response(struct irtoy *irtoy, u32 len)
irtoy->tx_len -= buf_len;
}
break;
- case STATE_COMMAND_NO_RESP:
- dev_err(irtoy->dev, "unexpected response to reset: %*phN\n",
- len, irtoy->in);
}
}