Porting Device Driver to 2.6

Alex Holeczy alex at wmi.com
Wed Apr 20 08:41:53 EDT 2005


On Wed, 20 Apr 2005, Dominik Brodowski wrote:

> On Mon, Apr 18, 2005 at 11:59:00AM -0400, Alex Holeczy wrote:
>>
>> How do you register the device release function for a generic device under
>> kernel 2.6?  It appears that sound cards have a method for registering a
>> free function.
>>
>> Using the kernel 2.4 there was a 'release' element in the dev_link_t
>> structure used to register the device release function.  The 'release'
>> element does not exists in the dev_link_t structure for the 2.6 kernel.
>
> Yes, there was, but it was using a timer which is not the preferred way of
> doing things. For what purposes do you need it exactly?


In the 2.4 kernel environment, the release() function was used to free any 
resources allocated by a call to the config() function.  The release() 
function would only free resources if the device was not currently opened.

The release() would also call the detach(), if the detach() function was 
called prior to the resource being closed.

I thought that in the 2.6 kernel, the release() function would be required 
to perform the same function.

Currently my 2.6 driver, calls the release() function in the detach() 
function.  But if the device is still open when the detach() function is 
called, it does not make sense to free the system resources because the 
user application may try to access the device.

Maybe if the detach() function is called when the device is still opened, 
the close() function should be responsible for calling the release() 
function.

What do you think?

Regards,
Alex


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Alex Holeczy (alex at wmi.com)

Communication Automation Corporation (CAC)      www.cacdsp.com www.wmi.com
1180 McDermott Drive, West Chester, PA  19380

800-367-6735 Ext. 122 or 610-692-9526 Ext. 122 (Voice)
610-436-8258 (Fax) 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



More information about the linux-pcmcia mailing list