Skip to content

Commit

Permalink
drivers: i3c: shell: fix argc count for setmrl
Browse files Browse the repository at this point in the history
There is the wrong argc count for the max ibi len for setmrl.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
  • Loading branch information
XenuIsWatching authored and MaureenHelm committed Oct 21, 2024
1 parent f9ba776 commit 42da6c9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/i3c/i3c_shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -866,13 +866,13 @@ static int cmd_i3c_ccc_setmrl(const struct shell *sh, size_t argc, char **argv)
}

/* IBI length is required if the ibi payload bit is set */
if ((desc->bcr & I3C_BCR_IBI_PAYLOAD_HAS_DATA_BYTE) && (argc < 4)) {
if ((desc->bcr & I3C_BCR_IBI_PAYLOAD_HAS_DATA_BYTE) && (argc < 5)) {
shell_error(sh, "I3C: Missing IBI length.");
return -EINVAL;
}

mrl.len = strtol(argv[3], NULL, 16);
if (argc > 3) {
if (argc > 4) {
mrl.ibi_len = strtol(argv[4], NULL, 16);
}

Expand All @@ -883,7 +883,7 @@ static int cmd_i3c_ccc_setmrl(const struct shell *sh, size_t argc, char **argv)
}

desc->data_length.mrl = mrl.len;
if (argc > 3) {
if (argc > 4) {
desc->data_length.max_ibi = mrl.ibi_len;
}

Expand Down

0 comments on commit 42da6c9

Please sign in to comment.