[PATCH v2] power: supply: cw2015_battery: export the I2C device table

Pengpeng Hou <[email protected]>
Newsgroups org.kernel.vger.linux-pm,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
The I2C device ID table is used by the driver but is not exported
with MODULE_DEVICE_TABLE(). As a result, I2C module alias information is
not generated for automatic loading.

Export the existing table.

Fixes: b4c7715c10c1 ("power: supply: add CellWise cw2015 fuel gauge driver")
Assisted-by: Codex:gpt-5
Signed-off-by: Pengpeng Hou <[email protected]>
---
Changes since v1: https://lore.kernel.org/all/[email protected]/
- rebase on current CW2015 sources
- add the coding-assistant disclosure

The driver-owned I2C table and module alias publication were reviewed
statically; no CW2015 hardware test was performed.

 drivers/power/supply/cw2015_battery.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/power/supply/cw2015_battery.c b/drivers/power/supply/cw2015_battery.c
index 7496295d2948..1bcb60cf763d 100644
--- a/drivers/power/supply/cw2015_battery.c
+++ b/drivers/power/supply/cw2015_battery.c
@@ -736,6 +736,7 @@ static const struct i2c_device_id cw_bat_id_table[] = {
 	{ .name = "cw2015" },
 	{ }
 };
+MODULE_DEVICE_TABLE(i2c, cw_bat_id_table);
 
 static const struct of_device_id cw2015_of_match[] = {
 	{ .compatible = "cellwise,cw2015" },
-- 
2.50.1 (Apple Git-155)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.