mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-28 07:13:34 +00:00
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>
This commit is contained in:
parent
5173cca012
commit
1d37c85425
1 changed files with 2 additions and 6 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue