Fix when CONFIG_MODULES is not enabled: drivers/staging/lirc/lirc_parallel.c:243: error: implicit declaration of function 'module_refcount' drivers/staging/lirc/lirc_it87.c:150: error: implicit declaration of function 'module_refcount' drivers/built-in.o: In function `it87_probe': lirc_it87.c:(.text+0x4079b0): undefined reference to `init_chrdev' lirc_it87.c:(.text+0x4079cc): undefined reference to `drop_chrdev' drivers/built-in.o: In function `lirc_it87_exit': lirc_it87.c:(.exit.text+0x38a5): undefined reference to `drop_chrdev' Its a quick hack and untested beyond building, since I don't have the hardware, but it should do the trick.
Showing the changes to drivers/staging/lirc/lirc_parallel.c (1 of 2 files). Show all
Unified · Split
| @@ -240,7 +240,7 @@ static void irq_handler(void *blah) · 239 unmodified lines | ||
| 240 | 240 | unsigned int level, newlevel; |
| 241 | 241 | unsigned int timeout; |
| 242 | 242 | |
| 243 | − if (!module_refcount(THIS_MODULE)) | |
| 243 | + if (!is_open) | |
| 244 | 244 | return; |
| 245 | 245 | |
| 246 | 246 | if (!is_claimed) |
| @@ -515,7 +515,7 @@ static long lirc_ioctl(struct file *filep, unsigned int cmd, unsigned long arg) · 268 unmodified lines | ||
| 515 | 515 | |
| 516 | 516 | static int lirc_open(struct inode *node, struct file *filep) |
| 517 | 517 | { |
| 518 | − if (module_refcount(THIS_MODULE) || !lirc_claim()) | |
| 518 | + if (is_open || !lirc_claim()) | |
| 519 | 519 | return -EBUSY; |
| 520 | 520 | |
| 521 | 521 | parport_enable_irq(pport); |