daniel-santos / mcp2210-linux

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

Fix compilation for kernel 4.4.0 #29

Closed amitesh-singh closed 7 years ago

amitesh-singh commented 7 years ago

This fixes following compilation error.


/home/ami/repos/mcp2210-linux/mcp2210-irq.c: In function ‘_mcp2210_irq_do_gpio’:
/home/ami/repos/mcp2210-linux/mcp2210-irq.c:199:22: error: passing argument 1 of                                                                                         ‘handle_simple_irq’ makes pointer from integer without a cast [-Werror=int-conv                                                                                        ersion]
    handle_simple_irq(virq, desc);
                      ^
In file included from ./arch/x86/include/asm/hardirq.h:5:0,
                 from include/linux/hardirq.h:8,
                 from include/linux/interrupt.h:12,
                 from include/linux/usb.h:15,
                 from /home/ami/repos/mcp2210-linux/mcp2210.h:42,
                 from /home/ami/repos/mcp2210-linux/mcp2210-irq.c:21:
include/linux/irq.h:471:13: note: expected ‘struct irq_desc _’ but argument is o                                                                                        f type ‘int’
 extern void handle_simple_irq(struct irq_desc *desc);
             ^
/home/ami/repos/mcp2210-linux/mcp2210-irq.c:199:4: error: too many arguments to                                                                                         function ‘handle_simple_irq’
    handle_simple_irq(virq, desc);
    ^
In file included from ./arch/x86/include/asm/hardirq.h:5:0,
                 from include/linux/hardirq.h:8,
                 from include/linux/interrupt.h:12,
                 from include/linux/usb.h:15,
                 from /home/ami/repos/mcp2210-linux/mcp2210.h:42,
                 from /home/ami/repos/mcp2210-linux/mcp2210-irq.c:21:
include/linux/irq.h:471:13: note: declared here
 extern void handle_simple_irq(struct irq_desc *desc);
             ^
/home/ami/repos/mcp2210-linux/mcp2210-irq.c: In function ‘_mcp2210_irq_do_intr_c                                                                                        ounter’:
/home/ami/repos/mcp2210-linux/mcp2210-irq.c:215:20: error: passing argument 1 of                                                                                         ‘handle_simple_irq’ makes pointer from integer without a cast [-Werror=int-conv                                                                                        ersion]
  handle_simple_irq(dev->irq_base + pin->irq, desc);
                    ^
In file included from ./arch/x86/include/asm/hardirq.h:5:0,
                 from include/linux/hardirq.h:8,
                 from include/linux/interrupt.h:12,
                 from include/linux/usb.h:15,
                 from /home/ami/repos/mcp2210-linux/mcp2210.h:42,
                 from /home/ami/repos/mcp2210-linux/mcp2210-irq.c:21:
include/linux/irq.h:471:13: note: expected ‘struct irq_desc *’ but argument is o                                                                                        f type ‘int’
 extern void handle_simple_irq(struct irq_desc *desc);
             ^
/home/ami/repos/mcp2210-linux/mcp2210-irq.c:215:2: error: too many arguments to                                                                                         function ‘handle_simple_irq’
  handle_simple_irq(dev->irq_base + pin->irq, desc);
  ^
In file included from ./arch/x86/include/asm/hardirq.h:5:0,
                 from include/linux/hardirq.h:8,
                 from include/linux/interrupt.h:12,
                 from include/linux/usb.h:15,
                 from /home/ami/repos/mcp2210-linux/mcp2210.h:42,
                 from /home/ami/repos/mcp2210-linux/mcp2210-irq.c:21:
include/linux/irq.h:471:13: note: declared here
 extern void handle_simple_irq(struct irq_desc *desc);
             ^
cc1: all warnings being treated as errors
scripts/Makefile.build:258: recipe for target '/home/ami/repos/mcp2210-linux/mcp                                                                                        2210-irq.o' failed
make[2]: *_\* [/home/ami/repos/mcp2210-linux/mcp2210-irq.o] Error 1
Makefile:1403: recipe for target '_module_/home/ami/repos/mcp2210-linux' failed
make[1]: **\* [_module_/home/ami/repos/mcp2210-linux] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.4.0-36-generic'
Makefile:31: recipe for target 'modules' failed
make: **\* [modules] Error 2```
amitesh-singh commented 7 years ago

ping?

daniel-santos commented 7 years ago

Hey, sorry for the slow response! I'll check this out in a few days, trying to wrap up another project.

dlunev commented 7 years ago

this patch is a bit imcomplete. Problematic code comes from 4.3

dlunev commented 7 years ago

pls compare with this. https://github.com/daniel-santos/mcp2210-linux/pull/30 - it looks more correct to me ;)

daniel-santos commented 7 years ago

Thank you amitesh-singh. I've merged dlunev's fix for this problem. Again, sorry it took me so long to get to this. I'm catching up now. :)