Skip to content

Commit 5a4d1f7

Browse files
galakcarlescufi
authored andcommitted
i2c: shell: Remove prefix filtering of device list
The I2C shell would filter the list of devices it knows about to ones that have a device name that starts with "I2C_". It was the case that the majority of I2C bus controller devices happened to be named with the "I2C_" prefix, however there is no guarantee that is the case. With the remove of label properties from the devicetree this is even more true. For now remove the prefix filter and just return the full list of devices. Signed-off-by: Kumar Gala <[email protected]>
1 parent 527e4e8 commit 5a4d1f7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/i2c/i2c_shell.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include <zephyr/logging/log.h>
1515
LOG_MODULE_REGISTER(i2c_shell, CONFIG_LOG_DEFAULT_LEVEL);
1616

17-
#define I2C_DEVICE_PREFIX "I2C_"
1817
#define MAX_BYTES_FOR_REGISTER_INDEX 4
1918
#define ARGV_DEV 1
2019
#define ARGV_ADDR 2
@@ -277,7 +276,7 @@ SHELL_DYNAMIC_CMD_CREATE(dsub_device_name, device_name_get);
277276

278277
static void device_name_get(size_t idx, struct shell_static_entry *entry)
279278
{
280-
const struct device *dev = shell_device_lookup(idx, I2C_DEVICE_PREFIX);
279+
const struct device *dev = shell_device_lookup(idx, NULL);
281280

282281
entry->syntax = (dev != NULL) ? dev->name : NULL;
283282
entry->handler = NULL;

0 commit comments

Comments
 (0)