Re: converting a driver from 2.4 kernel(comedi 0.7.68) into a 2.6 kernel(comedi 0.7.73)

On 08/06/2007 21:27, philippe faucon wrote:
> Essentially i want to convert a driver that someone wrote under 2.4.27 
> with comedi 7.68 ( i am told that it worked) into my current build 
> 2.6.15 with comedi 7.73. When I try to compile the comedi 0.7.70 that 
> the driver was sent with I get quite a few errors with fops.c 
> (class_simple_create/destroy/device_add/device_remove) , so i decided to 
> try and update the driver to work in comedi 0.7.73 with the new kernel.  
> Here is where the problem comes in, when i try to compile it ( i renamed 
> it skel.c for simplicity, ) i get a quite a few errors, and tons of 
> warnings.  So far i have just been looking for a different way to search 
> the system for PCI boards, since importing the old includes didn't work. 
> the other thing that is interesting is that within the entire comedi 
> distribution, pci_for_each_dev (for_each) only appears once, in my 
> driver. anyways, attached is the output of the make, any help or advice 
> would be greatly appreciated.

Now they all use pci_get_device (and pci_put_device) instead of 
pci_for_each_dev.  Look at some of the other drivers for examples of 
what to do, e.g. "comedi/drivers/contec_pci_dio.c" which is nice and simple.

Note that the comedi_driver "detach" routine is called even if the 
"attach" routine fails, so you need to be careful not to clean things up 
twice.

-- 
-=( Ian Abbott _at_ MEV Ltd.    E-mail: <abbotti_at_mev.co.uk>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-

Received on 2007-06-11Z09:18:50