Skip to contentSkip to conversation

linux-next: build failure after merge of the tty tree

PATCH New Stephen Rothwell 5 participants 9 messages Sep 11, 2018 – Sep 18, 2018

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

Hi Greg,

After merging the tty tree, today's linux-next build (arm multi_v7_defconfig) failed like this:

drivers/mfd/at91-usart.c:51:34: error: array type has incomplete element type 'struct of_device_id'

 static const struct of_device_id at91_usart_mode_of_match[] = {
                                  ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/mfd/at91-usart.c:52:4: error: field name not in record or union initializer
  { .compatible = "atmel,at91rm9200-usart" },
    ^
drivers/mfd/at91-usart.c:52:4: note: (near initialization for 'at91_usart_mode_of_match')
drivers/mfd/at91-usart.c:53:4: error: field name not in record or union initializer
  { .compatible = "atmel,at91sam9260-usart" },
    ^
drivers/mfd/at91-usart.c:53:4: note: (near initialization for 'at91_usart_mode_of_match')
drivers/mfd/at91-usart.c:51:34: warning: 'at91_usart_mode_of_match' defined but not used [-Wunused-variable]
 static const struct of_device_id at91_usart_mode_of_match[] = {
                                  ^~~~~~~~~~~~~~~~~~~~~~~~

Caused by commit

7d3aa342cef7 ("mfd: at91-usart: Add MFD driver for USART")

Forgot to include <linux/mod_devicetable.h>?

I used the version of the tty tree from next-20180910 for today.

Signature · 2 lines
Cheers,
Stephen Rothwell
#1 lore raw
Quoted 20 lines · Stephen Rothwell

Hi Greg,

After merging the tty tree, today's linux-next build (arm multi_v7_defconfig) failed like this:

drivers/mfd/at91-usart.c:51:34: error: array type has incomplete element type 'struct of_device_id'

 static const struct of_device_id at91_usart_mode_of_match[] = {
                                  ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/mfd/at91-usart.c:52:4: error: field name not in record or union initializer
  { .compatible = "atmel,at91rm9200-usart" },
    ^
drivers/mfd/at91-usart.c:52:4: note: (near initialization for 'at91_usart_mode_of_match')
drivers/mfd/at91-usart.c:53:4: error: field name not in record or union initializer
  { .compatible = "atmel,at91sam9260-usart" },
    ^
drivers/mfd/at91-usart.c:53:4: note: (near initialization for 'at91_usart_mode_of_match')
drivers/mfd/at91-usart.c:51:34: warning: 'at91_usart_mode_of_match' defined but not used [-Wunused-variable]
 static const struct of_device_id at91_usart_mode_of_match[] = {
                                  ^~~~~~~~~~~~~~~~~~~~~~~~
Quoted 7 lines

Caused by commit

7d3aa342cef7 ("mfd: at91-usart: Add MFD driver for USART")

Forgot to include <linux/mod_devicetable.h>?

I used the version of the tty tree from next-20180910 for today.

Very odd, I just pulled in the "Immutable" branch from Lee here.

Lee, is there something I am missing to get this to build properly?

thanks,

greg k-h

#2 lore raw
In reply to Stephen Rothwell
Quoted 20 lines · Stephen Rothwell

Hi Greg,

After merging the tty tree, today's linux-next build (arm multi_v7_defconfig) failed like this:

drivers/mfd/at91-usart.c:51:34: error: array type has incomplete element type 'struct of_device_id'

 static const struct of_device_id at91_usart_mode_of_match[] = {
                                  ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/mfd/at91-usart.c:52:4: error: field name not in record or union initializer
  { .compatible = "atmel,at91rm9200-usart" },
    ^
drivers/mfd/at91-usart.c:52:4: note: (near initialization for 'at91_usart_mode_of_match')
drivers/mfd/at91-usart.c:53:4: error: field name not in record or union initializer
  { .compatible = "atmel,at91sam9260-usart" },
    ^
drivers/mfd/at91-usart.c:53:4: note: (near initialization for 'at91_usart_mode_of_match')
drivers/mfd/at91-usart.c:51:34: warning: 'at91_usart_mode_of_match' defined but not used [-Wunused-variable]
 static const struct of_device_id at91_usart_mode_of_match[] = {
                                  ^~~~~~~~~~~~~~~~~~~~~~~~
Quoted 5 lines

Caused by commit

7d3aa342cef7 ("mfd: at91-usart: Add MFD driver for USART")

Forgot to include <linux/mod_devicetable.h>?

Looks like a missing Device Tree header <linux/of.h>.

Will chase this today and follow up with another PR.

Signature · 4 lines
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
maintainer
#3 lore raw
Quoted 24 lines · Lee Jones
Quoted 22 lines · Stephen Rothwell

Hi Greg,

After merging the tty tree, today's linux-next build (arm multi_v7_defconfig) failed like this:

drivers/mfd/at91-usart.c:51:34: error: array type has incomplete element type 'struct of_device_id'

  static const struct of_device_id at91_usart_mode_of_match[] = {
                                   ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/mfd/at91-usart.c:52:4: error: field name not in record or union initializer
   { .compatible = "atmel,at91rm9200-usart" },
     ^
drivers/mfd/at91-usart.c:52:4: note: (near initialization for 'at91_usart_mode_of_match')
drivers/mfd/at91-usart.c:53:4: error: field name not in record or union initializer
   { .compatible = "atmel,at91sam9260-usart" },
     ^
drivers/mfd/at91-usart.c:53:4: note: (near initialization for 'at91_usart_mode_of_match')
drivers/mfd/at91-usart.c:51:34: warning: 'at91_usart_mode_of_match' defined but not used [-Wunused-variable]
  static const struct of_device_id at91_usart_mode_of_match[] = {
                                   ^~~~~~~~~~~~~~~~~~~~~~~~

Caused by commit

Quoted 7 lines
Quoted 3 lines

7d3aa342cef7 ("mfd: at91-usart: Add MFD driver for USART")

Forgot to include <linux/mod_devicetable.h>?

Looks like a missing Device Tree header <linux/of.h>.

Will chase this today and follow up with another PR.

Hi all,

Actually it is due to the missing of <linux/mod_devicetable.h> as Stephen suggested. It is due to the patch ac3167257b9f ("headers: separate linux/mod_devicetable.h from linux/platform_device.h") merged in v4.19-rc1.

because linux/platform_device.h was included by linux/mfd/core.h that is present in this driver. This is why the issue was not identified beforehand.

I'm building a tiny patch to address this right now.

Thanks for your help. Best regards,

Signature · 1 line
Nicolas Ferre
#4 lore raw
Quoted 31 lines · Nicolas Ferre
Quoted 30 lines · Lee Jones
Quoted 20 lines · Stephen Rothwell

Hi Greg,

After merging the tty tree, today's linux-next build (arm multi_v7_defconfig) failed like this:

drivers/mfd/at91-usart.c:51:34: error: array type has incomplete element type 'struct of_device_id'

  static const struct of_device_id at91_usart_mode_of_match[] = {
                                   ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/mfd/at91-usart.c:52:4: error: field name not in record or union initializer
   { .compatible = "atmel,at91rm9200-usart" },
     ^
drivers/mfd/at91-usart.c:52:4: note: (near initialization for 'at91_usart_mode_of_match')
drivers/mfd/at91-usart.c:53:4: error: field name not in record or union initializer
   { .compatible = "atmel,at91sam9260-usart" },
     ^
drivers/mfd/at91-usart.c:53:4: note: (near initialization for 'at91_usart_mode_of_match')
drivers/mfd/at91-usart.c:51:34: warning: 'at91_usart_mode_of_match' defined but not used [-Wunused-variable]
  static const struct of_device_id at91_usart_mode_of_match[] = {
                                   ^~~~~~~~~~~~~~~~~~~~~~~~
Quoted 5 lines

Caused by commit

7d3aa342cef7 ("mfd: at91-usart: Add MFD driver for USART")

Forgot to include <linux/mod_devicetable.h>?

Looks like a missing Device Tree header <linux/of.h>.

Quoted 7 lines
Quoted 1 line

Will chase this today and follow up with another PR.

Hi all,

Actually it is due to the missing of <linux/mod_devicetable.h> as Stephen suggested. It is due to the patch ac3167257b9f ("headers: separate linux/mod_devicetable.h from linux/platform_device.h") merged in v4.19-rc1.

Since this set uses Device Tree, it really should include the of.h.

This solves the issue reported above.

I will fix-up and re-send the pull-request.

Quoted 6 lines

because linux/platform_device.h was included by linux/mfd/core.h that is present in this driver. This is why the issue was not identified beforehand.

I'm building a tiny patch to address this right now.

Thanks for your help. Best regards,

Signature · 4 lines
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#5 lore raw
Quoted 7 lines · Lee Jones
Quoted 3 lines · Nicolas Ferre

Actually it is due to the missing of <linux/mod_devicetable.h> as Stephen suggested. It is due to the patch ac3167257b9f ("headers: separate linux/mod_devicetable.h from linux/platform_device.h") merged in v4.19-rc1.

Since this set uses Device Tree, it really should include the of.h.

I didn't remember the contents of the driver, but I would disagree on a statement that
*using* of_device_id table implies necessity of linux/of.h inclusion.

Quoted 4 lines

This solves the issue reported above.

I will fix-up and re-send the pull-request.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
maintainer
#6 lore raw

PATCH 1/1 mfd: at91-usart: fix missing mod_devicetable.h

In reply to Stephen Rothwell

Following the inclusion of the patch ac3167257b9f ("headers:
separate linux/mod_devicetable.h from linux/platform_device.h"), there is a build issue:

drivers/mfd/at91-usart.c:51:34: error: array type has incomplete element type 'struct of_device_id'
static const struct of_device_id at91_usart_mode_of_match[] = {

Before this patch, the definition was reached by its inclusion of linux/mfd/core.h.

The build issue is solved by simply adding the mod_devicetable.h in this driver.

---
 drivers/mfd/at91-usart.c | 1 +
 1 file changed, 1 insertion(+)
drivers/mfd/at91-usart.c +1 -0
index a4b9929c156f..ad743b8ca6be 100644
@@ -11,6 +11,7 @@
 #include <dt-bindings/mfd/at91-usart.h>
 
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
 #include <linux/mfd/core.h>
 #include <linux/property.h>
 
Signature · 1 line
2.15.1
#7 lore raw

PATCH 1/1 mfd: at91-usart: fix missing mod_devicetable.h

Quoted 8 lines · Nicolas Ferre

Following the inclusion of the patch ac3167257b9f ("headers:
separate linux/mod_devicetable.h from linux/platform_device.h"), there is a build issue:

drivers/mfd/at91-usart.c:51:34: error: array type has incomplete element type 'struct of_device_id'
static const struct of_device_id at91_usart_mode_of_match[] = {

Quoted 8 lines

Before this patch, the definition was reached by its inclusion of linux/mfd/core.h.

The build issue is solved by simply adding the mod_devicetable.h in this driver.

You forgot a "reported-by" :(

I'll go add it...

#8 lore raw

PATCH 1/1 mfd: at91-usart: fix missing mod_devicetable.h

In reply to Nicolas Ferre
Quoted 25 lines · Nicolas Ferre

Following the inclusion of the patch ac3167257b9f ("headers:
separate linux/mod_devicetable.h from linux/platform_device.h"), there is a build issue:

drivers/mfd/at91-usart.c:51:34: error: array type has incomplete element type 'struct of_device_id'
static const struct of_device_id at91_usart_mode_of_match[] = {

Before this patch, the definition was reached by its inclusion of linux/mfd/core.h.

The build issue is solved by simply adding the mod_devicetable.h in this driver.

---
 drivers/mfd/at91-usart.c | 1 +
 1 file changed, 1 insertion(+)
drivers/mfd/at91-usart.c +0 -0
index a4b9929c156f..ad743b8ca6be 100644

drivers/mfd/at91-usart.c line 16

Quoted 6 lines
drivers/mfd/at91-usart.c +1 -0
@@ -11,6 +11,7 @@
 #include <dt-bindings/mfd/at91-usart.h>
 
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
 #include <linux/mfd/core.h>
 #include <linux/property.h>

Since this driver is using Device Tree, it is more correct to simply add <linux/of.h>, unless of course we are also going to remove <linux/mod_devicetable.h> from <linux/of.h>.

Signature · 4 lines
Lee Jones [???]
Linaro Services Technical Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog