Skip to content

Commit 9d34d5c

Browse files
fabiobaltierikartben
authored andcommitted
i2c_shell: only include i3c if I3C=y
Only lookup for i3c devices if I3C=y, fixes a build error: zephyr/drivers/i2c/i2c_shell.c: In function 'device_is_i2c': zephyr/drivers/i2c/i2c_shell.c:341:43: error: array type has incomplete element type 'struct i3c_driver_api' 341 | return DEVICE_API_IS(i2c, dev) || DEVICE_API_IS(i3c, dev); Signed-off-by: Fabio Baltieri <[email protected]>
1 parent 6694c53 commit 9d34d5c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/i2c/i2c_shell.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,11 @@ static int cmd_i2c_speed(const struct shell *shell_ctx, size_t argc, char **argv
338338

339339
static bool device_is_i2c(const struct device *dev)
340340
{
341+
#ifdef CONFIG_I3C
341342
return DEVICE_API_IS(i2c, dev) || DEVICE_API_IS(i3c, dev);
343+
#else
344+
return DEVICE_API_IS(i2c, dev);
345+
#endif
342346
}
343347

344348
static void device_name_get(size_t idx, struct shell_static_entry *entry)

0 commit comments

Comments
 (0)