From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752251AbdHIK3x (ORCPT ); Wed, 9 Aug 2017 06:29:53 -0400 Received: from galahad.ideasonboard.com ([185.26.127.97]:53447 "EHLO galahad.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751862AbdHIK3w (ORCPT ); Wed, 9 Aug 2017 06:29:52 -0400 Subject: Re: [PATCH] media: i2c: adv748x: Export I2C device table entries as module aliases To: Javier Martinez Canillas , linux-kernel@vger.kernel.org Cc: Mauro Carvalho Chehab , linux-media@vger.kernel.org References: <20170809093731.3572-1-javierm@redhat.com> From: Kieran Bingham Organization: Ideas on Board Message-ID: Date: Wed, 9 Aug 2017 11:29:47 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <20170809093731.3572-1-javierm@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Javier, Thankyou for the patch On 09/08/17 10:37, Javier Martinez Canillas wrote: > The I2C core always reports a MODALIAS of the form i2c: even if the > device was registered via OF, and the driver is only exporting the OF ID > table entries as module aliases. > > So if the driver is built as module, autoload won't work since udev/kmod > won't be able to match the registered OF device with its driver module. Good catch, and perhaps I should have known better :D I've only worked on this driver as a built-in so far :-) #BadExcuses > Before this patch: > > $ modinfo drivers/media/i2c/adv748x/adv748x.ko | grep alias > alias: of:N*T*Cadi,adv7482C* > alias: of:N*T*Cadi,adv7482 > alias: of:N*T*Cadi,adv7481C* > alias: of:N*T*Cadi,adv7481 > > After this patch: > > modinfo drivers/media/i2c/adv748x/adv748x.ko | grep alias > alias: of:N*T*Cadi,adv7482C* > alias: of:N*T*Cadi,adv7482 > alias: of:N*T*Cadi,adv7481C* > alias: of:N*T*Cadi,adv7481 > alias: i2c:adv7482 > alias: i2c:adv7481 > > Signed-off-by: Javier Martinez Canillas Reviewed-by: Kieran Bingham > --- > > drivers/media/i2c/adv748x/adv748x-core.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/media/i2c/adv748x/adv748x-core.c b/drivers/media/i2c/adv748x/adv748x-core.c > index aeb6ae80cb18..5ee14f2c2747 100644 > --- a/drivers/media/i2c/adv748x/adv748x-core.c > +++ b/drivers/media/i2c/adv748x/adv748x-core.c > @@ -807,6 +807,7 @@ static const struct i2c_device_id adv748x_id[] = { > { "adv7482", 0 }, > { }, > }; > +MODULE_DEVICE_TABLE(i2c, adv748x_id); > > static const struct of_device_id adv748x_of_table[] = { > { .compatible = "adi,adv7481", }, >