ljalves / linux_media

TBS linux open source drivers
https://github.com/ljalves/linux_media/wiki
Other
89 stars 150 forks source link

Problem compiling with kernel 4.3.3 #115

Closed zofiel closed 8 years ago

zofiel commented 8 years ago

I have the following error when perform the make command:

CC [M] /home/userssh/media_build/v4l/adp1653.o /home/userssh/media_build/v4l/adp1653.c: In function 'adp1653_of_init': /home/userssh/media_build/v4l/adp1653.c:468:20: error: too few arguments to function 'devm_gpiod_get' pd->enable_gpio = devm_gpiod_get(&client->dev, "enable"); ^ In file included from /home/userssh/media_build/v4l/adp1653.c:39:0: include/linux/gpio/consumer.h:73:32: note: declared here struct gpio_desc ___must_check devm_gpiod_get(struct device dev, ^ scripts/Makefile.build:264: fallo en las instrucciones para el objetivo '/home/userssh/media_build/v4l/adp1653.o' make[3]: _* [/home/userssh/media_build/v4l/adp1653.o] Error 1 Makefile:1378: recipe for target 'module/home/userssh/media_build/v4l' failed make[2]: * [module/home/userssh/media_build/v4l] Error 2 make[2]: Leaving directory '/usr/lib/modules/4.3.3-2-ARCH/build' Makefile:51: fallo en las instrucciones para el objetivo 'default' make[1]: * [default] Error 2 make[1]: se sale del directorio '/home/userssh/media_build/v4l' Makefile:26: fallo en las instrucciones para el objetivo 'all' make: *\ [all] Error 2

BBUK commented 8 years ago

Hi there.

On looking at the kernel sources, it seems that a preprocessor directive that was inserted for compatibility reasons was removed in 4.3. if you are comfortable in editing source files, there is something you could try as an experiment. Navigate to line 468 in the file (from your system) /home/userssh/media_build/v4l/adp1653.c and change:

pd->enable_gpio = devm_gpiod_get(&client->dev, "enable");

to

pd->enable_gpio = devm_gpiod_get(&client->dev, "enable", GPIOD_ASIS);

If it does not work, let me know here (with any reported errors) and I'll try to build/fix myself (I will have to create a test system, so it will not be quick).

If it does work, please post back here so that everyone (including me) can benefit.

Bear in mind that I have no experience of the innards of this driver - I am just a very satisfied user shortly to commence my own 4.3 upgrade. If this works, I'll submit a patch to ljalves (who deserves a load of credit here).

HTH

BBUK

UPDATE: My bad, it seems the file I said to edit above is in the wrong tree. The file to edit is (from your system) /home/userssh/media/drivers/media/i2c/adp1653.c. You might need to follow the install steps again from make dir DIR=../media again.

By the way, I tried to build this from 4.2 after making this change and it was still OK (hence an easy change to make without breaking back compatibility) BUT from looking at the kernel sources, this change could break builds on kernels earlier than 3.17 so to maintain compatibility there some more #if trickery will be required.

pslijkhuis commented 8 years ago

This works for me.

zofiel commented 8 years ago

sorry for the delay.

I tried with last kernel and now the error is:

/home/userssh/media_build/v4l/cx23885-core.c: In function 'cx23885_initdev': /home/userssh/media_build/v4l/cx23885-core.c:1993:7: error: implicit declaration of function 'pci_dma_supported' [-Werror=implicit-function-declaration] if (!pci_dma_supported(pci_dev, 0xffffffff)) { ^ cc1: some warnings being treated as errors scripts/Makefile.build:258: fallo en las instrucciones para el objetivo '/home/userssh/media_build/v4l/cx23885-core.o'

So This issue is solved with the workaround

ljalves commented 8 years ago

PR #119 merged. Should fix this issue.