From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758012AbcJQUU2 (ORCPT ); Mon, 17 Oct 2016 16:20:28 -0400 Received: from up.free-electrons.com ([163.172.77.33]:39992 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755694AbcJQUUI (ORCPT ); Mon, 17 Oct 2016 16:20:08 -0400 Date: Mon, 17 Oct 2016 22:20:00 +0200 From: Boris Brezillon To: Javier Martinez Canillas Cc: linux-kernel@vger.kernel.org, Tony Lindgren , Brian Norris , Richard Weinberger , linux-mtd@lists.infradead.org, David Woodhouse Subject: Re: [PATCH] mtd: nand: omap2: Fix module autoload Message-ID: <20161017222000.79b8fe04@bbrezillon> In-Reply-To: <1476721177-3425-1-git-send-email-javier@osg.samsung.com> References: <1476721177-3425-1-git-send-email-javier@osg.samsung.com> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 17 Oct 2016 13:19:37 -0300 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 module alias information using the MODULE_DEVICE_TABLE() macro. > > Before this patch: > > $ modinfo drivers/mtd/nand/omap2_nand.ko | grep alias > alias: platform:omap2-nand > > After this patch: > > $ modinfo drivers/mtd/nand/omap2_nand.ko | grep alias > alias: platform:omap2-nand > alias: of:N*T*Cti,omap2-nandC* > alias: of:N*T*Cti,omap2-nand > > Signed-off-by: Javier Martinez Canillas Applied. Thanks, Boris > > --- > > drivers/mtd/nand/omap2.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c > index 5513bfd9cdc9..0934c3b3f70e 100644 > --- a/drivers/mtd/nand/omap2.c > +++ b/drivers/mtd/nand/omap2.c > @@ -2197,6 +2197,7 @@ static const struct of_device_id omap_nand_ids[] = { > { .compatible = "ti,omap2-nand", }, > {}, > }; > +MODULE_DEVICE_TABLE(of, omap_nand_ids); > > static struct platform_driver omap_nand_driver = { > .probe = omap_nand_probe,