Skip to contentSkip to conversation

smiapp-core.c error if !defined(CONFIG_OF)

DISCUSSION Hans Verkuil 2 participants 3 messages Jan 13, 2015 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

Hi Sakari,

The daily build fails because of this error:

media_build/v4l/smiapp-core.c: In function 'smiapp_get_pdata':
media_build/v4l/smiapp-core.c:3061:3: error: implicit declaration of function 'of_read_number' [-Werror=implicit-function-declaration]
pdata->op_sys_clock[i] = of_read_number(val + i * 2, 2);
^

Some digging showed that of_read_number is only available if CONFIG_OF is defined. As far as I can see that is actually a bug in linux/of.h, as I see no reason why it should be under CONFIG_OF.

Can you look at this?

Regards,

Hans

#1 lore raw

Hi Hans,

Quoted 4 lines · Hans Verkuil

Hi Sakari,

The daily build fails because of this error:

Quoted 8 lines

media_build/v4l/smiapp-core.c: In function 'smiapp_get_pdata':
media_build/v4l/smiapp-core.c:3061:3: error: implicit declaration of function 'of_read_number' [-Werror=implicit-function-declaration]

   pdata->op_sys_clock[i] = of_read_number(val + i * 2, 2);
   ^

Some digging showed that of_read_number is only available if CONFIG_OF is defined. As far as I can see that is actually a bug in linux/of.h, as I see no reason why it should be under CONFIG_OF.

Well, it could be defined I guess --- it shouldn't have any use if OF isn't in use. I'll submit a patch for that.

The problem in the smiapp driver is better fixed by applying "smiapp: Use of_property_read_u64_array() to read a 64-bit number array" instead. Could you try that? I'll submit this as a fix then. of_read_number() was just a workaround for missing of_property_read_u64_array().

Signature · 4 lines
Kind regards,

Sakari Ailus
e-mail: [email protected]	XMPP: [email protected]
#2 lore raw
Quoted 12 lines · Sakari Ailus

Hi Hans,

Quoted 9 lines · Hans Verkuil

Hi Sakari,

The daily build fails because of this error:

media_build/v4l/smiapp-core.c: In function 'smiapp_get_pdata':
media_build/v4l/smiapp-core.c:3061:3: error: implicit declaration of function 'of_read_number' [-Werror=implicit-function-declaration]

   pdata->op_sys_clock[i] = of_read_number(val + i * 2, 2);
   ^
Quoted 6 lines
Quoted 3 lines

Some digging showed that of_read_number is only available if CONFIG_OF is defined. As far as I can see that is actually a bug in linux/of.h, as I see no reason why it should be under CONFIG_OF.

Well, it could be defined I guess --- it shouldn't have any use if OF isn't in use. I'll submit a patch for that.

Or not. There are a number of functions that are available only if CONFIG_OF is defined, this is not an only case. If the drivers are happy with that, I guess it's fine. I think a better solution might be to define a header for drivers to include.

The issue in the smiapp driver is indeed better fixed by using the right function to read the 64-bit unsigned integer array.

Signature · 2 lines
Sakari Ailus
e-mail: [email protected]	XMPP: [email protected]