2016-10-17 15:44:38

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 0/5] [media] Fix module autoload for media platform drivers

Hello Mauro,

I noticed that module autoload won't be working in a bunch of media
platform drivers because the module alias information is not filled
in the modules. This patch series contains the fixes for them.

Best regards,
Javier


Javier Martinez Canillas (5):
[media] v4l: vsp1: Fix module autoload for OF registration
[media] v4l: rcar-fcp: Fix module autoload for OF registration
[media] rc: meson-ir: Fix module autoload
[media] s5p-cec: Fix module autoload
[media] st-cec: Fix module autoload

drivers/media/platform/rcar-fcp.c | 1 +
drivers/media/platform/vsp1/vsp1_drv.c | 1 +
drivers/media/rc/meson-ir.c | 1 +
drivers/staging/media/s5p-cec/s5p_cec.c | 1 +
drivers/staging/media/st-cec/stih-cec.c | 1 +
5 files changed, 5 insertions(+)

--
2.7.4


2016-10-17 15:44:43

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 1/5] [media] v4l: vsp1: Fix module autoload for OF registration

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/media/platform/vsp1/vsp1.ko | grep alias
alias: vsp1

After this patch:

$ modinfo drivers/media/platform/vsp1/vsp1.ko | grep alias
alias: vsp1
alias: of:N*T*Crenesas,vsp2C*
alias: of:N*T*Crenesas,vsp2
alias: of:N*T*Crenesas,vsp1C*
alias: of:N*T*Crenesas,vsp1

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/media/platform/vsp1/vsp1_drv.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/media/platform/vsp1/vsp1_drv.c b/drivers/media/platform/vsp1/vsp1_drv.c
index 57c713a4e1df..aa237b48ad55 100644
--- a/drivers/media/platform/vsp1/vsp1_drv.c
+++ b/drivers/media/platform/vsp1/vsp1_drv.c
@@ -770,6 +770,7 @@ static const struct of_device_id vsp1_of_match[] = {
{ .compatible = "renesas,vsp2" },
{ },
};
+MODULE_DEVICE_TABLE(of, vsp1_of_match);

static struct platform_driver vsp1_platform_driver = {
.probe = vsp1_probe,
--
2.7.4

2016-10-17 15:44:53

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 2/5] [media] v4l: rcar-fcp: Fix module autoload for OF registration

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/media/platform/rcar-fcp.ko | grep alias
alias: rcar-fcp

After this patch:

$ modinfo drivers/media/platform/rcar-fcp.ko | grep alias
alias: rcar-fcp
alias: of:N*T*Crenesas,fcpvC*
alias: of:N*T*Crenesas,fcpv
alias: of:N*T*Crenesas,fcpfC*
alias: of:N*T*Crenesas,fcpf

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/media/platform/rcar-fcp.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/media/platform/rcar-fcp.c b/drivers/media/platform/rcar-fcp.c
index f3a3f31cdfa9..7146fc5ef168 100644
--- a/drivers/media/platform/rcar-fcp.c
+++ b/drivers/media/platform/rcar-fcp.c
@@ -169,6 +169,7 @@ static const struct of_device_id rcar_fcp_of_match[] = {
{ .compatible = "renesas,fcpv" },
{ },
};
+MODULE_DEVICE_TABLE(of, rcar_fcp_of_match);

static struct platform_driver rcar_fcp_platform_driver = {
.probe = rcar_fcp_probe,
--
2.7.4

2016-10-17 15:45:04

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 4/5] [media] s5p-cec: 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 module alias information using the MODULE_DEVICE_TABLE() macro.

Before this patch:

$ modinfo drivers/staging/media/s5p-cec/s5p-cec.ko | grep alias
$

After this patch:

$ modinfo drivers/staging/media/s5p-cec/s5p-cec.ko | grep alias
alias: of:N*T*Csamsung,s5p-cecC*
alias: of:N*T*Csamsung,s5p-cec

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/staging/media/s5p-cec/s5p_cec.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/staging/media/s5p-cec/s5p_cec.c b/drivers/staging/media/s5p-cec/s5p_cec.c
index 1780a08b73c9..4e41f72dbfaa 100644
--- a/drivers/staging/media/s5p-cec/s5p_cec.c
+++ b/drivers/staging/media/s5p-cec/s5p_cec.c
@@ -263,6 +263,7 @@ static const struct of_device_id s5p_cec_match[] = {
},
{},
};
+MODULE_DEVICE_TABLE(of, s5p_cec_match);

static struct platform_driver s5p_cec_pdrv = {
.probe = s5p_cec_probe,
--
2.7.4

2016-10-17 15:45:32

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 5/5] [media] st-cec: 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 module alias information using the MODULE_DEVICE_TABLE() macro.

Before this patch:

$ modinfo drivers/staging/media//st-cec/stih-cec.ko | grep alias
$

After this patch:

$ modinfo drivers/staging/media//st-cec/stih-cec.ko | grep alias
alias: of:N*T*Cst,stih-cecC*
alias: of:N*T*Cst,stih-cec

Signed-off-by: Javier Martinez Canillas <[email protected]>

---

drivers/staging/media/st-cec/stih-cec.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/staging/media/st-cec/stih-cec.c b/drivers/staging/media/st-cec/stih-cec.c
index 214344866a6b..19d3ff30c8f8 100644
--- a/drivers/staging/media/st-cec/stih-cec.c
+++ b/drivers/staging/media/st-cec/stih-cec.c
@@ -363,6 +363,7 @@ static const struct of_device_id stih_cec_match[] = {
},
{},
};
+MODULE_DEVICE_TABLE(of, stih_cec_match);

static struct platform_driver stih_cec_pdrv = {
.probe = stih_cec_probe,
--
2.7.4

2016-10-17 15:45:57

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 3/5] [media] rc: meson-ir: 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 module alias information using the MODULE_DEVICE_TABLE() macro.

Before this patch:

$ modinfo drivers/media/rc/meson-ir.ko | grep alias
$

After this patch:

$ modinfo drivers/media/rc/meson-ir.ko | grep alias
alias: of:N*T*Camlogic,meson-gxbb-irC*
alias: of:N*T*Camlogic,meson-gxbb-ir
alias: of:N*T*Camlogic,meson8b-irC*
alias: of:N*T*Camlogic,meson8b-ir
alias: of:N*T*Camlogic,meson6-irC*
alias: of:N*T*Camlogic,meson6-ir

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/media/rc/meson-ir.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/media/rc/meson-ir.c b/drivers/media/rc/meson-ir.c
index 003fff07ade2..7eb3f4f1ddcd 100644
--- a/drivers/media/rc/meson-ir.c
+++ b/drivers/media/rc/meson-ir.c
@@ -218,6 +218,7 @@ static const struct of_device_id meson_ir_match[] = {
{ .compatible = "amlogic,meson-gxbb-ir" },
{ },
};
+MODULE_DEVICE_TABLE(of, meson_ir_match);

static struct platform_driver meson_ir_driver = {
.probe = meson_ir_probe,
--
2.7.4

2016-10-17 16:08:28

by Laurent Pinchart

[permalink] [raw]
Subject: Re: [PATCH 1/5] [media] v4l: vsp1: Fix module autoload for OF registration

Hi Javier,

Thank you for the patch.

On Monday 17 Oct 2016 12:44:08 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/media/platform/vsp1/vsp1.ko | grep alias
> alias: vsp1
>
> After this patch:
>
> $ modinfo drivers/media/platform/vsp1/vsp1.ko | grep alias
> alias: vsp1
> alias: of:N*T*Crenesas,vsp2C*
> alias: of:N*T*Crenesas,vsp2
> alias: of:N*T*Crenesas,vsp1C*
> alias: of:N*T*Crenesas,vsp1
>
> Signed-off-by: Javier Martinez Canillas <[email protected]>

Reviewed-by: Laurent Pinchart <[email protected]>

> ---
>
> drivers/media/platform/vsp1/vsp1_drv.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/media/platform/vsp1/vsp1_drv.c
> b/drivers/media/platform/vsp1/vsp1_drv.c index 57c713a4e1df..aa237b48ad55
> 100644
> --- a/drivers/media/platform/vsp1/vsp1_drv.c
> +++ b/drivers/media/platform/vsp1/vsp1_drv.c
> @@ -770,6 +770,7 @@ static const struct of_device_id vsp1_of_match[] = {
> { .compatible = "renesas,vsp2" },
> { },
> };
> +MODULE_DEVICE_TABLE(of, vsp1_of_match);
>
> static struct platform_driver vsp1_platform_driver = {
> .probe = vsp1_probe,

--
Regards,

Laurent Pinchart

2016-10-17 16:08:45

by Laurent Pinchart

[permalink] [raw]
Subject: Re: [PATCH 2/5] [media] v4l: rcar-fcp: Fix module autoload for OF registration

Hi Javier,

Thank you for the patch.

On Monday 17 Oct 2016 12:44:09 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/media/platform/rcar-fcp.ko | grep alias
> alias: rcar-fcp
>
> After this patch:
>
> $ modinfo drivers/media/platform/rcar-fcp.ko | grep alias
> alias: rcar-fcp
> alias: of:N*T*Crenesas,fcpvC*
> alias: of:N*T*Crenesas,fcpv
> alias: of:N*T*Crenesas,fcpfC*
> alias: of:N*T*Crenesas,fcpf
>
> Signed-off-by: Javier Martinez Canillas <[email protected]>

Reviewed-by: Laurent Pinchart <[email protected]>

> ---
>
> drivers/media/platform/rcar-fcp.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/media/platform/rcar-fcp.c
> b/drivers/media/platform/rcar-fcp.c index f3a3f31cdfa9..7146fc5ef168 100644
> --- a/drivers/media/platform/rcar-fcp.c
> +++ b/drivers/media/platform/rcar-fcp.c
> @@ -169,6 +169,7 @@ static const struct of_device_id rcar_fcp_of_match[] = {
> { .compatible = "renesas,fcpv" },
> { },
> };
> +MODULE_DEVICE_TABLE(of, rcar_fcp_of_match);
>
> static struct platform_driver rcar_fcp_platform_driver = {
> .probe = rcar_fcp_probe,

--
Regards,

Laurent Pinchart

2016-10-17 16:40:40

by Kevin Hilman

[permalink] [raw]
Subject: Re: [PATCH 3/5] [media] rc: meson-ir: Fix module autoload

On Mon, Oct 17, 2016 at 8:44 AM, Javier Martinez Canillas
<[email protected]> 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/media/rc/meson-ir.ko | grep alias
> $
>
> After this patch:
>
> $ modinfo drivers/media/rc/meson-ir.ko | grep alias
> alias: of:N*T*Camlogic,meson-gxbb-irC*
> alias: of:N*T*Camlogic,meson-gxbb-ir
> alias: of:N*T*Camlogic,meson8b-irC*
> alias: of:N*T*Camlogic,meson8b-ir
> alias: of:N*T*Camlogic,meson6-irC*
> alias: of:N*T*Camlogic,meson6-ir
>
> Signed-off-by: Javier Martinez Canillas <[email protected]>

Acked-by: Kevin Hilman <[email protected]>

2016-10-18 07:53:02

by Benjamin Gaignard

[permalink] [raw]
Subject: Re: [PATCH 5/5] [media] st-cec: Fix module autoload

Thanks,

Acked-by: Benjamin Gaignard <[email protected]>

2016-10-17 17:44 GMT+02:00 Javier Martinez Canillas <[email protected]>:
> 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/staging/media//st-cec/stih-cec.ko | grep alias
> $
>
> After this patch:
>
> $ modinfo drivers/staging/media//st-cec/stih-cec.ko | grep alias
> alias: of:N*T*Cst,stih-cecC*
> alias: of:N*T*Cst,stih-cec
>
> Signed-off-by: Javier Martinez Canillas <[email protected]>
>
> ---
>
> drivers/staging/media/st-cec/stih-cec.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/staging/media/st-cec/stih-cec.c b/drivers/staging/media/st-cec/stih-cec.c
> index 214344866a6b..19d3ff30c8f8 100644
> --- a/drivers/staging/media/st-cec/stih-cec.c
> +++ b/drivers/staging/media/st-cec/stih-cec.c
> @@ -363,6 +363,7 @@ static const struct of_device_id stih_cec_match[] = {
> },
> {},
> };
> +MODULE_DEVICE_TABLE(of, stih_cec_match);
>
> static struct platform_driver stih_cec_pdrv = {
> .probe = stih_cec_probe,
> --
> 2.7.4
>



--
Benjamin Gaignard

Graphic Study Group

Linaro.org │ Open source software for ARM SoCs

Follow Linaro: Facebook | Twitter | Blog