summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGUI <[email protected]>2025-03-01 10:29:18 +0800
committerRbb666 <[email protected]>2025-03-10 22:47:03 +0800
commit4f4012aebaa5c2ab550dbc069362d92ad4f67daa (patch)
treeecf2eca5edfbbc8f863acdaecba8b01c99e19a04
parenta3ded3bc4ca56d0e292870197bb3c2fab9b90682 (diff)
Fixup device rename by chip_select
`chip_select` is array now, should use index of value.
-rw-r--r--components/drivers/spi/dev_spi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/components/drivers/spi/dev_spi.c b/components/drivers/spi/dev_spi.c
index 3f55fd0eb0..e0cd5f3bef 100644
--- a/components/drivers/spi/dev_spi.c
+++ b/components/drivers/spi/dev_spi.c
@@ -181,7 +181,7 @@ static rt_err_t spidev_probe(struct rt_spi_device *spi_dev)
}
bus_name = rt_dm_dev_get_name(&spi_dev->bus->parent);
- rt_dm_dev_set_name(dev, "%s_%d", bus_name, spi_dev->chip_select);
+ rt_dm_dev_set_name(dev, "%s_%d", bus_name, spi_dev->chip_select[0]);
return RT_EOK;
}