On 7/28/05, Rahul T <gr8rahul@xxxxxxxxx> wrote: > hello all, > i am newbee. i am trying to write a serial device driver. i saw the > one in LDD3 by Rubino. I coded the driver but now it is giving me > following error > error => > > root@rahul:/home/rahul/driver # make > make -C /usr/src/linux-2.6.10 SUBDIRS=/home/rahul/driver modules > make[1]: Entering directory `/usr/src/linux-2.6.10' > CC [M] /home/rahul/driver/tiny1.o > /home/rahul/driver/tiny1.c: In function `tiny_open': > /home/rahul/driver/tiny1.c:72: error: `MOD_INC_USE_COUNT' undeclared > (first use in this function) > /home/rahul/driver/tiny1.c:72: error: (Each undeclared identifier is > reported only once > /home/rahul/driver/tiny1.c:72: error: for each function it appears in.) > /home/rahul/driver/tiny1.c:78: warning: implicit declaration of function `minor' > /home/rahul/driver/tiny1.c:78: error: structure has no member named `device' > /home/rahul/driver/tiny1.c:83: error: `MOD_DEC_USE_COUNT' undeclared > (first use in this function) > /home/rahul/driver/tiny1.c:91: error: structure has no member named `device' > /home/rahul/driver/tiny1.c: In function `do_close': > /home/rahul/driver/tiny1.c:145: error: `MOD_DEC_USE_COUNT' undeclared > (first use in this function) > /home/rahul/driver/tiny1.c: At top level: > /home/rahul/driver/tiny1.c:223: warning: initialization makes integer > from pointer without a cast > /home/rahul/driver/tiny1.c:224: error: unknown field `table' specified > in initializer > /home/rahul/driver/tiny1.c:224: warning: initialization from > incompatible pointer type > /home/rahul/driver/tiny1.c:230: warning: initialization from > incompatible pointer type > make[2]: *** [/home/rahul/driver/tiny1.o] Error 1 > make[1]: *** [_module_/home/rahul/driver] Error 2 > make[1]: Leaving directory `/usr/src/linux-2.6.10' > make: *** [default] Error 2 > > should i try to replace the MOD_.. with a local counter .However doing > this further generates other errors. > There is no longer exists MOD_INC_USE_COUNT in 2.6 Kernel .......... So don't use it .... Have you tried the example code of LDD3 (tty) and compared yours with it ??? If not then do so ... You can get the example code for the book LDD3 from the orielly site ...... -- Fawad Lateef -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/