Skip to contentSkip to conversation

pinctrl: imx21: include linux/module.h

PATCH In review Arnd Bergmann 3 participants 5 messages Jul 6, 2016

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pinctrl: imx21: include linux/module.h

The pinctrl driver includes a device table, but the macro used for declaring it is declared in a header that is not visible here:

drivers/pinctrl/freescale/pinctrl-imx21.c:328:1: error: data definition has no type or storage class [-Werror]
MODULE_DEVICE_TABLE(of, imx21_pinctrl_of_match);

This adds the missing include.

Fixes e2756baa4217 ("pinctrl: imx21: make it explicitly non-modular")
---
 drivers/pinctrl/freescale/pinctrl-imx21.c | 1 +
 1 file changed, 1 insertion(+)
drivers/pinctrl/freescale/pinctrl-imx21.c +1 -0
index b9f9b3b8eeb1..8cf33d608164 100644
@@ -13,6 +13,7 @@
 #include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/pinctrl/pinctrl.h>
+#include <linux/module.h>
 
 #include "pinctrl-imx1.h"
 
Signature · 1 line
2.9.0
maintainer
#1 lore raw

Hi Arnd,

Quoted 10 lines · Arnd Bergmann

The pinctrl driver includes a device table, but the macro used for declaring it is declared in a header that is not visible here:

drivers/pinctrl/freescale/pinctrl-imx21.c:328:1: error: data definition has no type or storage class [-Werror]
MODULE_DEVICE_TABLE(of, imx21_pinctrl_of_match);

This adds the missing include.

Fixes e2756baa4217 ("pinctrl: imx21: make it explicitly non-modular")

I think the correct fix here would be:

drivers/pinctrl/freescale/pinctrl-imx21.c +0 -1
@@ -325,7 +325,6 @@ static const struct of_device_id imx21_pinctrl_of_match[] =
        { .compatible = "fsl,imx21-iomuxc", },
        { }
 };
-MODULE_DEVICE_TABLE(of, imx21_pinctrl_of_match);
 
 static struct platform_driver imx21_pinctrl_driver = {
        .driver = {

If you agree I can send a formal patch.

#2 lore raw
Quoted 14 lines · CEST Fabio Estevam

I think the correct fix here would be:

drivers/pinctrl/freescale/pinctrl-imx21.c +0 -1
@@ -325,7 +325,6 @@ static const struct of_device_id imx21_pinctrl_of_match[] =
        { .compatible = "fsl,imx21-iomuxc", },
        { }
 };
-MODULE_DEVICE_TABLE(of, imx21_pinctrl_of_match);
 
 static struct platform_driver imx21_pinctrl_driver = {
        .driver = {
Quoted 1 line

If you agree I can send a formal patch.

Fine with me too.

Arnd

#3 lore raw
In reply to Fabio Estevam
Quoted 28 lines · [Re: [PATCH] pinctrl: imx21: include linux/module.h] On 06/07/2016 (Wed 10:15)…

Hi Arnd,

Quoted 10 lines · Arnd Bergmann

The pinctrl driver includes a device table, but the macro used for declaring it is declared in a header that is not visible here:

drivers/pinctrl/freescale/pinctrl-imx21.c:328:1: error: data definition has no type or storage class [-Werror]
MODULE_DEVICE_TABLE(of, imx21_pinctrl_of_match);

This adds the missing include.

Fixes e2756baa4217 ("pinctrl: imx21: make it explicitly non-modular")

I think the correct fix here would be:

drivers/pinctrl/freescale/pinctrl-imx21.c +0 -1
@@ -325,7 +325,6 @@ static const struct of_device_id imx21_pinctrl_of_match[] =
        { .compatible = "fsl,imx21-iomuxc", },
        { }
 };
-MODULE_DEVICE_TABLE(of, imx21_pinctrl_of_match);
 
 static struct platform_driver imx21_pinctrl_driver = {
        .driver = {
Quoted 1 line

If you agree I can send a formal patch.

Yes, deleting the MODULE_DEVICE_TABLE is the right fix. I'm curious why that never showed up in all the build coverage I did...

Paul.
--

#4 lore raw
Quoted 8 lines · CEST Paul Gortmaker
Quoted 8 lines
drivers/pinctrl/freescale/pinctrl-imx21.c +0 -1
@@ -325,7 +325,6 @@ static const struct of_device_id imx21_pinctrl_of_match[] =
        { .compatible = "fsl,imx21-iomuxc", },
        { }
 };
-MODULE_DEVICE_TABLE(of, imx21_pinctrl_of_match);
 
Quoted 8 lines
Quoted 5 lines
drivers/pinctrl/freescale/pinctrl-imx21.c +0 -0
 static struct platform_driver imx21_pinctrl_driver = {
        .driver = {

If you agree I can send a formal patch.

Yes, deleting the MODULE_DEVICE_TABLE is the right fix. I'm curious why that never showed up in all the build coverage I did...

I needed several hundred randconfig builds before hitting it, I think it's just rare because the driver is not enabled most of the time, and it's possible that the header sometimes gets included implicitly.

Arnd