lkml.org 
[lkml]   [2005]   [Feb]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectrmmod while module is in use
maybe RTFM...
a module:
- char device driver for..
- a PCI device

any clue as to how to protect from module unloading while there is still
some process opening it??? have I to sleep in the remove_one() pci
driver function till last process closes its file descriptor???

static void __devexit apedev_remove_one(struct pci_dev *pdev)
{
ApeDev* apedev = pci_get_drvdata(pdev);

if(test_bit(APEDEV_FLAG_OPEN, &apedev->flags)) {
PERROR("still open flag on!!! (flags=0x%08x)\n", apedev->flags);

// sleep here till it gets closed...

}
...
}

static struct pci_driver apedev_driver = {
.name = DEVNAME,
.id_table = apedev_pci_tbl,
.probe = apedev_init_one,
.remove = __devexit_p(apedev_remove_one),
};

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:10    [W:0.060 / U:0.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site