Linux Media Controller development
 help / color / mirror / Atom feed
* "error: redefinition of 'altera_init'" during build on Kernel 3.0.36+
@ 2014-07-27  6:47 Isaac Nickaein
  2014-07-27  7:53 ` Hans Verkuil
  0 siblings, 1 reply; 7+ messages in thread
From: Isaac Nickaein @ 2014-07-27  6:47 UTC (permalink / raw)
  To: linux-media

Hello,

I get the following error when I try to build the V4L2 on Kernel
3.0.36+ for ARM architecture:

/root/v4l2/media_build/v4l/altera.c:2417:5: error: redefinition of 'altera_init'
 int altera_init(struct altera_config *config, const struct firmware *fw)
     ^
In file included from /root/v4l2/media_build/v4l/altera.c:32:0:
/root/v4l2/media_build/v4l/../linux/include/misc/altera.h:41:19: note:
previous definition of 'altera_init' was here
 static inline int altera_init(struct altera_config *config,
                   ^


I checked the altera.h code and apparently, the IS_ENABLED macro is
not defined and causes this problem. I have prepared kernel source at
/lib/modules/3.0.36+/build/ and it builds successfully.

Can anyone help me on this issue?

Bests,
Isaac

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

* Re: "error: redefinition of 'altera_init'" during build on Kernel 3.0.36+
  2014-07-27  6:47 "error: redefinition of 'altera_init'" during build on Kernel 3.0.36+ Isaac Nickaein
@ 2014-07-27  7:53 ` Hans Verkuil
  2014-07-27  8:18   ` Isaac Nickaein
  0 siblings, 1 reply; 7+ messages in thread
From: Hans Verkuil @ 2014-07-27  7:53 UTC (permalink / raw)
  To: Isaac Nickaein, linux-media

On 07/27/2014 08:47 AM, Isaac Nickaein wrote:
> Hello,
> 
> I get the following error when I try to build the V4L2 on Kernel
> 3.0.36+ for ARM architecture:
> 
> /root/v4l2/media_build/v4l/altera.c:2417:5: error: redefinition of 'altera_init'
>  int altera_init(struct altera_config *config, const struct firmware *fw)
>      ^
> In file included from /root/v4l2/media_build/v4l/altera.c:32:0:
> /root/v4l2/media_build/v4l/../linux/include/misc/altera.h:41:19: note:
> previous definition of 'altera_init' was here
>  static inline int altera_init(struct altera_config *config,
>                    ^
> 
> 
> I checked the altera.h code and apparently, the IS_ENABLED macro is
> not defined and causes this problem. I have prepared kernel source at
> /lib/modules/3.0.36+/build/ and it builds successfully.
> 
> Can anyone help me on this issue?

What kernel tree are you using? There is no IS_ENABLED in 3.0, so apparently
you have a patched kernel. Do you actually need that altera driver? If not,
then why not disable it in the kernel config?

Regards,

	Hans

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

* Re: "error: redefinition of 'altera_init'" during build on Kernel 3.0.36+
  2014-07-27  7:53 ` Hans Verkuil
@ 2014-07-27  8:18   ` Isaac Nickaein
  2014-07-27  8:26     ` Hans Verkuil
  0 siblings, 1 reply; 7+ messages in thread
From: Isaac Nickaein @ 2014-07-27  8:18 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: linux-media

Hi Hans,

I am using Kernel 3.0.36+ download from this repository:
https://github.com/linux-rockchip/kernel_rockchip
It's a fork of https://github.com/rkchrome/kernel

I guess I don't need that driver. After disabling it through
menuconfig, I get this error:


In file included from
/root/v4l2/media_build/v4l/../linux/include/media/v4l2-subdev.h:30:0,
                 from
/root/v4l2/media_build/v4l/../linux/include/media/v4l2-device.h:25,
                 from /root/v4l2/media_build/v4l/au0828.h:30,
                 from /root/v4l2/media_build/v4l/au0828-core.c:28:
/root/v4l2/media_build/v4l/../linux/include/media/v4l2-fh.h:49:5:
warning: "IS_ENABLED" is not defined [-Wundef]
 #if IS_ENABLED(CONFIG_V4L2_MEM2MEM_DEV)
     ^
/root/v4l2/media_build/v4l/../linux/include/media/v4l2-fh.h:49:15:
error: missing binary operator before token "("
 #if IS_ENABLED(CONFIG_V4L2_MEM2MEM_DEV)
               ^

And apparently yes, there is some issue with IS_ENABLED. Doesn't V4L2
apply patches to be compatible with older kernels (e.g. 3.0)?

To bypass this error, I manually added these two includes to
v4l2-.fh.h file (I guess this is not a good approach):

#include <linux/module.h>
#include <linux/export.h>

Now when I run make, I get different errors. Here is the output
truncated to 100 lines (there are many errors):


root@localhost:~/v4l2/media_build# make
make -C /root/v4l2/media_build/v4l
make[1]: Entering directory `/root/v4l2/media_build/v4l'
creating symbolic links...
make -C firmware prep
make[2]: Entering directory `/root/v4l2/media_build/v4l/firmware'
make[2]: Leaving directory `/root/v4l2/media_build/v4l/firmware'
make -C firmware
make[2]: Entering directory `/root/v4l2/media_build/v4l/firmware'
make[2]: Nothing to be done for `default'.
make[2]: Leaving directory `/root/v4l2/media_build/v4l/firmware'
Kernel build directory is /lib/modules/3.0.36+/build
make -C ../linux apply_patches
make[2]: Entering directory `/root/v4l2/media_build/linux'
Patches for 3.0.36+ already applied.
make[2]: Leaving directory `/root/v4l2/media_build/linux'
make -C /lib/modules/3.0.36+/build SUBDIRS=/root/v4l2/media_build/v4l  modules
make[2]: Entering directory `/lib/modules/3.0.36+/build'
  CC [M]  /root/v4l2/media_build/v4l/au0828-video.o
In file included from include/linux/cache.h:4:0,
                 from include/linux/time.h:7,
                 from include/linux/stat.h:60,
                 from include/linux/module.h:10,
                 from /root/v4l2/media_build/v4l/au0828-video.c:31:
/root/v4l2/media_build/v4l/au0828-video.c: In function 'au0828_v4l2_close':
/root/v4l2/media_build/v4l/au0828-video.c:1086:28: error: 'struct
au0828_dev' has no member named 'v4l2_dev'
   v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_power, 0);
                            ^
include/linux/kernel.h:659:49: note: in definition of macro 'container_of'
  const typeof( ((type *)0)->member ) *__mptr = (ptr); \
                                                 ^
include/linux/list.h:419:13: note: in expansion of macro 'list_entry'
  for (pos = list_entry((head)->next, typeof(*pos), member); \
             ^
/root/v4l2/media_build/v4l/../linux/include/media/v4l2-device.h:140:3:
note: in expansion of macro 'list_for_each_entry'
   list_for_each_entry((sd), &(v4l2_dev)->subdevs, list) \
   ^
/root/v4l2/media_build/v4l/../linux/include/media/v4l2-device.h:184:3:
note: in expansion of macro '__v4l2_device_call_subdevs_p'
   __v4l2_device_call_subdevs_p(v4l2_dev, __sd,  \
   ^
/root/v4l2/media_build/v4l/au0828-video.c:1086:3: note: in expansion
of macro 'v4l2_device_call_all'
   v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_power, 0);
   ^
In file included from include/linux/module.h:9:0,
                 from /root/v4l2/media_build/v4l/au0828-video.c:31:
/root/v4l2/media_build/v4l/au0828-video.c:1086:28: error: 'struct
au0828_dev' has no member named 'v4l2_dev'
   v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_power, 0);
                            ^
include/linux/list.h:420:24: note: in definition of macro 'list_for_each_entry'
       &pos->member != (head);  \
                        ^
/root/v4l2/media_build/v4l/../linux/include/media/v4l2-device.h:184:3:
note: in expansion of macro '__v4l2_device_call_subdevs_p'
   __v4l2_device_call_subdevs_p(v4l2_dev, __sd,  \
   ^
/root/v4l2/media_build/v4l/au0828-video.c:1086:3: note: in expansion
of macro 'v4l2_device_call_all'
   v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_power, 0);
   ^
In file included from include/linux/cache.h:4:0,
                 from include/linux/time.h:7,
                 from include/linux/stat.h:60,
                 from include/linux/module.h:10,
                 from /root/v4l2/media_build/v4l/au0828-video.c:31:
/root/v4l2/media_build/v4l/au0828-video.c: In function 'au0828_init_tuner':
/root/v4l2/media_build/v4l/au0828-video.c:1120:27: error: 'struct
au0828_dev' has no member named 'v4l2_dev'
  v4l2_device_call_all(&dev->v4l2_dev, 0, video, s_std, dev->std);
                           ^
include/linux/kernel.h:659:49: note: in definition of macro 'container_of'
  const typeof( ((type *)0)->member ) *__mptr = (ptr); \
                                                 ^
include/linux/list.h:419:13: note: in expansion of macro 'list_entry'
  for (pos = list_entry((head)->next, typeof(*pos), member); \
             ^
/root/v4l2/media_build/v4l/../linux/include/media/v4l2-device.h:140:3:
note: in expansion of macro 'list_for_each_entry'
   list_for_each_entry((sd), &(v4l2_dev)->subdevs, list) \
   ^
/root/v4l2/media_build/v4l/../linux/include/media/v4l2-device.h:184:3:
note: in expansion of macro '__v4l2_device_call_subdevs_p'
   __v4l2_device_call_subdevs_p(v4l2_dev, __sd,  \
   ^
/root/v4l2/media_build/v4l/au0828-video.c:1120:2: note: in expansion
of macro 'v4l2_device_call_all'
  v4l2_device_call_all(&dev->v4l2_dev, 0, video, s_std, dev->std);
  ^
In file included from include/linux/module.h:9:0,
                 from /root/v4l2/media_build/v4l/au0828-video.c:31:
/root/v4l2/media_build/v4l/au0828-video.c:1120:27: error: 'struct
au0828_dev' has no member named 'v4l2_dev'
  v4l2_device_call_all(&dev->v4l2_dev, 0, video, s_std, dev->std);
                           ^
include/linux/list.h:420:24: note: in definition of macro 'list_for_each_entry'
       &pos->member != (head);  \
                        ^
/root/v4l2/media_build/v4l/../linux/include/media/v4l2-device.h:184:3:
note: in expansion of macro '__v4l2_device_call_subdevs_p'
   __v4l2_device_call_subdevs_p(v4l2_dev, __sd,  \
   ^
/root/v4l2/media_build/v4l/au0828-video.c:1120:2: note: in expansion
of macro 'v4l2_device_call_all'
  v4l2_device_call_all(&dev->v4l2_dev, 0, video, s_std, dev->std);
  ^
In file included from include/linux/cache.h:4:0,
                 from include/linux/time.h:7,
                 from include/linux/stat.h:60,
                 from include/linux/module.h:10,
                 from /root/v4l2/media_build/v4l/au0828-video.c:31:
/root/v4l2/media_build/v4l/au0828-video.c:1121:27: error: 'struct
au0828_dev' has no member named 'v4l2_dev'
  v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_frequency, &f);
                           ^
include/linux/kernel.h:659:49: note: in definition of macro 'container_of'
  const typeof( ((type *)0)->member ) *__mptr = (ptr); \
                                                 ^
include/linux/list.h:419:13: note: in expansion of macro 'list_entry'
  for (pos = list_entry((head)->next, typeof(*pos), member); \
             ^
/root/v4l2/media_build/v4l/../linux/include/media/v4l2-device.h:140:3:
note: in expansion of macro 'list_for_each_entry'
   list_for_each_entry((sd), &(v4l2_dev)->subdevs, list) \
   ^
/root/v4l2/media_build/v4l/../linux/include/media/v4l2-device.h:184:3:
note: in expansion of macro '__v4l2_device_call_subdevs_p'
   __v4l2_device_call_subdevs_p(v4l2_dev, __sd,  \
   ^
/root/v4l2/media_build/v4l/au0828-video.c:1121:2: note: in expansion
of macro 'v4l2_device_call_all'
  v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_frequency, &f);
  ^
In file included from include/linux/module.h:9:0,
                 from /root/v4l2/media_build/v4l/au0828-video.c:31:
/root/v4l2/media_build/v4l/au0828-video.c:1121:27: error: 'struct
au0828_dev' has no member named 'v4l2_dev'
  v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_frequency, &f);
                           ^
include/linux/list.h:420:24: note: in definition of macro 'list_for_each_entry'
       &pos->member != (head);  \
                        ^
/root/v4l2/media_build/v4l/../linux/include/media/v4l2-device.h:184:3:
note: in expansion of macro '__v4l2_device_call_subdevs_p'
   __v4l2_device_call_subdevs_p(v4l2_dev, __sd,  \
   ^
/root/v4l2/media_build/v4l/au0828-video.c:1121:2: note: in expansion
of macro 'v4l2_device_call_all'
  v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_frequency, &f);
  ^
/root/v4l2/media_build/v4l/au0828-video.c: In function 'au0828_v4l2_poll':
/root/v4l2/media_build/v4l/au0828-video.c:1171:2: error: implicit
declaration of function 'poll_requested_events'
[-Werror=implicit-function-declaration]
  unsigned long req_events = poll_requested_events(wait);
  ^


On Sun, Jul 27, 2014 at 12:23 PM, Hans Verkuil <hverkuil@xs4all.nl> wrote:
> On 07/27/2014 08:47 AM, Isaac Nickaein wrote:
>> Hello,
>>
>> I get the following error when I try to build the V4L2 on Kernel
>> 3.0.36+ for ARM architecture:
>>
>> /root/v4l2/media_build/v4l/altera.c:2417:5: error: redefinition of 'altera_init'
>>  int altera_init(struct altera_config *config, const struct firmware *fw)
>>      ^
>> In file included from /root/v4l2/media_build/v4l/altera.c:32:0:
>> /root/v4l2/media_build/v4l/../linux/include/misc/altera.h:41:19: note:
>> previous definition of 'altera_init' was here
>>  static inline int altera_init(struct altera_config *config,
>>                    ^
>>
>>
>> I checked the altera.h code and apparently, the IS_ENABLED macro is
>> not defined and causes this problem. I have prepared kernel source at
>> /lib/modules/3.0.36+/build/ and it builds successfully.
>>
>> Can anyone help me on this issue?
>
> What kernel tree are you using? There is no IS_ENABLED in 3.0, so apparently
> you have a patched kernel. Do you actually need that altera driver? If not,
> then why not disable it in the kernel config?
>
> Regards,
>
>         Hans

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

* Re: "error: redefinition of 'altera_init'" during build on Kernel 3.0.36+
  2014-07-27  8:18   ` Isaac Nickaein
@ 2014-07-27  8:26     ` Hans Verkuil
  2014-07-27  8:42       ` Isaac Nickaein
  0 siblings, 1 reply; 7+ messages in thread
From: Hans Verkuil @ 2014-07-27  8:26 UTC (permalink / raw)
  To: Isaac Nickaein; +Cc: linux-media

On 07/27/2014 10:18 AM, Isaac Nickaein wrote:
> Hi Hans,
> 
> I am using Kernel 3.0.36+ download from this repository:
> https://github.com/linux-rockchip/kernel_rockchip
> It's a fork of https://github.com/rkchrome/kernel
> 
> I guess I don't need that driver. After disabling it through
> menuconfig, I get this error:
> 
> 
> In file included from
> /root/v4l2/media_build/v4l/../linux/include/media/v4l2-subdev.h:30:0,
>                  from
> /root/v4l2/media_build/v4l/../linux/include/media/v4l2-device.h:25,
>                  from /root/v4l2/media_build/v4l/au0828.h:30,
>                  from /root/v4l2/media_build/v4l/au0828-core.c:28:
> /root/v4l2/media_build/v4l/../linux/include/media/v4l2-fh.h:49:5:
> warning: "IS_ENABLED" is not defined [-Wundef]
>  #if IS_ENABLED(CONFIG_V4L2_MEM2MEM_DEV)
>      ^
> /root/v4l2/media_build/v4l/../linux/include/media/v4l2-fh.h:49:15:
> error: missing binary operator before token "("
>  #if IS_ENABLED(CONFIG_V4L2_MEM2MEM_DEV)
>                ^
> 
> And apparently yes, there is some issue with IS_ENABLED. Doesn't V4L2
> apply patches to be compatible with older kernels (e.g. 3.0)?

No. Whoever maintains that repository applied v4l code from some newer
kernel without apparently ever testing it. This is really the responsibility
of maintainer of that repository and is out of our control.

You need to address your questions to that repository maintainer, we can't
help, I'm afraid.

Regards,

	Hans

> 
> To bypass this error, I manually added these two includes to
> v4l2-.fh.h file (I guess this is not a good approach):
> 
> #include <linux/module.h>
> #include <linux/export.h>
> 
> Now when I run make, I get different errors. Here is the output
> truncated to 100 lines (there are many errors):
> 
> 
> root@localhost:~/v4l2/media_build# make
> make -C /root/v4l2/media_build/v4l
> make[1]: Entering directory `/root/v4l2/media_build/v4l'
> creating symbolic links...
> make -C firmware prep
> make[2]: Entering directory `/root/v4l2/media_build/v4l/firmware'
> make[2]: Leaving directory `/root/v4l2/media_build/v4l/firmware'
> make -C firmware
> make[2]: Entering directory `/root/v4l2/media_build/v4l/firmware'
> make[2]: Nothing to be done for `default'.
> make[2]: Leaving directory `/root/v4l2/media_build/v4l/firmware'
> Kernel build directory is /lib/modules/3.0.36+/build
> make -C ../linux apply_patches
> make[2]: Entering directory `/root/v4l2/media_build/linux'
> Patches for 3.0.36+ already applied.
> make[2]: Leaving directory `/root/v4l2/media_build/linux'
> make -C /lib/modules/3.0.36+/build SUBDIRS=/root/v4l2/media_build/v4l  modules
> make[2]: Entering directory `/lib/modules/3.0.36+/build'
>   CC [M]  /root/v4l2/media_build/v4l/au0828-video.o
> In file included from include/linux/cache.h:4:0,
>                  from include/linux/time.h:7,
>                  from include/linux/stat.h:60,
>                  from include/linux/module.h:10,
>                  from /root/v4l2/media_build/v4l/au0828-video.c:31:
> /root/v4l2/media_build/v4l/au0828-video.c: In function 'au0828_v4l2_close':
> /root/v4l2/media_build/v4l/au0828-video.c:1086:28: error: 'struct
> au0828_dev' has no member named 'v4l2_dev'
>    v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_power, 0);
>                             ^
> include/linux/kernel.h:659:49: note: in definition of macro 'container_of'
>   const typeof( ((type *)0)->member ) *__mptr = (ptr); \
>                                                  ^
> include/linux/list.h:419:13: note: in expansion of macro 'list_entry'
>   for (pos = list_entry((head)->next, typeof(*pos), member); \
>              ^
> /root/v4l2/media_build/v4l/../linux/include/media/v4l2-device.h:140:3:
> note: in expansion of macro 'list_for_each_entry'
>    list_for_each_entry((sd), &(v4l2_dev)->subdevs, list) \
>    ^
> /root/v4l2/media_build/v4l/../linux/include/media/v4l2-device.h:184:3:
> note: in expansion of macro '__v4l2_device_call_subdevs_p'
>    __v4l2_device_call_subdevs_p(v4l2_dev, __sd,  \
>    ^
> /root/v4l2/media_build/v4l/au0828-video.c:1086:3: note: in expansion
> of macro 'v4l2_device_call_all'
>    v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_power, 0);
>    ^
> In file included from include/linux/module.h:9:0,
>                  from /root/v4l2/media_build/v4l/au0828-video.c:31:
> /root/v4l2/media_build/v4l/au0828-video.c:1086:28: error: 'struct
> au0828_dev' has no member named 'v4l2_dev'
>    v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_power, 0);
>                             ^
> include/linux/list.h:420:24: note: in definition of macro 'list_for_each_entry'
>        &pos->member != (head);  \
>                         ^
> /root/v4l2/media_build/v4l/../linux/include/media/v4l2-device.h:184:3:
> note: in expansion of macro '__v4l2_device_call_subdevs_p'
>    __v4l2_device_call_subdevs_p(v4l2_dev, __sd,  \
>    ^
> /root/v4l2/media_build/v4l/au0828-video.c:1086:3: note: in expansion
> of macro 'v4l2_device_call_all'
>    v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_power, 0);
>    ^
> In file included from include/linux/cache.h:4:0,
>                  from include/linux/time.h:7,
>                  from include/linux/stat.h:60,
>                  from include/linux/module.h:10,
>                  from /root/v4l2/media_build/v4l/au0828-video.c:31:
> /root/v4l2/media_build/v4l/au0828-video.c: In function 'au0828_init_tuner':
> /root/v4l2/media_build/v4l/au0828-video.c:1120:27: error: 'struct
> au0828_dev' has no member named 'v4l2_dev'
>   v4l2_device_call_all(&dev->v4l2_dev, 0, video, s_std, dev->std);
>                            ^
> include/linux/kernel.h:659:49: note: in definition of macro 'container_of'
>   const typeof( ((type *)0)->member ) *__mptr = (ptr); \
>                                                  ^
> include/linux/list.h:419:13: note: in expansion of macro 'list_entry'
>   for (pos = list_entry((head)->next, typeof(*pos), member); \
>              ^
> /root/v4l2/media_build/v4l/../linux/include/media/v4l2-device.h:140:3:
> note: in expansion of macro 'list_for_each_entry'
>    list_for_each_entry((sd), &(v4l2_dev)->subdevs, list) \
>    ^
> /root/v4l2/media_build/v4l/../linux/include/media/v4l2-device.h:184:3:
> note: in expansion of macro '__v4l2_device_call_subdevs_p'
>    __v4l2_device_call_subdevs_p(v4l2_dev, __sd,  \
>    ^
> /root/v4l2/media_build/v4l/au0828-video.c:1120:2: note: in expansion
> of macro 'v4l2_device_call_all'
>   v4l2_device_call_all(&dev->v4l2_dev, 0, video, s_std, dev->std);
>   ^
> In file included from include/linux/module.h:9:0,
>                  from /root/v4l2/media_build/v4l/au0828-video.c:31:
> /root/v4l2/media_build/v4l/au0828-video.c:1120:27: error: 'struct
> au0828_dev' has no member named 'v4l2_dev'
>   v4l2_device_call_all(&dev->v4l2_dev, 0, video, s_std, dev->std);
>                            ^
> include/linux/list.h:420:24: note: in definition of macro 'list_for_each_entry'
>        &pos->member != (head);  \
>                         ^
> /root/v4l2/media_build/v4l/../linux/include/media/v4l2-device.h:184:3:
> note: in expansion of macro '__v4l2_device_call_subdevs_p'
>    __v4l2_device_call_subdevs_p(v4l2_dev, __sd,  \
>    ^
> /root/v4l2/media_build/v4l/au0828-video.c:1120:2: note: in expansion
> of macro 'v4l2_device_call_all'
>   v4l2_device_call_all(&dev->v4l2_dev, 0, video, s_std, dev->std);
>   ^
> In file included from include/linux/cache.h:4:0,
>                  from include/linux/time.h:7,
>                  from include/linux/stat.h:60,
>                  from include/linux/module.h:10,
>                  from /root/v4l2/media_build/v4l/au0828-video.c:31:
> /root/v4l2/media_build/v4l/au0828-video.c:1121:27: error: 'struct
> au0828_dev' has no member named 'v4l2_dev'
>   v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_frequency, &f);
>                            ^
> include/linux/kernel.h:659:49: note: in definition of macro 'container_of'
>   const typeof( ((type *)0)->member ) *__mptr = (ptr); \
>                                                  ^
> include/linux/list.h:419:13: note: in expansion of macro 'list_entry'
>   for (pos = list_entry((head)->next, typeof(*pos), member); \
>              ^
> /root/v4l2/media_build/v4l/../linux/include/media/v4l2-device.h:140:3:
> note: in expansion of macro 'list_for_each_entry'
>    list_for_each_entry((sd), &(v4l2_dev)->subdevs, list) \
>    ^
> /root/v4l2/media_build/v4l/../linux/include/media/v4l2-device.h:184:3:
> note: in expansion of macro '__v4l2_device_call_subdevs_p'
>    __v4l2_device_call_subdevs_p(v4l2_dev, __sd,  \
>    ^
> /root/v4l2/media_build/v4l/au0828-video.c:1121:2: note: in expansion
> of macro 'v4l2_device_call_all'
>   v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_frequency, &f);
>   ^
> In file included from include/linux/module.h:9:0,
>                  from /root/v4l2/media_build/v4l/au0828-video.c:31:
> /root/v4l2/media_build/v4l/au0828-video.c:1121:27: error: 'struct
> au0828_dev' has no member named 'v4l2_dev'
>   v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_frequency, &f);
>                            ^
> include/linux/list.h:420:24: note: in definition of macro 'list_for_each_entry'
>        &pos->member != (head);  \
>                         ^
> /root/v4l2/media_build/v4l/../linux/include/media/v4l2-device.h:184:3:
> note: in expansion of macro '__v4l2_device_call_subdevs_p'
>    __v4l2_device_call_subdevs_p(v4l2_dev, __sd,  \
>    ^
> /root/v4l2/media_build/v4l/au0828-video.c:1121:2: note: in expansion
> of macro 'v4l2_device_call_all'
>   v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_frequency, &f);
>   ^
> /root/v4l2/media_build/v4l/au0828-video.c: In function 'au0828_v4l2_poll':
> /root/v4l2/media_build/v4l/au0828-video.c:1171:2: error: implicit
> declaration of function 'poll_requested_events'
> [-Werror=implicit-function-declaration]
>   unsigned long req_events = poll_requested_events(wait);
>   ^
> 
> 
> On Sun, Jul 27, 2014 at 12:23 PM, Hans Verkuil <hverkuil@xs4all.nl> wrote:
>> On 07/27/2014 08:47 AM, Isaac Nickaein wrote:
>>> Hello,
>>>
>>> I get the following error when I try to build the V4L2 on Kernel
>>> 3.0.36+ for ARM architecture:
>>>
>>> /root/v4l2/media_build/v4l/altera.c:2417:5: error: redefinition of 'altera_init'
>>>  int altera_init(struct altera_config *config, const struct firmware *fw)
>>>      ^
>>> In file included from /root/v4l2/media_build/v4l/altera.c:32:0:
>>> /root/v4l2/media_build/v4l/../linux/include/misc/altera.h:41:19: note:
>>> previous definition of 'altera_init' was here
>>>  static inline int altera_init(struct altera_config *config,
>>>                    ^
>>>
>>>
>>> I checked the altera.h code and apparently, the IS_ENABLED macro is
>>> not defined and causes this problem. I have prepared kernel source at
>>> /lib/modules/3.0.36+/build/ and it builds successfully.
>>>
>>> Can anyone help me on this issue?
>>
>> What kernel tree are you using? There is no IS_ENABLED in 3.0, so apparently
>> you have a patched kernel. Do you actually need that altera driver? If not,
>> then why not disable it in the kernel config?
>>
>> Regards,
>>
>>         Hans
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


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

* Re: "error: redefinition of 'altera_init'" during build on Kernel 3.0.36+
  2014-07-27  8:26     ` Hans Verkuil
@ 2014-07-27  8:42       ` Isaac Nickaein
  2014-07-27  9:00         ` Hans Verkuil
  0 siblings, 1 reply; 7+ messages in thread
From: Isaac Nickaein @ 2014-07-27  8:42 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: linux-media

On Sun, Jul 27, 2014 at 12:56 PM, Hans Verkuil <hverkuil@xs4all.nl> wrote:
> No. Whoever maintains that repository applied v4l code from some newer
> kernel without apparently ever testing it. This is really the responsibility
> of maintainer of that repository and is out of our control.
>
> You need to address your questions to that repository maintainer, we can't
> help, I'm afraid.
>

Ah I see. I have some issues with v4l2 on this kernel version and I am
trying to upgrade v4l2 to fix that.

One last question: Can I remove current v4l codes in kernel, replace
them with the V4L2 backport (provided by linuxtv), fix the
compatibility issues (hopefully) to get a kernel source with newer
v4l2 code?

I am not sure if the v4l2 backport is the same type of code that is
present in kernel source at "drivers/media/video",
"drivers/media/dvb", etc.


Thanks,
Isaac


> Regards,
>
>         Hans
>
>>
>> To bypass this error, I manually added these two includes to
>> v4l2-.fh.h file (I guess this is not a good approach):
>>
>> #include <linux/module.h>
>> #include <linux/export.h>
>>
>> Now when I run make, I get different errors. Here is the output
>> truncated to 100 lines (there are many errors):
>>
>>
>> root@localhost:~/v4l2/media_build# make
>> make -C /root/v4l2/media_build/v4l
>> make[1]: Entering directory `/root/v4l2/media_build/v4l'
>> creating symbolic links...
>> make -C firmware prep
>> make[2]: Entering directory `/root/v4l2/media_build/v4l/firmware'
>> make[2]: Leaving directory `/root/v4l2/media_build/v4l/firmware'
>> make -C firmware
>> make[2]: Entering directory `/root/v4l2/media_build/v4l/firmware'
>> make[2]: Nothing to be done for `default'.
>> make[2]: Leaving directory `/root/v4l2/media_build/v4l/firmware'
>> Kernel build directory is /lib/modules/3.0.36+/build
>> make -C ../linux apply_patches
>> make[2]: Entering directory `/root/v4l2/media_build/linux'
>> Patches for 3.0.36+ already applied.
>> make[2]: Leaving directory `/root/v4l2/media_build/linux'
>> make -C /lib/modules/3.0.36+/build SUBDIRS=/root/v4l2/media_build/v4l  modules
>> make[2]: Entering directory `/lib/modules/3.0.36+/build'
>>   CC [M]  /root/v4l2/media_build/v4l/au0828-video.o
>> In file included from include/linux/cache.h:4:0,
>>                  from include/linux/time.h:7,
>>                  from include/linux/stat.h:60,
>>                  from include/linux/module.h:10,
>>                  from /root/v4l2/media_build/v4l/au0828-video.c:31:
>> /root/v4l2/media_build/v4l/au0828-video.c: In function 'au0828_v4l2_close':
>> /root/v4l2/media_build/v4l/au0828-video.c:1086:28: error: 'struct
>> au0828_dev' has no member named 'v4l2_dev'
>>    v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_power, 0);
>>                             ^
>> include/linux/kernel.h:659:49: note: in definition of macro 'container_of'
>>   const typeof( ((type *)0)->member ) *__mptr = (ptr); \
>>                                                  ^
>> include/linux/list.h:419:13: note: in expansion of macro 'list_entry'
>>   for (pos = list_entry((head)->next, typeof(*pos), member); \
>>              ^
>> /root/v4l2/media_build/v4l/../linux/include/media/v4l2-device.h:140:3:
>> note: in expansion of macro 'list_for_each_entry'
>>    list_for_each_entry((sd), &(v4l2_dev)->subdevs, list) \
>>    ^
>> /root/v4l2/media_build/v4l/../linux/include/media/v4l2-device.h:184:3:
>> note: in expansion of macro '__v4l2_device_call_subdevs_p'
>>    __v4l2_device_call_subdevs_p(v4l2_dev, __sd,  \
>>    ^
>> /root/v4l2/media_build/v4l/au0828-video.c:1086:3: note: in expansion
>> of macro 'v4l2_device_call_all'
>>    v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_power, 0);
>>    ^
>> In file included from include/linux/module.h:9:0,
>>                  from /root/v4l2/media_build/v4l/au0828-video.c:31:
>> /root/v4l2/media_build/v4l/au0828-video.c:1086:28: error: 'struct
>> au0828_dev' has no member named 'v4l2_dev'
>>    v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_power, 0);
>>                             ^
>> include/linux/list.h:420:24: note: in definition of macro 'list_for_each_entry'
>>        &pos->member != (head);  \
>>                         ^
>> /root/v4l2/media_build/v4l/../linux/include/media/v4l2-device.h:184:3:
>> note: in expansion of macro '__v4l2_device_call_subdevs_p'
>>    __v4l2_device_call_subdevs_p(v4l2_dev, __sd,  \
>>    ^
>> /root/v4l2/media_build/v4l/au0828-video.c:1086:3: note: in expansion
>> of macro 'v4l2_device_call_all'
>>    v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_power, 0);
>>    ^
>> In file included from include/linux/cache.h:4:0,
>>                  from include/linux/time.h:7,
>>                  from include/linux/stat.h:60,
>>                  from include/linux/module.h:10,
>>                  from /root/v4l2/media_build/v4l/au0828-video.c:31:
>> /root/v4l2/media_build/v4l/au0828-video.c: In function 'au0828_init_tuner':
>> /root/v4l2/media_build/v4l/au0828-video.c:1120:27: error: 'struct
>> au0828_dev' has no member named 'v4l2_dev'
>>   v4l2_device_call_all(&dev->v4l2_dev, 0, video, s_std, dev->std);
>>                            ^
>> include/linux/kernel.h:659:49: note: in definition of macro 'container_of'
>>   const typeof( ((type *)0)->member ) *__mptr = (ptr); \
>>                                                  ^
>> include/linux/list.h:419:13: note: in expansion of macro 'list_entry'
>>   for (pos = list_entry((head)->next, typeof(*pos), member); \
>>              ^
>> /root/v4l2/media_build/v4l/../linux/include/media/v4l2-device.h:140:3:
>> note: in expansion of macro 'list_for_each_entry'
>>    list_for_each_entry((sd), &(v4l2_dev)->subdevs, list) \
>>    ^
>> /root/v4l2/media_build/v4l/../linux/include/media/v4l2-device.h:184:3:
>> note: in expansion of macro '__v4l2_device_call_subdevs_p'
>>    __v4l2_device_call_subdevs_p(v4l2_dev, __sd,  \
>>    ^
>> /root/v4l2/media_build/v4l/au0828-video.c:1120:2: note: in expansion
>> of macro 'v4l2_device_call_all'
>>   v4l2_device_call_all(&dev->v4l2_dev, 0, video, s_std, dev->std);
>>   ^
>> In file included from include/linux/module.h:9:0,
>>                  from /root/v4l2/media_build/v4l/au0828-video.c:31:
>> /root/v4l2/media_build/v4l/au0828-video.c:1120:27: error: 'struct
>> au0828_dev' has no member named 'v4l2_dev'
>>   v4l2_device_call_all(&dev->v4l2_dev, 0, video, s_std, dev->std);
>>                            ^
>> include/linux/list.h:420:24: note: in definition of macro 'list_for_each_entry'
>>        &pos->member != (head);  \
>>                         ^
>> /root/v4l2/media_build/v4l/../linux/include/media/v4l2-device.h:184:3:
>> note: in expansion of macro '__v4l2_device_call_subdevs_p'
>>    __v4l2_device_call_subdevs_p(v4l2_dev, __sd,  \
>>    ^
>> /root/v4l2/media_build/v4l/au0828-video.c:1120:2: note: in expansion
>> of macro 'v4l2_device_call_all'
>>   v4l2_device_call_all(&dev->v4l2_dev, 0, video, s_std, dev->std);
>>   ^
>> In file included from include/linux/cache.h:4:0,
>>                  from include/linux/time.h:7,
>>                  from include/linux/stat.h:60,
>>                  from include/linux/module.h:10,
>>                  from /root/v4l2/media_build/v4l/au0828-video.c:31:
>> /root/v4l2/media_build/v4l/au0828-video.c:1121:27: error: 'struct
>> au0828_dev' has no member named 'v4l2_dev'
>>   v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_frequency, &f);
>>                            ^
>> include/linux/kernel.h:659:49: note: in definition of macro 'container_of'
>>   const typeof( ((type *)0)->member ) *__mptr = (ptr); \
>>                                                  ^
>> include/linux/list.h:419:13: note: in expansion of macro 'list_entry'
>>   for (pos = list_entry((head)->next, typeof(*pos), member); \
>>              ^
>> /root/v4l2/media_build/v4l/../linux/include/media/v4l2-device.h:140:3:
>> note: in expansion of macro 'list_for_each_entry'
>>    list_for_each_entry((sd), &(v4l2_dev)->subdevs, list) \
>>    ^
>> /root/v4l2/media_build/v4l/../linux/include/media/v4l2-device.h:184:3:
>> note: in expansion of macro '__v4l2_device_call_subdevs_p'
>>    __v4l2_device_call_subdevs_p(v4l2_dev, __sd,  \
>>    ^
>> /root/v4l2/media_build/v4l/au0828-video.c:1121:2: note: in expansion
>> of macro 'v4l2_device_call_all'
>>   v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_frequency, &f);
>>   ^
>> In file included from include/linux/module.h:9:0,
>>                  from /root/v4l2/media_build/v4l/au0828-video.c:31:
>> /root/v4l2/media_build/v4l/au0828-video.c:1121:27: error: 'struct
>> au0828_dev' has no member named 'v4l2_dev'
>>   v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_frequency, &f);
>>                            ^
>> include/linux/list.h:420:24: note: in definition of macro 'list_for_each_entry'
>>        &pos->member != (head);  \
>>                         ^
>> /root/v4l2/media_build/v4l/../linux/include/media/v4l2-device.h:184:3:
>> note: in expansion of macro '__v4l2_device_call_subdevs_p'
>>    __v4l2_device_call_subdevs_p(v4l2_dev, __sd,  \
>>    ^
>> /root/v4l2/media_build/v4l/au0828-video.c:1121:2: note: in expansion
>> of macro 'v4l2_device_call_all'
>>   v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_frequency, &f);
>>   ^
>> /root/v4l2/media_build/v4l/au0828-video.c: In function 'au0828_v4l2_poll':
>> /root/v4l2/media_build/v4l/au0828-video.c:1171:2: error: implicit
>> declaration of function 'poll_requested_events'
>> [-Werror=implicit-function-declaration]
>>   unsigned long req_events = poll_requested_events(wait);
>>   ^
>>
>>
>> On Sun, Jul 27, 2014 at 12:23 PM, Hans Verkuil <hverkuil@xs4all.nl> wrote:
>>> On 07/27/2014 08:47 AM, Isaac Nickaein wrote:
>>>> Hello,
>>>>
>>>> I get the following error when I try to build the V4L2 on Kernel
>>>> 3.0.36+ for ARM architecture:
>>>>
>>>> /root/v4l2/media_build/v4l/altera.c:2417:5: error: redefinition of 'altera_init'
>>>>  int altera_init(struct altera_config *config, const struct firmware *fw)
>>>>      ^
>>>> In file included from /root/v4l2/media_build/v4l/altera.c:32:0:
>>>> /root/v4l2/media_build/v4l/../linux/include/misc/altera.h:41:19: note:
>>>> previous definition of 'altera_init' was here
>>>>  static inline int altera_init(struct altera_config *config,
>>>>                    ^
>>>>
>>>>
>>>> I checked the altera.h code and apparently, the IS_ENABLED macro is
>>>> not defined and causes this problem. I have prepared kernel source at
>>>> /lib/modules/3.0.36+/build/ and it builds successfully.
>>>>
>>>> Can anyone help me on this issue?
>>>
>>> What kernel tree are you using? There is no IS_ENABLED in 3.0, so apparently
>>> you have a patched kernel. Do you actually need that altera driver? If not,
>>> then why not disable it in the kernel config?
>>>
>>> Regards,
>>>
>>>         Hans
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-media" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>

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

* Re: "error: redefinition of 'altera_init'" during build on Kernel 3.0.36+
  2014-07-27  8:42       ` Isaac Nickaein
@ 2014-07-27  9:00         ` Hans Verkuil
  2014-07-27  9:36           ` Isaac Nickaein
  0 siblings, 1 reply; 7+ messages in thread
From: Hans Verkuil @ 2014-07-27  9:00 UTC (permalink / raw)
  To: Isaac Nickaein; +Cc: linux-media

On 07/27/2014 10:42 AM, Isaac Nickaein wrote:
> On Sun, Jul 27, 2014 at 12:56 PM, Hans Verkuil <hverkuil@xs4all.nl> wrote:
>> No. Whoever maintains that repository applied v4l code from some newer
>> kernel without apparently ever testing it. This is really the responsibility
>> of maintainer of that repository and is out of our control.
>>
>> You need to address your questions to that repository maintainer, we can't
>> help, I'm afraid.
>>
> 
> Ah I see. I have some issues with v4l2 on this kernel version and I am
> trying to upgrade v4l2 to fix that.
> 
> One last question: Can I remove current v4l codes in kernel, replace
> them with the V4L2 backport (provided by linuxtv), fix the
> compatibility issues (hopefully) to get a kernel source with newer
> v4l2 code?
> 
> I am not sure if the v4l2 backport is the same type of code that is
> present in kernel source at "drivers/media/video",
> "drivers/media/dvb", etc.

Yes, you can, but it isn't easy.

In this repo:

http://git.linuxtv.org/cgit.cgi/hverkuil/cisco_build.git/tree/?h=cobalt-mainline

there is a patch-kernel.sh script that can patch a vendor kernel with the v4l
code from a fairly recent stable kernel (I think it is good for 3.14, I don't
know if it can backport from a 3.15 kernel).

You need to set the target, orig_source and source paths correctly and then
run it.

You end up with a huge patch that you can apply to your kernel.

It's probably still not enough since you may have to add compat code from
v4l/compat.h to the drivers you want to compile in. It depends on what
drivers you want to compile how much work that is.

I'm not going to give support for this, so you're on your own. The repo
owner really should fix his tree.

Regards,

	Hans

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

* Re: "error: redefinition of 'altera_init'" during build on Kernel 3.0.36+
  2014-07-27  9:00         ` Hans Verkuil
@ 2014-07-27  9:36           ` Isaac Nickaein
  0 siblings, 0 replies; 7+ messages in thread
From: Isaac Nickaein @ 2014-07-27  9:36 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: linux-media

Hi Hans,

I understand. I will get in touch with the maintainer to see how we
can fix this issue.

Thank you so much for the help,
Isaac


On Sun, Jul 27, 2014 at 1:30 PM, Hans Verkuil <hverkuil@xs4all.nl> wrote:
> On 07/27/2014 10:42 AM, Isaac Nickaein wrote:
>> On Sun, Jul 27, 2014 at 12:56 PM, Hans Verkuil <hverkuil@xs4all.nl> wrote:
>>> No. Whoever maintains that repository applied v4l code from some newer
>>> kernel without apparently ever testing it. This is really the responsibility
>>> of maintainer of that repository and is out of our control.
>>>
>>> You need to address your questions to that repository maintainer, we can't
>>> help, I'm afraid.
>>>
>>
>> Ah I see. I have some issues with v4l2 on this kernel version and I am
>> trying to upgrade v4l2 to fix that.
>>
>> One last question: Can I remove current v4l codes in kernel, replace
>> them with the V4L2 backport (provided by linuxtv), fix the
>> compatibility issues (hopefully) to get a kernel source with newer
>> v4l2 code?
>>
>> I am not sure if the v4l2 backport is the same type of code that is
>> present in kernel source at "drivers/media/video",
>> "drivers/media/dvb", etc.
>
> Yes, you can, but it isn't easy.
>
> In this repo:
>
> http://git.linuxtv.org/cgit.cgi/hverkuil/cisco_build.git/tree/?h=cobalt-mainline
>
> there is a patch-kernel.sh script that can patch a vendor kernel with the v4l
> code from a fairly recent stable kernel (I think it is good for 3.14, I don't
> know if it can backport from a 3.15 kernel).
>
> You need to set the target, orig_source and source paths correctly and then
> run it.
>
> You end up with a huge patch that you can apply to your kernel.
>
> It's probably still not enough since you may have to add compat code from
> v4l/compat.h to the drivers you want to compile in. It depends on what
> drivers you want to compile how much work that is.
>
> I'm not going to give support for this, so you're on your own. The repo
> owner really should fix his tree.
>
> Regards,
>
>         Hans

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

end of thread, other threads:[~2014-07-27  9:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-27  6:47 "error: redefinition of 'altera_init'" during build on Kernel 3.0.36+ Isaac Nickaein
2014-07-27  7:53 ` Hans Verkuil
2014-07-27  8:18   ` Isaac Nickaein
2014-07-27  8:26     ` Hans Verkuil
2014-07-27  8:42       ` Isaac Nickaein
2014-07-27  9:00         ` Hans Verkuil
2014-07-27  9:36           ` Isaac Nickaein

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox