Hi Richard,
On 10/11/15 07:55, Ricard Wanderlof wrote:
On Mon, 9 Nov 2015, Felipe Ferreri Tonello wrote:
while insmodding it works fine, I can't rmmod it because once snd_soc_register_card() has been called, it has a usage count of 2 and thus cannot be rmmod:ed.
You have to unregister that card upon freeing your module.
But that is precisely the problem. The framework that manages the insertion and deletion of modules notes that my module has a usage count that is > 0 (in my case it is 2, which I'm convinced is because the card has been registered with ALSA), and refuses to free the module. So there is now way any unregister_card call can be made when my module is freed, as due to the usage count it would never even be attempted.
Do you mean that unbind is never called? Well, the framework should call bind/unbind for each user of your module.
How is your architecture? If you use one card for each probe of module then each bind should create one device, right?