<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rt-thread.git/components/drivers/i2c/dev_i2c_bus.c, branch copilot/fix-format-string-injection</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/rt-thread.git/atom/components/drivers/i2c/dev_i2c_bus.c?h=copilot%2Ffix-format-string-injection</id>
<link rel='self' href='http://cgit.235523.xyz/rt-thread.git/atom/components/drivers/i2c/dev_i2c_bus.c?h=copilot%2Ffix-format-string-injection'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/rt-thread.git/'/>
<updated>2026-01-20T14:05:28Z</updated>
<entry>
<title>[drivers] Fix OFW bus conflict and prevent duplicate device creation</title>
<updated>2026-01-20T14:05:28Z</updated>
<author>
<name>lhxj</name>
<email>2743257167@qq.com</email>
</author>
<published>2025-12-25T09:56:52Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/rt-thread.git/commit/?id=7641ef68855601bc73252546bf41a96d6078444e'/>
<id>urn:sha1:7641ef68855601bc73252546bf41a96d6078444e</id>
<content type='text'>
Problem:
When enumerating device tree nodes, platform bus and native buses (I2C/SPI)
may create duplicate devices for the same OFW node, causing cross-bus conflicts.
This triggers assertion failure '(dev-&gt;bus != new_bus)' in
rt_bus_reload_driver_device() during boot on minimal DM-enabled systems.

Root Cause:
1. Platform bus tries to reload devices that already belong to other buses
   by calling rt_bus_reload_driver_device(dev-&gt;bus, dev), which violates
   the API contract (requires dev-&gt;bus != new_bus).
2. Native buses (I2C/SPI) do not mark OFW nodes as occupied, so platform
   bus creates duplicate platform devices for I2C/SPI client nodes.

Solution:
1. components/drivers/core/platform_ofw.c: Return RT_EOK when np-&gt;dev exists,
   letting the native bus handle device lifecycle instead of cross-bus reload.
2. components/drivers/i2c/dev_i2c_bus.c: Mark i2c_client_np-&gt;dev during scan
   to prevent platform bus from duplicating I2C client devices.
3. components/drivers/spi/dev_spi_bus.c: Mark spi_dev_np-&gt;dev during scan
   to prevent platform bus from duplicating SPI devices.

Tested on Spacemit K1 RISC-V platform with minimal DM configuration.

Signed-off-by: lhxj &lt;2743257167@qq.com&gt;
</content>
</entry>
<entry>
<title>[DM/I2C] Update I2C for DM</title>
<updated>2025-12-04T08:00:13Z</updated>
<author>
<name>GuEe-GUI</name>
<email>2991707448@qq.com</email>
</author>
<published>2025-12-01T08:46:17Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/rt-thread.git/commit/?id=798c84647c7a8959fb0d50a97f63e7e74c0e7119'/>
<id>urn:sha1:798c84647c7a8959fb0d50a97f63e7e74c0e7119</id>
<content type='text'>
1. Add get id match data API.
2. Set I2C device name default before adding to bus.
3. Add Kconfig import for DM.

Signed-off-by: GuEe-GUI &lt;2991707448@qq.com&gt;
</content>
</entry>
<entry>
<title>[device] add dev_ prefix for file names</title>
<updated>2024-08-23T22:15:09Z</updated>
<author>
<name>CXSforHPU</name>
<email>156403074+CXSforHPU@users.noreply.github.com</email>
</author>
<published>2024-08-23T22:15:09Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/rt-thread.git/commit/?id=416ec66380d89e2d3ff8ea37fd748ccc77130ab2'/>
<id>urn:sha1:416ec66380d89e2d3ff8ea37fd748ccc77130ab2</id>
<content type='text'>
</content>
</entry>
</feed>
