[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1437051500-20419-3-git-send-email-sudipm.mukherjee@gmail.com>
Date: Thu, 16 Jul 2015 18:28:19 +0530
From: Sudip Mukherjee <sudipm.mukherjee@...il.com>
To: Lidza Louina <lidza.louina@...il.com>,
Mark Hounschell <markh@...pro.net>,
Daeseok Youn <daeseok.youn@...il.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: linux-kernel@...r.kernel.org,
driverdev-devel@...uxdriverproject.org, devel@...verdev.osuosl.org,
Sudip Mukherjee <sudipm.mukherjee@...il.com>
Subject: [PATCH 3/4] staging: dgap: new arguments to dgap_stop
In a later patch we will remove the duplicate codes. But the code also
needs to execute dgap_remove_driver_sysfiles() if it is being called
from dgap_remove_one() but if being called fron the error path of the
dgap_init_module() then the sysfiles should not be removed.
Signed-off-by: Sudip Mukherjee <sudip@...torindia.org>
---
drivers/staging/dgap/dgap.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
index 8956228..4f07a0c 100644
--- a/drivers/staging/dgap/dgap.c
+++ b/drivers/staging/dgap/dgap.c
@@ -7004,7 +7004,7 @@ static void dgap_cleanup_board(struct board_t *brd)
kfree(brd);
}
-static void dgap_stop(void)
+static void dgap_stop(bool removesys, struct pci_driver *drv)
{
unsigned long lock_flags;
@@ -7013,6 +7013,8 @@ static void dgap_stop(void)
spin_unlock_irqrestore(&dgap_poll_lock, lock_flags);
del_timer_sync(&dgap_poll_timer);
+ if (removesys)
+ dgap_remove_driver_sysfiles(drv);
device_destroy(dgap_class, MKDEV(DIGI_DGAP_MAJOR, 0));
class_destroy(dgap_class);
@@ -7134,7 +7136,7 @@ static int dgap_init_module(void)
rc = pci_register_driver(&dgap_driver);
if (rc) {
- dgap_stop();
+ dgap_stop(false, NULL);
return rc;
}
--
1.8.1.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