From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754803AbdEDSGd (ORCPT ); Thu, 4 May 2017 14:06:33 -0400 Received: from bh-25.webhostbox.net ([208.91.199.152]:44572 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751878AbdEDSG0 (ORCPT ); Thu, 4 May 2017 14:06:26 -0400 Date: Thu, 4 May 2017 11:06:23 -0700 From: Guenter Roeck To: Javier Martinez Canillas Cc: linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, Yueyao Zhu , Greg Kroah-Hartman Subject: Re: [PATCH] staging: typec: fusb302: Fix module autoload Message-ID: <20170504180623.GA13210@roeck-us.net> References: <20170504063345.21320-1-javier@dowhile0.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170504063345.21320-1-javier@dowhile0.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: guenter@roeck-us.net X-Authenticated-Sender: bh-25.webhostbox.net: guenter@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 04, 2017 at 08:33:45AM +0200, Javier Martinez Canillas wrote: > 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 Thanks, queued. Guenter > --- > > 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.9.3 >