Skip to content

Commit f17b155

Browse files
XenuIsWatchingMaureenHelm
authored andcommitted
drivers: i3c: shell: fix kconfig def for ibi
Fix kconfig def for ibi where it is missing the CONFIG_. Signed-off-by: Ryan McClelland <[email protected]>
1 parent 434bed5 commit f17b155

File tree

1 file changed

+20
-11
lines changed

1 file changed

+20
-11
lines changed

drivers/i3c/i3c_shell.c

+20-11
Original file line numberDiff line numberDiff line change
@@ -1926,9 +1926,9 @@ static int cmd_i3c_i2c_scan(const struct shell *sh, size_t argc, char **argv)
19261926
return 0;
19271927
}
19281928

1929-
#ifdef I3C_USE_IBI
1929+
#ifdef CONFIG_I3C_USE_IBI
19301930
/* i3c ibi hj <device> */
1931-
static void cmd_i3c_ibi_hj(const struct shell *sh, size_t argc, char **argv)
1931+
static int cmd_i3c_ibi_hj(const struct shell *sh, size_t argc, char **argv)
19321932
{
19331933
const struct device *dev;
19341934
struct i3c_ibi request;
@@ -1948,10 +1948,12 @@ static void cmd_i3c_ibi_hj(const struct shell *sh, size_t argc, char **argv)
19481948
}
19491949

19501950
shell_print(sh, "I3C: Issued IBI HJ");
1951+
1952+
return 0;
19511953
}
19521954

19531955
/* i3c ibi cr <device> */
1954-
static void cmd_i3c_ibi_cr(const struct shell *sh, size_t argc, char **argv)
1956+
static int cmd_i3c_ibi_cr(const struct shell *sh, size_t argc, char **argv)
19551957
{
19561958
const struct device *dev;
19571959
struct i3c_ibi request;
@@ -1971,28 +1973,29 @@ static void cmd_i3c_ibi_cr(const struct shell *sh, size_t argc, char **argv)
19711973
}
19721974

19731975
shell_print(sh, "I3C: Issued IBI CR");
1976+
1977+
return 0;
19741978
}
19751979

19761980
/* i3c ibi tir <device> [<bytes>]*/
1977-
static void cmd_i3c_ibi_tir(const struct shell *sh, size_t argc, char **argv)
1981+
static int cmd_i3c_ibi_tir(const struct shell *sh, size_t argc, char **argv)
19781982
{
19791983
const struct device *dev;
19801984
struct i3c_ibi request;
19811985
uint16_t data_length;
1982-
char **data;
19831986
uint8_t buf[MAX_I3C_BYTES];
19841987
int ret;
1988+
uint8_t i;
19851989

19861990
dev = device_get_binding(argv[ARGV_DEV]);
19871991
if (!dev) {
19881992
shell_error(sh, "I3C: Device driver %s not found.", argv[ARGV_DEV]);
19891993
return -ENODEV;
19901994
}
19911995

1992-
data = argv[3];
19931996
data_length = argc - 3;
19941997
for (i = 0; i < data_length; i++) {
1995-
buf[i] = (uint8_t)strtol(data[i], NULL, 16);
1998+
buf[i] = (uint8_t)strtol(argv[3 + i], NULL, 16);
19961999
}
19972000

19982001
request.ibi_type = I3C_IBI_TARGET_INTR;
@@ -2006,10 +2009,12 @@ static void cmd_i3c_ibi_tir(const struct shell *sh, size_t argc, char **argv)
20062009
}
20072010

20082011
shell_print(sh, "I3C: Issued IBI TIR");
2012+
2013+
return 0;
20092014
}
20102015

20112016
/* i3c ibi enable <device> <target> */
2012-
static void cmd_i3c_ibi_enable(const struct shell *sh, size_t argc, char **argv)
2017+
static int cmd_i3c_ibi_enable(const struct shell *sh, size_t argc, char **argv)
20132018
{
20142019
const struct device *dev, *tdev;
20152020
struct i3c_device_desc *desc;
@@ -2027,10 +2032,12 @@ static void cmd_i3c_ibi_enable(const struct shell *sh, size_t argc, char **argv)
20272032
}
20282033

20292034
shell_print(sh, "I3C: Enabled IBI");
2035+
2036+
return 0;
20302037
}
20312038

20322039
/* i3c ibi disable <device> <target> */
2033-
static void cmd_i3c_ibi_disable(const struct shell *sh, size_t argc, char **argv)
2040+
static int cmd_i3c_ibi_disable(const struct shell *sh, size_t argc, char **argv)
20342041
{
20352042
const struct device *dev, *tdev;
20362043
struct i3c_device_desc *desc;
@@ -2048,6 +2055,8 @@ static void cmd_i3c_ibi_disable(const struct shell *sh, size_t argc, char **argv
20482055
}
20492056

20502057
shell_print(sh, "I3C: Disabled IBI");
2058+
2059+
return 0;
20512060
}
20522061
#endif
20532062

@@ -2093,7 +2102,7 @@ static void i3c_device_name_get(size_t idx, struct shell_static_entry *entry)
20932102

20942103
SHELL_DYNAMIC_CMD_CREATE(dsub_i3c_device_name, i3c_device_name_get);
20952104

2096-
#ifdef I3C_USE_IBI
2105+
#ifdef CONFIG_I3C_USE_IBI
20972106
/* L2 I3C IBI Shell Commands*/
20982107
SHELL_STATIC_SUBCMD_SET_CREATE(
20992108
sub_i3c_ibi_cmds,
@@ -2362,7 +2371,7 @@ SHELL_STATIC_SUBCMD_SET_CREATE(
23622371
"Send I3C HDR\n"
23632372
"Usage: hdr <sub cmd>",
23642373
NULL, 3, 0),
2365-
#ifdef I3C_USE_IBI
2374+
#ifdef CONFIG_I3C_USE_IBI
23662375
SHELL_CMD_ARG(ibi, &sub_i3c_ibi_cmds,
23672376
"Send I3C IBI\n"
23682377
"Usage: ibi <sub cmd>",

0 commit comments

Comments
 (0)