[PATCH] power: supply: cw2015_battery: add missing MODULE_DEVICE_TABLE()

Pengpeng Hou posted 1 patch 3 hours ago
drivers/power/supply/cw2015_battery.c | 1 +
1 file changed, 1 insertion(+)
[PATCH] power: supply: cw2015_battery: add missing MODULE_DEVICE_TABLE()
Posted by Pengpeng Hou 3 hours ago
The driver has a match table for the i2c bus wired into its driver
structure, but the table is not exported with MODULE_DEVICE_TABLE().

Add the missing MODULE_DEVICE_TABLE() entry so module alias information
is generated for automatic module loading.

This is a source-level fix.  It does not claim dynamic hardware
reproduction; the evidence is the driver-owned match table, its use by
the driver registration structure, and the missing module alias
publication.

Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
---
 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 a05dcc4a48f2..ab8298485fab 100644
--- a/drivers/power/supply/cw2015_battery.c
+++ b/drivers/power/supply/cw2015_battery.c
@@ -735,6 +735,7 @@ static const struct i2c_device_id cw_bat_id_table[] = {
 	{ "cw2015" },
 	{ }
 };
+MODULE_DEVICE_TABLE(i2c, cw_bat_id_table);
 
 static const struct of_device_id cw2015_of_match[] = {
 	{ .compatible = "cellwise,cw2015" },
-- 
2.53.0