staging: dgap: remove duplicate code
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>
Thu, 16 Jul 2015 12:58:20 +0000 (18:28 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 Jul 2015 17:19:55 +0000 (10:19 -0700)
Remove the duplicate code of dgap_remove_one() and dgap_stop().

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/dgap/dgap.c

index 4f07a0cae987626b2f42739099df2beea2cc4607..b344e035b0efb4993f958eb5275e212921b14fcf 100644 (file)
@@ -7024,22 +7024,9 @@ static void dgap_stop(bool removesys, struct pci_driver *drv)
 static void dgap_remove_one(struct pci_dev *dev)
 {
        unsigned int i;
-       ulong lock_flags;
        struct pci_driver *drv = to_pci_driver(dev->dev.driver);
 
-       spin_lock_irqsave(&dgap_poll_lock, lock_flags);
-       dgap_poll_stop = 1;
-       spin_unlock_irqrestore(&dgap_poll_lock, lock_flags);
-
-       /* Turn off poller right away. */
-       del_timer_sync(&dgap_poll_timer);
-
-       dgap_remove_driver_sysfiles(drv);
-
-       device_destroy(dgap_class, MKDEV(DIGI_DGAP_MAJOR, 0));
-       class_destroy(dgap_class);
-       unregister_chrdev(DIGI_DGAP_MAJOR, "dgap");
-
+       dgap_stop(true, drv);
        for (i = 0; i < dgap_numboards; ++i) {
                dgap_remove_ports_sysfiles(dgap_board[i]);
                dgap_cleanup_tty(dgap_board[i]);