Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1566591 > unrolled thread

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

Started byJavier Martinez Canillas <javier@osg.samsung.com>
First post2017-01-25 14:40 +0100
Last post2017-01-29 17:10 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] power: supply: max14656: Export I2C and OF device ID as module aliases Javier Martinez Canillas <javier@osg.samsung.com> - 2017-01-25 14:40 +0100
    Re: [PATCH] power: supply: max14656: Export I2C and OF device ID as  module aliases Sebastian Reichel <sre@kernel.org> - 2017-01-29 17:10 +0100

#1566591 — [PATCH] power: supply: max14656: Export I2C and OF device ID as module aliases

FromJavier Martinez Canillas <javier@osg.samsung.com>
Date2017-01-25 14:40 +0100
Subject[PATCH] power: supply: max14656: Export I2C and OF device ID as module aliases
Message-ID<t3vXQ-2l3-9@gated-at.bofh.it>
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>
---

 drivers/power/supply/max14656_charger_detector.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/power/supply/max14656_charger_detector.c b/drivers/power/supply/max14656_charger_detector.c
index 80f8e5c1b4ec..b91b1d2999dc 100644
--- a/drivers/power/supply/max14656_charger_detector.c
+++ b/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 = {
-- 
2.7.4

[toc] | [next] | [standalone]


#1569223 — Re: [PATCH] power: supply: max14656: Export I2C and OF device ID as module aliases

FromSebastian Reichel <sre@kernel.org>
Date2017-01-29 17:10 +0100
SubjectRe: [PATCH] power: supply: max14656: Export I2C and OF device ID as module aliases
Message-ID<t50db-JO-15@gated-at.bofh.it>
In reply to#1566591

[Multipart message — attachments visible in raw view] — view raw

Hi Javier,

On Wed, Jan 25, 2017 at 10:38:55AM -0300, Javier Martinez Canillas wrote:
> 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>

Thanks, queued into power-supply's for-next.

-- Sebastian

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web