[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1393794488-12909-3-git-send-email-khoroshilov@ispras.ru>
Date: Mon, 3 Mar 2014 01:08:08 +0400
From: Alexey Khoroshilov <khoroshilov@...ras.ru>
To: Todza Louina <lidza.louina@...il.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Alexey Khoroshilov <khoroshilov@...ras.ru>,
driverdev-devel@...uxdriverproject.org, devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org, ldv-project@...uxtesting.org
Subject: [PATCH 3/3] staging: dgap: fix error handling in dgap_init_module()
No need to call pci_unregister_driver() if pci_register_driver() failed.
Signed-off-by: Alexey Khoroshilov <khoroshilov@...ras.ru>
---
drivers/staging/dgap/dgap.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
index b4157d7..510e8b3 100644
--- a/drivers/staging/dgap/dgap.c
+++ b/drivers/staging/dgap/dgap.c
@@ -535,18 +535,13 @@ 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");
-
dgap_cleanup_module();
- } else {
- dgap_create_driver_sysfiles(&dgap_driver);
- dgap_driver_state = DRIVER_READY;
+ return rc;
}
+ dgap_create_driver_sysfiles(&dgap_driver);
+ dgap_driver_state = DRIVER_READY;
+
return rc;
}
--
1.8.3.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists