From: Guenter Roeck <linux@roeck-us.net>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Yueyao Zhu <yueyao.zhu@gmail.com>,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
Javier Martinez Canillas <javier@dowhile0.org>,
Guenter Roeck <linux@roeck-us.net>
Subject: [PATCH 2/7] staging: typec: fusb302: Fix module autoload
Date: Tue, 9 May 2017 09:04:54 -0700 [thread overview]
Message-ID: <1494345899-14283-2-git-send-email-linux@roeck-us.net> (raw)
In-Reply-To: <1494345899-14283-1-git-send-email-linux@roeck-us.net>
From: Javier Martinez Canillas <javier@dowhile0.org>
If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.
Export the OF and I2C device ID table entries as module aliases, using the
MODULE_DEVICE_TABLE() macro.
Before this patch:
$ modinfo drivers/staging/typec/fusb302/fusb302.ko | grep alias
$
After this patch:
$ modinfo drivers/staging/typec/fusb302/fusb302.ko | grep alias
alias: of:N*T*Cfcs,fusb302C*
alias: of:N*T*Cfcs,fusb302
alias: i2c:typec_fusb302
Signed-off-by: Javier Martinez Canillas <javier@dowhile0.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
drivers/staging/typec/fusb302/fusb302.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/staging/typec/fusb302/fusb302.c b/drivers/staging/typec/fusb302/fusb302.c
index 2cee9a952c9b..aa460f93a293 100644
--- a/drivers/staging/typec/fusb302/fusb302.c
+++ b/drivers/staging/typec/fusb302/fusb302.c
@@ -1787,11 +1787,13 @@ static const struct of_device_id fusb302_dt_match[] = {
{.compatible = "fcs,fusb302"},
{},
};
+MODULE_DEVICE_TABLE(of, fusb302_dt_match);
static const struct i2c_device_id fusb302_i2c_device_id[] = {
{"typec_fusb302", 0},
{},
};
+MODULE_DEVICE_TABLE(i2c, fusb302_i2c_device_id);
static const struct dev_pm_ops fusb302_pm_ops = {
.suspend = fusb302_pm_suspend,
--
2.7.4
next prev parent reply other threads:[~2017-05-09 16:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-09 16:04 [PATCH 1/7] staging: typec: tcpci: declare private structure as static Guenter Roeck
2017-05-09 16:04 ` Guenter Roeck [this message]
2017-05-09 16:04 ` [PATCH 3/7] staging: typec: fusb302: Fix chip->vbus_present init value Guenter Roeck
2017-05-09 16:04 ` [PATCH 4/7] staging: typec: tcpm: Drop duplicate PD messages Guenter Roeck
2017-05-09 16:04 ` [PATCH 5/7] staging: typec: tcpm: Set correct flags in PD request messages Guenter Roeck
2017-05-09 16:04 ` [PATCH 6/7] staging: typec: tcpm: Respond to Discover Identity commands Guenter Roeck
2017-05-09 16:04 ` [PATCH 7/7] staging: typec: tcpm: Fix Port Power Role field in PS_RDY messages Guenter Roeck
2017-05-09 17:46 ` [PATCH 1/7] staging: typec: tcpci: declare private structure as static Greg Kroah-Hartman
2017-05-09 21:13 ` Guenter Roeck
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=1494345899-14283-2-git-send-email-linux@roeck-us.net \
--to=linux@roeck-us.net \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=javier@dowhile0.org \
--cc=linux-kernel@vger.kernel.org \
--cc=yueyao.zhu@gmail.com \
/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
all inboxes | Powered by JetHome®