RE: [PATCH] power_supply: Add MODULE_DEVICE_TABLE for lp8727charger

From: Kim, Milo
Date: Mon Jan 16 2012 - 00:07:55 EST


> Add MODULE_DEVICE_TABLE to setup modalias for lp8727.

Autoloading this module is not required.
The LP8727 includes a charger function with the micro/mini USB interface.
Charging a battery and detecting which cable is inserted, this kind of job must be started at the beginning of system boot.
So the lp8727 driver should be loaded before an user-space accesses this driver.

Thanks & BR
Milo -

-----Original Message-----
From: Axel Lin [mailto:axel.lin@xxxxxxxxx]
Sent: Thursday, January 12, 2012 9:45 PM
To: linux-kernel@xxxxxxxxxxxxxxx
Cc: Kim, Milo; Jeong, Daniel; Anton Vorontsov
Subject: [PATCH] power_supply: Add MODULE_DEVICE_TABLE for lp8727 charger

Add MODULE_DEVICE_TABLE to setup modalias for lp8727.
The i2c_device_id table is supposed to be zero-terminated.
Thus add a missing terminate entry for lp8727_ids.

Signed-off-by: Axel Lin <axel.lin@xxxxxxxxx>
---
drivers/power/lp8727_charger.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/power/lp8727_charger.c b/drivers/power/lp8727_charger.c
index b15b575..8e901c9 100644
--- a/drivers/power/lp8727_charger.c
+++ b/drivers/power/lp8727_charger.c
@@ -464,7 +464,9 @@ static int __devexit lp8727_remove(struct i2c_client *cl)

static const struct i2c_device_id lp8727_ids[] = {
{"lp8727", 0},
+ { },
};
+MODULE_DEVICE_TABLE(i2c, lp8727_ids);

static struct i2c_driver lp8727_driver = {
.driver = {
--
1.7.5.4



èº{.nÇ+‰·Ÿ®‰­†+%ŠËlzwm…ébëæìr¸›zX§»®w¥Š{ayºÊÚë,j­¢f£¢·hš‹àz¹®w¥¢¸ ¢·¦j:+v‰¨ŠwèjØm¶Ÿÿ¾«‘êçzZ+ƒùšŽŠÝj"ú!¶iO•æ¬z·švØ^¶m§ÿðà nÆàþY&—