public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Javier Martinez Canillas <javier@osg.samsung.com>
To: linux-kernel@vger.kernel.org
Cc: Javier Martinez Canillas <javier@osg.samsung.com>,
	Sebastian Reichel <sre@kernel.org>,
	linux-pm@vger.kernel.org
Subject: [PATCH] power: supply: max14656: Export I2C and OF device ID as module aliases
Date: Wed, 25 Jan 2017 10:38:55 -0300	[thread overview]
Message-ID: <1485351535-21066-1-git-send-email-javier@osg.samsung.com> (raw)

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

             reply	other threads:[~2017-01-25 13:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-25 13:38 Javier Martinez Canillas [this message]
2017-01-29 15:43 ` [PATCH] power: supply: max14656: Export I2C and OF device ID as module aliases Sebastian Reichel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1485351535-21066-1-git-send-email-javier@osg.samsung.com \
    --to=javier@osg.samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=sre@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox