All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mtd: nand: xway: fix build undefined MODULE_DEVICE_TABLE()
@ 2016-11-30 22:51 Hauke Mehrtens
  2016-12-01 10:35 ` Boris Brezillon
  2016-12-01 12:36 ` Boris Brezillon
  0 siblings, 2 replies; 10+ messages in thread
From: Hauke Mehrtens @ 2016-11-30 22:51 UTC (permalink / raw)
  To: boris.brezillon
  Cc: richard, dwmw2, computersforpeace, marek.vasut, cyrille.pitchen,
	linux-mtd, john, Hauke Mehrtens

The header file with the definition of MODULE_DEVICE_TABLE() was
missing, add include for linux/module.h to fix the problem in 4.9.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 drivers/mtd/nand/xway_nand.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/nand/xway_nand.c b/drivers/mtd/nand/xway_nand.c
index 1f2948c..bcbc1c7 100644
--- a/drivers/mtd/nand/xway_nand.c
+++ b/drivers/mtd/nand/xway_nand.c
@@ -8,6 +8,7 @@
  */
 
 #include <linux/mtd/nand.h>
+#include <linux/module.h>
 #include <linux/of_gpio.h>
 #include <linux/of_platform.h>
 
-- 
2.10.2

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] mtd: nand: xway: fix build undefined MODULE_DEVICE_TABLE()
  2016-11-30 22:51 [PATCH] mtd: nand: xway: fix build undefined MODULE_DEVICE_TABLE() Hauke Mehrtens
@ 2016-12-01 10:35 ` Boris Brezillon
  2016-12-01 12:36 ` Boris Brezillon
  1 sibling, 0 replies; 10+ messages in thread
From: Boris Brezillon @ 2016-12-01 10:35 UTC (permalink / raw)
  To: Hauke Mehrtens, computersforpeace
  Cc: richard, dwmw2, marek.vasut, cyrille.pitchen, linux-mtd, john

On Wed, 30 Nov 2016 23:51:10 +0100
Hauke Mehrtens <hauke@hauke-m.de> wrote:

> The header file with the definition of MODULE_DEVICE_TABLE() was
> missing, add include for linux/module.h to fix the problem in 4.9.
> 
> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>

Fixes: 024366750c2e ("mtd: nand: xway: convert to normal platform driver")
Cc: <stable@vger.kernel.org>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>

Brian, can you take this patch directly in the MTD tree with the
additional Fixes and Cc tags?

> ---
>  drivers/mtd/nand/xway_nand.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/mtd/nand/xway_nand.c b/drivers/mtd/nand/xway_nand.c
> index 1f2948c..bcbc1c7 100644
> --- a/drivers/mtd/nand/xway_nand.c
> +++ b/drivers/mtd/nand/xway_nand.c
> @@ -8,6 +8,7 @@
>   */
>  
>  #include <linux/mtd/nand.h>
> +#include <linux/module.h>
>  #include <linux/of_gpio.h>
>  #include <linux/of_platform.h>
>  

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] mtd: nand: xway: fix build undefined MODULE_DEVICE_TABLE()
  2016-11-30 22:51 [PATCH] mtd: nand: xway: fix build undefined MODULE_DEVICE_TABLE() Hauke Mehrtens
  2016-12-01 10:35 ` Boris Brezillon
@ 2016-12-01 12:36 ` Boris Brezillon
  2016-12-01 13:02   ` John Crispin
  2016-12-04 22:40   ` Hauke Mehrtens
  1 sibling, 2 replies; 10+ messages in thread
From: Boris Brezillon @ 2016-12-01 12:36 UTC (permalink / raw)
  To: Hauke Mehrtens
  Cc: richard, marek.vasut, linux-mtd, john, cyrille.pitchen,
	computersforpeace, dwmw2

Hi Hauke,

On Wed, 30 Nov 2016 23:51:10 +0100
Hauke Mehrtens <hauke@hauke-m.de> wrote:

> The header file with the definition of MODULE_DEVICE_TABLE() was
> missing, add include for linux/module.h to fix the problem in 4.9.

I tried to enable this driver as a module, and the build failed because
of a missing symbol (see the following patch).
Now, if it's not supposed to be compiled as a module, then you should
modify the Kconfig accordingly.

Regards,

Boris

--->8---
diff --git a/arch/mips/lantiq/xway/sysctrl.c
b/arch/mips/lantiq/xway/sysctrl.c index 236193b5210b..29e753556597
100644 --- a/arch/mips/lantiq/xway/sysctrl.c
+++ b/arch/mips/lantiq/xway/sysctrl.c
@@ -156,6 +156,7 @@ static void __iomem *pmu_membase;
 static void __iomem *ltq_xbar_membase;
 void __iomem *ltq_cgu_membase;
 void __iomem *ltq_ebu_membase;
+EXPORT_SYMBOL(ltq_ebu_membase);
 
 static u32 ifccr = CGU_IFCCR;
 static u32 pcicr = CGU_PCICR;

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] mtd: nand: xway: fix build undefined MODULE_DEVICE_TABLE()
  2016-12-01 12:36 ` Boris Brezillon
@ 2016-12-01 13:02   ` John Crispin
  2016-12-01 13:47     ` Boris Brezillon
  2016-12-04 22:40   ` Hauke Mehrtens
  1 sibling, 1 reply; 10+ messages in thread
From: John Crispin @ 2016-12-01 13:02 UTC (permalink / raw)
  To: Boris Brezillon, Hauke Mehrtens
  Cc: richard, marek.vasut, linux-mtd, cyrille.pitchen,
	computersforpeace, dwmw2



On 01/12/2016 13:36, Boris Brezillon wrote:
> Hi Hauke,
> 
> On Wed, 30 Nov 2016 23:51:10 +0100
> Hauke Mehrtens <hauke@hauke-m.de> wrote:
> 
>> The header file with the definition of MODULE_DEVICE_TABLE() was
>> missing, add include for linux/module.h to fix the problem in 4.9.
> 
> I tried to enable this driver as a module, and the build failed because
> of a missing symbol (see the following patch).
> Now, if it's not supposed to be compiled as a module, then you should
> modify the Kconfig accordingly.
> 
> Regards,
> 
> Boris
> 
> --->8---
> diff --git a/arch/mips/lantiq/xway/sysctrl.c
> b/arch/mips/lantiq/xway/sysctrl.c index 236193b5210b..29e753556597
> 100644 --- a/arch/mips/lantiq/xway/sysctrl.c
> +++ b/arch/mips/lantiq/xway/sysctrl.c
> @@ -156,6 +156,7 @@ static void __iomem *pmu_membase;
>  static void __iomem *ltq_xbar_membase;
>  void __iomem *ltq_cgu_membase;
>  void __iomem *ltq_ebu_membase;
> +EXPORT_SYMBOL(ltq_ebu_membase);

Hi,

i would be against exporting the membase pointers as global symbols. i
already find it annoying that cgu and ebu are not static

	John

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] mtd: nand: xway: fix build undefined MODULE_DEVICE_TABLE()
  2016-12-01 13:02   ` John Crispin
@ 2016-12-01 13:47     ` Boris Brezillon
  2016-12-01 13:57       ` John Crispin
  0 siblings, 1 reply; 10+ messages in thread
From: Boris Brezillon @ 2016-12-01 13:47 UTC (permalink / raw)
  To: John Crispin
  Cc: Hauke Mehrtens, richard, marek.vasut, linux-mtd, cyrille.pitchen,
	computersforpeace, dwmw2

On Thu, 1 Dec 2016 14:02:55 +0100
John Crispin <john@phrozen.org> wrote:

> On 01/12/2016 13:36, Boris Brezillon wrote:
> > Hi Hauke,
> > 
> > On Wed, 30 Nov 2016 23:51:10 +0100
> > Hauke Mehrtens <hauke@hauke-m.de> wrote:
> >   
> >> The header file with the definition of MODULE_DEVICE_TABLE() was
> >> missing, add include for linux/module.h to fix the problem in 4.9.  
> > 
> > I tried to enable this driver as a module, and the build failed because
> > of a missing symbol (see the following patch).
> > Now, if it's not supposed to be compiled as a module, then you should
> > modify the Kconfig accordingly.
> > 
> > Regards,
> > 
> > Boris
> >   
> > --->8---  
> > diff --git a/arch/mips/lantiq/xway/sysctrl.c
> > b/arch/mips/lantiq/xway/sysctrl.c index 236193b5210b..29e753556597
> > 100644 --- a/arch/mips/lantiq/xway/sysctrl.c
> > +++ b/arch/mips/lantiq/xway/sysctrl.c
> > @@ -156,6 +156,7 @@ static void __iomem *pmu_membase;
> >  static void __iomem *ltq_xbar_membase;
> >  void __iomem *ltq_cgu_membase;
> >  void __iomem *ltq_ebu_membase;
> > +EXPORT_SYMBOL(ltq_ebu_membase);  
> 
> Hi,
> 
> i would be against exporting the membase pointers as global symbols. i
> already find it annoying that cgu and ebu are not static

Yep, that's also my opinion.

Let's patch the Kconfig entry instead. BTW, if you don't compile the
driver as a module, then you don't need the MODULE_XX() calls, and you
can get rid of the module.h header.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] mtd: nand: xway: fix build undefined MODULE_DEVICE_TABLE()
  2016-12-01 13:47     ` Boris Brezillon
@ 2016-12-01 13:57       ` John Crispin
  2016-12-04 19:15         ` Hauke Mehrtens
  0 siblings, 1 reply; 10+ messages in thread
From: John Crispin @ 2016-12-01 13:57 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: Hauke Mehrtens, richard, marek.vasut, linux-mtd, cyrille.pitchen,
	computersforpeace, dwmw2



On 01/12/2016 14:47, Boris Brezillon wrote:
> On Thu, 1 Dec 2016 14:02:55 +0100
> John Crispin <john@phrozen.org> wrote:
> 
>> On 01/12/2016 13:36, Boris Brezillon wrote:
>>> Hi Hauke,
>>>
>>> On Wed, 30 Nov 2016 23:51:10 +0100
>>> Hauke Mehrtens <hauke@hauke-m.de> wrote:
>>>   
>>>> The header file with the definition of MODULE_DEVICE_TABLE() was
>>>> missing, add include for linux/module.h to fix the problem in 4.9.  
>>>
>>> I tried to enable this driver as a module, and the build failed because
>>> of a missing symbol (see the following patch).
>>> Now, if it's not supposed to be compiled as a module, then you should
>>> modify the Kconfig accordingly.
>>>
>>> Regards,
>>>
>>> Boris
>>>   
>>> --->8---  
>>> diff --git a/arch/mips/lantiq/xway/sysctrl.c
>>> b/arch/mips/lantiq/xway/sysctrl.c index 236193b5210b..29e753556597
>>> 100644 --- a/arch/mips/lantiq/xway/sysctrl.c
>>> +++ b/arch/mips/lantiq/xway/sysctrl.c
>>> @@ -156,6 +156,7 @@ static void __iomem *pmu_membase;
>>>  static void __iomem *ltq_xbar_membase;
>>>  void __iomem *ltq_cgu_membase;
>>>  void __iomem *ltq_ebu_membase;
>>> +EXPORT_SYMBOL(ltq_ebu_membase);  
>>
>> Hi,
>>
>> i would be against exporting the membase pointers as global symbols. i
>> already find it annoying that cgu and ebu are not static
> 
> Yep, that's also my opinion.
> 
> Let's patch the Kconfig entry instead. BTW, if you don't compile the
> driver as a module, then you don't need the MODULE_XX() calls, and you
> can get rid of the module.h header.
>

agreed. not sure how hauke tested his patch in the first place.

	John

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] mtd: nand: xway: fix build undefined MODULE_DEVICE_TABLE()
  2016-12-01 13:57       ` John Crispin
@ 2016-12-04 19:15         ` Hauke Mehrtens
  2016-12-04 19:19           ` John Crispin
  0 siblings, 1 reply; 10+ messages in thread
From: Hauke Mehrtens @ 2016-12-04 19:15 UTC (permalink / raw)
  To: John Crispin, Boris Brezillon
  Cc: richard, marek.vasut, linux-mtd, cyrille.pitchen,
	computersforpeace, dwmw2

On 12/01/2016 02:57 PM, John Crispin wrote:
> 
> 
> On 01/12/2016 14:47, Boris Brezillon wrote:
>> On Thu, 1 Dec 2016 14:02:55 +0100
>> John Crispin <john@phrozen.org> wrote:
>>
>>> On 01/12/2016 13:36, Boris Brezillon wrote:
>>>> Hi Hauke,
>>>>
>>>> On Wed, 30 Nov 2016 23:51:10 +0100
>>>> Hauke Mehrtens <hauke@hauke-m.de> wrote:
>>>>   
>>>>> The header file with the definition of MODULE_DEVICE_TABLE() was
>>>>> missing, add include for linux/module.h to fix the problem in 4.9.  
>>>>
>>>> I tried to enable this driver as a module, and the build failed because
>>>> of a missing symbol (see the following patch).
>>>> Now, if it's not supposed to be compiled as a module, then you should
>>>> modify the Kconfig accordingly.
>>>>
>>>> Regards,
>>>>
>>>> Boris
>>>>   
>>>> --->8---  
>>>> diff --git a/arch/mips/lantiq/xway/sysctrl.c
>>>> b/arch/mips/lantiq/xway/sysctrl.c index 236193b5210b..29e753556597
>>>> 100644 --- a/arch/mips/lantiq/xway/sysctrl.c
>>>> +++ b/arch/mips/lantiq/xway/sysctrl.c
>>>> @@ -156,6 +156,7 @@ static void __iomem *pmu_membase;
>>>>  static void __iomem *ltq_xbar_membase;
>>>>  void __iomem *ltq_cgu_membase;
>>>>  void __iomem *ltq_ebu_membase;
>>>> +EXPORT_SYMBOL(ltq_ebu_membase);  
>>>
>>> Hi,
>>>
>>> i would be against exporting the membase pointers as global symbols. i
>>> already find it annoying that cgu and ebu are not static
>>
>> Yep, that's also my opinion.

I also do not like this ebu integration. the ebu lock is also a problem.

>> Let's patch the Kconfig entry instead. BTW, if you don't compile the
>> driver as a module, then you don't need the MODULE_XX() calls, and you
>> can get rid of the module.h header.
>>
> 
> agreed. not sure how hauke tested his patch in the first place.

Sorry, I never tested this as a module, I only used it compiled into the
kernel.

I will send a patch which changes Kconfig.

Hauke

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] mtd: nand: xway: fix build undefined MODULE_DEVICE_TABLE()
  2016-12-04 19:15         ` Hauke Mehrtens
@ 2016-12-04 19:19           ` John Crispin
  0 siblings, 0 replies; 10+ messages in thread
From: John Crispin @ 2016-12-04 19:19 UTC (permalink / raw)
  To: Hauke Mehrtens, Boris Brezillon
  Cc: richard, marek.vasut, linux-mtd, cyrille.pitchen,
	computersforpeace, dwmw2



On 04/12/2016 20:15, Hauke Mehrtens wrote:
> I also do not like this ebu integration. the ebu lock is also a problem.

yep, the lock is needed for pci to work. its really ugly i agree.

	John

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] mtd: nand: xway: fix build undefined MODULE_DEVICE_TABLE()
  2016-12-01 12:36 ` Boris Brezillon
  2016-12-01 13:02   ` John Crispin
@ 2016-12-04 22:40   ` Hauke Mehrtens
  2016-12-05 12:10     ` Boris Brezillon
  1 sibling, 1 reply; 10+ messages in thread
From: Hauke Mehrtens @ 2016-12-04 22:40 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: richard, marek.vasut, linux-mtd, john, cyrille.pitchen,
	computersforpeace, dwmw2

On 12/01/2016 01:36 PM, Boris Brezillon wrote:
> Hi Hauke,
> 
> On Wed, 30 Nov 2016 23:51:10 +0100
> Hauke Mehrtens <hauke@hauke-m.de> wrote:
> 
>> The header file with the definition of MODULE_DEVICE_TABLE() was
>> missing, add include for linux/module.h to fix the problem in 4.9.
> 
> I tried to enable this driver as a module, and the build failed because
> of a missing symbol (see the following patch).
> Now, if it's not supposed to be compiled as a module, then you should
> modify the Kconfig accordingly.
> 
> Regards,
> 
> Boris
> 
> --->8---
> diff --git a/arch/mips/lantiq/xway/sysctrl.c
> b/arch/mips/lantiq/xway/sysctrl.c index 236193b5210b..29e753556597
> 100644 --- a/arch/mips/lantiq/xway/sysctrl.c
> +++ b/arch/mips/lantiq/xway/sysctrl.c
> @@ -156,6 +156,7 @@ static void __iomem *pmu_membase;
>  static void __iomem *ltq_xbar_membase;
>  void __iomem *ltq_cgu_membase;
>  void __iomem *ltq_ebu_membase;
> +EXPORT_SYMBOL(ltq_ebu_membase);
>  
>  static u32 ifccr = CGU_IFCCR;
>  static u32 pcicr = CGU_PCICR;
> 

Also module_platform_driver() needs linux/module.h, because it contains
module_init() and some more stuff.

I would like to add the include for linux/module.h and deactivate module
support. It looks like it was possible to select module building since
it was added, but it should never have worked.

Hauke

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] mtd: nand: xway: fix build undefined MODULE_DEVICE_TABLE()
  2016-12-04 22:40   ` Hauke Mehrtens
@ 2016-12-05 12:10     ` Boris Brezillon
  0 siblings, 0 replies; 10+ messages in thread
From: Boris Brezillon @ 2016-12-05 12:10 UTC (permalink / raw)
  To: Hauke Mehrtens
  Cc: richard, marek.vasut, linux-mtd, john, cyrille.pitchen,
	computersforpeace, dwmw2

On Sun, 4 Dec 2016 23:40:56 +0100
Hauke Mehrtens <hauke@hauke-m.de> wrote:

> On 12/01/2016 01:36 PM, Boris Brezillon wrote:
> > Hi Hauke,
> > 
> > On Wed, 30 Nov 2016 23:51:10 +0100
> > Hauke Mehrtens <hauke@hauke-m.de> wrote:
> >   
> >> The header file with the definition of MODULE_DEVICE_TABLE() was
> >> missing, add include for linux/module.h to fix the problem in 4.9.  
> > 
> > I tried to enable this driver as a module, and the build failed because
> > of a missing symbol (see the following patch).
> > Now, if it's not supposed to be compiled as a module, then you should
> > modify the Kconfig accordingly.
> > 
> > Regards,
> > 
> > Boris
> >   
> > --->8---  
> > diff --git a/arch/mips/lantiq/xway/sysctrl.c
> > b/arch/mips/lantiq/xway/sysctrl.c index 236193b5210b..29e753556597
> > 100644 --- a/arch/mips/lantiq/xway/sysctrl.c
> > +++ b/arch/mips/lantiq/xway/sysctrl.c
> > @@ -156,6 +156,7 @@ static void __iomem *pmu_membase;
> >  static void __iomem *ltq_xbar_membase;
> >  void __iomem *ltq_cgu_membase;
> >  void __iomem *ltq_ebu_membase;
> > +EXPORT_SYMBOL(ltq_ebu_membase);
> >  
> >  static u32 ifccr = CGU_IFCCR;
> >  static u32 pcicr = CGU_PCICR;
> >   
> 
> Also module_platform_driver() needs linux/module.h, because it contains
> module_init() and some more stuff.

You should use builtin_platform_driver() and not
module_platform_driver().

> 
> I would like to add the include for linux/module.h and deactivate module
> support. It looks like it was possible to select module building since
> it was added, but it should never have worked.
> 
> Hauke

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-12-05 12:11 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-30 22:51 [PATCH] mtd: nand: xway: fix build undefined MODULE_DEVICE_TABLE() Hauke Mehrtens
2016-12-01 10:35 ` Boris Brezillon
2016-12-01 12:36 ` Boris Brezillon
2016-12-01 13:02   ` John Crispin
2016-12-01 13:47     ` Boris Brezillon
2016-12-01 13:57       ` John Crispin
2016-12-04 19:15         ` Hauke Mehrtens
2016-12-04 19:19           ` John Crispin
2016-12-04 22:40   ` Hauke Mehrtens
2016-12-05 12:10     ` 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.