daniel-santos / mcp2210-linux

MCP2210 driver for linux
http://danielthesantos.blogspot.com/search/label/mcp2210
51 stars 31 forks source link

`make modules` fails on master on 4.2.6-301.fc23.x86_64 #18

Closed ToBeReplaced closed 8 years ago

ToBeReplaced commented 8 years ago

I'm not very familiar with this kind of work, so unfortunately all I have for you is a traceback. Maybe I'm missing a required package?

[example@example mcp2210-linux]$ make modules
make -C /lib/modules/4.2.6-301.fc23.x86_64/build M=/home/example/mcp2210-linux modules
make[1]: Entering directory '/usr/src/kernels/4.2.6-301.fc23.x86_64'
  CC [M]  /home/example/mcp2210-linux/mcp2210-gpio.o
/home/example/mcp2210-linux/mcp2210-gpio.c: In function ‘mcp2210_gpio_probe’:
/home/example/mcp2210-linux/mcp2210-gpio.c:101:6: error: ‘struct gpio_chip’ has no member named ‘exported’
  gpio->exported  = 0;
      ^
/home/example/mcp2210-linux/mcp2210-gpio.c: In function ‘mcp2210_gpio_remove’:
/home/example/mcp2210-linux/mcp2210-gpio.c:123:6: error: void value not ignored as it ought to be
  ret = gpiochip_remove(&dev->gpio);
      ^
scripts/Makefile.build:258: recipe for target '/home/example/mcp2210-linux/mcp2210-gpio.o' failed
make[2]: *** [/home/example/mcp2210-linux/mcp2210-gpio.o] Error 1
Makefile:1390: recipe for target '_module_/home/example/mcp2210-linux' failed
make[1]: *** [_module_/home/example/mcp2210-linux] Error 2
make[1]: Leaving directory '/usr/src/kernels/4.2.6-301.fc23.x86_64'
Makefile:31: recipe for target 'modules' failed
make: *** [modules] Error 2

If I remove the corresponding lines for curiosity, then:

[example@example mcp2210-linux]$ make modules
make -C /lib/modules/4.2.6-301.fc23.x86_64/build M=/home/example/mcp2210-linux modules
make[1]: Entering directory '/usr/src/kernels/4.2.6-301.fc23.x86_64'
  CC [M]  /home/example/mcp2210-linux/mcp2210-gpio.o
  LD [M]  /home/example/mcp2210-linux/mcp2210.o
  Building modules, stage 2.
  MODPOST 1 modules
WARNING: "spi_register_master" [/home/example/mcp2210-linux/mcp2210.ko] undefined!
WARNING: "spi_unregister_master" [/home/example/mcp2210-linux/mcp2210.ko] undefined!
WARNING: "spi_alloc_master" [/home/example/mcp2210-linux/mcp2210.ko] undefined!
WARNING: "spi_alloc_device" [/home/example/mcp2210-linux/mcp2210.ko] undefined!
WARNING: "spi_add_device" [/home/example/mcp2210-linux/mcp2210.ko] undefined!
  LD [M]  /home/example/mcp2210-linux/mcp2210.ko
make[1]: Leaving directory '/usr/src/kernels/4.2.6-301.fc23.x86_64'
ToBeReplaced commented 8 years ago

On CentOS 7.x (3.10.0-229.20.1.el7.x86_64):

[example@example mcp2210-linux]$ make modules
make -C /lib/modules/3.10.0-229.20.1.el7.x86_64/build M=/home/example/mcp2210-linux modules
make[1]: Entering directory `/usr/src/kernels/3.10.0-229.20.1.el7.x86_64'
  CC [M]  /home/example/mcp2210-linux/mcp2210-core.o
In file included from /home/example/mcp2210-linux/mcp2210-core.c:233:0:
/home/example/mcp2210-linux/mcp2210.h:818:19: error: field ‘gpio’ has incomplete type
  struct gpio_chip gpio;
                   ^
make[2]: *** [/home/example/mcp2210-linux/mcp2210-core.o] Error 1
make[1]: *** [_module_/home/example/mcp2210-linux] Error 2
make[1]: Leaving directory `/usr/src/kernels/3.10.0-229.20.1.el7.x86_64'
make: *** [modules] Error 2

Maybe I should be asking what kernels you are using this on so that I can possibly make appropriate modifications for the kernels I'm using? CentOS 7.x support is my intended use case.

ToBeReplaced commented 8 years ago

So, among other things, spidev and gpio support was missing. The current kernel-plus package has the required modules, so you can now use this driver on CentOS 7.x! sudo yum --enablerepo centosplus install kernel-plus.