瀏覽代碼

power: supply: max14656: Export I2C and OF device ID as module aliases

If the driver is built as a module, I2C module alias information is not
filled so the module won't be autoloaded. Export the I2C and OF devices
ID to the module by using the MODULE_DEVICE_TABLE() macro.

Before this patch:

$ modinfo drivers/power/supply/max14656_charger_detector.ko | grep alias
$

After this patch:

$ modinfo drivers/power/supply/max14656_charger_detector.ko | grep alias
alias:          i2c:max14656
alias:          of:N*T*Cmaxim,max14656C*
alias:          of:N*T*Cmaxim,max14656

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Javier Martinez Canillas 8 年之前
父節點
當前提交
166e8dbd63
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      drivers/power/supply/max14656_charger_detector.c

+ 2 - 0
drivers/power/supply/max14656_charger_detector.c

@@ -305,11 +305,13 @@ static const struct i2c_device_id max14656_id[] = {
 	{ "max14656", 0 },
 	{}
 };
+MODULE_DEVICE_TABLE(i2c, max14656_id);
 
 static const struct of_device_id max14656_match_table[] = {
 	{ .compatible = "maxim,max14656", },
 	{}
 };
+MODULE_DEVICE_TABLE(of, max14656_match_table);
 
 static struct i2c_driver max14656_i2c_driver = {
 	.driver = {