* [PATCH] mtd: nand: omap2: Fix module autoload
@ 2016-10-17 16:19 Javier Martinez Canillas
2016-10-17 20:20 ` Boris Brezillon
0 siblings, 1 reply; 2+ messages in thread
From: Javier Martinez Canillas @ 2016-10-17 16:19 UTC (permalink / raw)
To: linux-kernel
Cc: Tony Lindgren, Javier Martinez Canillas, Boris Brezillon,
Brian Norris, Richard Weinberger, linux-mtd, David Woodhouse
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 <javier@osg.samsung.com>
---
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,
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mtd: nand: omap2: Fix module autoload
2016-10-17 16:19 [PATCH] mtd: nand: omap2: Fix module autoload Javier Martinez Canillas
@ 2016-10-17 20:20 ` Boris Brezillon
0 siblings, 0 replies; 2+ messages in thread
From: Boris Brezillon @ 2016-10-17 20:20 UTC (permalink / raw)
To: Javier Martinez Canillas
Cc: linux-kernel, Tony Lindgren, Brian Norris, Richard Weinberger,
linux-mtd, David Woodhouse
On Mon, 17 Oct 2016 13:19:37 -0300
Javier Martinez Canillas <javier@osg.samsung.com> 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 <javier@osg.samsung.com>
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,
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-10-17 20:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-17 16:19 [PATCH] mtd: nand: omap2: Fix module autoload Javier Martinez Canillas
2016-10-17 20:20 ` Boris Brezillon
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.