Skip to content

Commit

Permalink
staging: dgnc: unregister pci driver
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
sudipm-mukherjee authored and gregkh committed Mar 12, 2016
1 parent e9961fc commit b3ca2e0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/staging/dgnc/dgnc_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/*
Expand Down

0 comments on commit b3ca2e0

Please sign in to comment.