bsc-slave icon indicating copy to clipboard operation
bsc-slave copied to clipboard

compilation with latest kernel header

Open mungayree opened this issue 7 years ago • 0 comments

With latest rpi-update and compilation of this module generates many failures - below are some log messages -

pi@raspberrypi:~/bin/bsc-slave-master $ sudo make   
make -C /lib/modules/4.14.50+/build M=/home/pi/bin/bsc-slave-master modules
make[1]: Entering directory '/root/linux-11dc869d874d04293849d830637130269fd0ada9'
  CC [M]  /home/pi/bin/bsc-slave-master/bsc-slave.o
/home/pi/bin/bsc-slave-master/bsc-slave.c: In function ‘bcm2708_init_i2c_pinmode’:
/home/pi/bin/bsc-slave-master/bsc-slave.c:135:18: error: ‘GPIO_BASE’ undeclared (first use in this 
   function)
   gpio = ioremap(GPIO_BASE, SZ_16K);
              ^~~~~~~~~
 /home/pi/bin/bsc-slave-master/bsc-slave.c:135:18: note: each undeclared identifier is reported only 
   once for each function it appears in
 /home/pi/bin/bsc-slave-master/bsc-slave.c: In function ‘i2c_slave_read’:
 /home/pi/bin/bsc-slave-master/bsc-slave.c:316:8: error: implicit declaration of function 
  ‘signal_pending’ [-Werror=implicit-function-declaration]
       if(signal_pending(current))
           ^~~~~~~~~~~~~~
 /home/pi/bin/bsc-slave-master/bsc-slave.c:329:6: error: implicit declaration of function ‘copy_to_user’ 
 [-Werror=implicit-function-declaration]
     if(copy_to_user(buf, (char *)i2c_slave->rx_buf_tail, count))
        ^~~~~~~~~~~~
 /home/pi/bin/bsc-slave-master/bsc-slave.c: In function ‘i2c_slave_write’:
  /home/pi/bin/bsc-slave-master/bsc-slave.c:388:5: error: implicit declaration of function ‘copy_from_user’ [-Werror=implicit-function-declaration]
  if(copy_from_user((char *)i2c_slave->tx_buf_head, buf, count)){
      ^~~~~~~~~~~~~~
 In file included from ./include/linux/device.h:16:0,
             from ./include/linux/cdev.h:8,
             from /home/pi/bin/bsc-slave-master/bsc-slave.c:6:
  /home/pi/bin/bsc-slave-master/bsc-slave.c: In function ‘bcm2708_i2c_slave_init’:
  /home/pi/bin/bsc-slave-master/bsc-slave.c:28:35: error: ‘BCM2708_PERI_BASE’ undeclared (first use in this function)
  #define BSC_SLAVE_BASE           (BCM2708_PERI_BASE + 0x214000)
                               ^
 ./include/linux/ioport.h:223:77: note: in definition of macro ‘request_mem_region’
   #define request_mem_region(start,n,name) __request_region(&iomem_resource, (start), (n), (name), 0)
                                                                         ^~~~~
   /home/pi/bin/bsc-slave-master/bsc-slave.c:479:26: note: in expansion of macro ‘BSC_SLAVE_BASE’
      if(!request_mem_region(BSC_SLAVE_BASE, 64, DEVICE_NAME)){
                      ^~~~~~~~~~~~~~
    /home/pi/bin/bsc-slave-master/bsc-slave.c: In function ‘bcm2708_i2c_slave_cleanup’:
   /home/pi/bin/bsc-slave-master/bsc-slave.c:28:35: error: ‘BCM2708_PERI_BASE’ undeclared (first use in this function)
   #define BSC_SLAVE_BASE           (BCM2708_PERI_BASE + 0x214000)
                               ^
  .  /include/linux/ioport.h:235:72: note: in definition of macro ‘release_mem_region’
   #define release_mem_region(start,n) __release_region(&iomem_resource, (start), (n))
                                                                    ^~~~~
   /home/pi/bin/bsc-slave-master/bsc-slave.c:566:22: note: in expansion of macro ‘BSC_SLAVE_BASE’
      release_mem_region(BSC_SLAVE_BASE, 64);
                  ^~~~~~~~~~~~~~
   cc1: some warnings being treated as errors
  scripts/Makefile.build:334: recipe for target '/home/pi/bin/bsc-slave-master/bsc-slave.o' failed 
  make[2]: *** [/home/pi/bin/bsc-slave-master/bsc-slave.o] Error 1
 Makefile:1522: recipe for target '_module_/home/pi/bin/bsc-slave-master' failed
 make[1]: *** [_module_/home/pi/bin/bsc-slave-master] Error 2
 make[1]: Leaving directory '/root/linux-11dc869d874d04293849d830637130269fd0ada9'
 Makefile:4: recipe for target 'all' failed
 make: *** [all] Error 2

mungayree avatar Jul 25 '18 20:07 mungayree