From: Adrian M. <ad...@mc...> - 2001-11-22 19:05:24
|
On Thursday 22 Nov 2001 12:19 am, Paul Mundt wrote: > On Wed, Nov 21, 2001 at 08:58:06PM +0000, Adrian McMenamin wrote: > > But rmmod produces "Device busy" error message. > > This is to be expected.. as you're misusing MOD_{INC,DEC}_USE_COUNT. > > > Any ideas? Is it simply because this is not a properly registered driver > > yet - or is there a coding problem? > > > > Any and all help etc.... > > [snip] > > > static int __init init_aica (void) > > { > > MOD_INC_USE_COUNT; //increment count > > [snip] > > This is not at all what you want to do. You're forcing its usage count up > on an initialization even though nothing is actually using it. The proper > way to do this would be to setup an aica_open() and stick your > MOD_INC_USE_COUNT in there, and then decrement it on an aico_close(), then > hand that off to a file operations structure when you register. > Errr... yes. I should have paid more attention to the sample code I was looking at. The good news is that I am now pretty confident that this task (writing the driver) is doable... |