staging: dgnc: unregister pci driver

We may choose to load the module without the hardware present. That will
register the pci driver but since probe will not succeed so
dgnc_NumBoards will be 0. Now if we unload the module then the pci
driver stays registered as dgnc_NumBoards is 0. And if we try to load
the module again it fails with the error:
"Driver 'dgnc' is already registered."

Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Sudip Mukherjee 2016-02-27 17:33:34 +05:30 committed by Greg Kroah-Hartman
parent e9961fc16f
commit b3ca2e08e7

View file

@ -156,8 +156,7 @@ static void dgnc_cleanup_module(void)
dgnc_tty_post_uninit();
if (dgnc_NumBoards)
pci_unregister_driver(&dgnc_driver);
pci_unregister_driver(&dgnc_driver);
}
/*