Skip to content

Commit 7e21f2e

Browse files
XenuIsWatchingMaureenHelm
authored andcommitted
drivers: i3c: shell: add parse args func for rstact
Add the parse args function for the rstact Signed-off-by: Ryan McClelland <[email protected]>
1 parent aac1584 commit 7e21f2e

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

drivers/i3c/i3c_shell.c

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,21 +1064,9 @@ static int cmd_i3c_ccc_rstact(const struct shell *sh, size_t argc, char **argv)
10641064
int ret;
10651065
uint8_t data;
10661066

1067-
dev = device_get_binding(argv[ARGV_DEV]);
1068-
if (!dev) {
1069-
shell_error(sh, "I3C: Device driver %s not found.", argv[ARGV_DEV]);
1070-
return -ENODEV;
1071-
}
1072-
1073-
tdev = device_get_binding(argv[ARGV_TDEV]);
1074-
if (!tdev) {
1075-
shell_error(sh, "I3C: Device driver %s not found.", argv[ARGV_TDEV]);
1076-
return -ENODEV;
1077-
}
1078-
desc = get_i3c_attached_desc_from_dev_name(dev, tdev->name);
1079-
if (!desc) {
1080-
shell_error(sh, "I3C: Device %s not attached to bus.", tdev->name);
1081-
return -ENODEV;
1067+
ret = i3c_parse_args(sh, argv, &dev, &tdev, &desc);
1068+
if (ret != 0) {
1069+
return ret;
10821070
}
10831071

10841072
action = strtol(argv[5], NULL, 16);

0 commit comments

Comments
 (0)