aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJavier Martinez Canillas <javier@dowhile0.org>2017-05-09 12:04:54 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-05-15 05:23:55 -0400
commit227383f8c28ea9e53d958801790d0e2e8f985d08 (patch)
tree8f80ec6d0163ffef8ca8e19f92ff94fb193fa01d
parentc6a9d3eaee508f53ec4f777035522565ed567692 (diff)
staging: typec: fusb302: Fix module autoload
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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/typec/fusb302/fusb302.c2
1 files changed, 2 insertions, 0 deletions
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[] = {
1787 {.compatible = "fcs,fusb302"}, 1787 {.compatible = "fcs,fusb302"},
1788 {}, 1788 {},
1789}; 1789};
1790MODULE_DEVICE_TABLE(of, fusb302_dt_match);
1790 1791
1791static const struct i2c_device_id fusb302_i2c_device_id[] = { 1792static const struct i2c_device_id fusb302_i2c_device_id[] = {
1792 {"typec_fusb302", 0}, 1793 {"typec_fusb302", 0},
1793 {}, 1794 {},
1794}; 1795};
1796MODULE_DEVICE_TABLE(i2c, fusb302_i2c_device_id);
1795 1797
1796static const struct dev_pm_ops fusb302_pm_ops = { 1798static const struct dev_pm_ops fusb302_pm_ops = {
1797 .suspend = fusb302_pm_suspend, 1799 .suspend = fusb302_pm_suspend,