lkml.org 
[lkml]   [2014]   [Feb]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/3] staging: dgap: fix error handling in dgap_init_module()
Date
No need to call pci_unregister_driver() if pci_register_driver() failed.

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
---
drivers/staging/dgap/dgap_driver.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/dgap/dgap_driver.c b/drivers/staging/dgap/dgap_driver.c
index 136c879b560c..cc6933db6feb 100644
--- a/drivers/staging/dgap/dgap_driver.c
+++ b/drivers/staging/dgap/dgap_driver.c
@@ -254,18 +254,10 @@ int dgap_init_module(void)
/*
* If something went wrong in the scan, bail out of driver.
*/
- if (rc < 0) {
- /* Only unregister the pci driver if it was actually registered. */
- if (dgap_NumBoards)
- pci_unregister_driver(&dgap_driver);
- else
- printk("WARNING: dgap driver load failed. No DGAP boards found.\n");
-
+ if (rc < 0)
dgap_cleanup_module();
- }
- else {
+ else
dgap_create_driver_sysfiles(&dgap_driver);
- }

DPR_INIT(("Finished init_module. Returning %d\n", rc));
return (rc);
--
1.8.3.2


\
 
 \ /
  Last update: 2014-02-23 22:01    [W:0.363 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site