diff options
author | Oleksij Rempel <bug-track@fisher-privat.net> | 2012-05-04 11:14:32 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-05-09 16:26:13 -0400 |
commit | c377c5006f2c69ac3a41a865fbb41578547fe33d (patch) | |
tree | ea2ebb49f4eca33b5500dcea02f42d25eee12f3e /drivers | |
parent | 174b8d9fa3066a98ac7bcc122d5b27efa1053051 (diff) |
staging: rts5139: remove disabled SCSI_SCAN_DELAY code
Signed-off-by: Oleksij Rempel <bug-track@fisher-privat.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/rts5139/rts51x.c | 74 | ||||
-rw-r--r-- | drivers/staging/rts5139/rts51x.h | 5 |
2 files changed, 0 insertions, 79 deletions
diff --git a/drivers/staging/rts5139/rts51x.c b/drivers/staging/rts5139/rts51x.c index 2b9f785954df..48cb68497b1d 100644 --- a/drivers/staging/rts5139/rts51x.c +++ b/drivers/staging/rts5139/rts51x.c | |||
@@ -56,12 +56,6 @@ MODULE_DESCRIPTION(RTS51X_DESC); | |||
56 | MODULE_LICENSE("GPL"); | 56 | MODULE_LICENSE("GPL"); |
57 | MODULE_VERSION(DRIVER_VERSION); | 57 | MODULE_VERSION(DRIVER_VERSION); |
58 | 58 | ||
59 | #ifdef SCSI_SCAN_DELAY | ||
60 | static unsigned int delay_use = 5; | ||
61 | module_param(delay_use, uint, S_IRUGO | S_IWUSR); | ||
62 | MODULE_PARM_DESC(delay_use, "seconds to delay before using a new device"); | ||
63 | #endif | ||
64 | |||
65 | static int auto_delink_en; | 59 | static int auto_delink_en; |
66 | module_param(auto_delink_en, int, S_IRUGO | S_IWUSR); | 60 | module_param(auto_delink_en, int, S_IRUGO | S_IWUSR); |
67 | MODULE_PARM_DESC(auto_delink_en, "enable auto delink"); | 61 | MODULE_PARM_DESC(auto_delink_en, "enable auto delink"); |
@@ -364,11 +358,6 @@ static int rts51x_polling_thread(void *__chip) | |||
364 | { | 358 | { |
365 | struct rts51x_chip *chip = (struct rts51x_chip *)__chip; | 359 | struct rts51x_chip *chip = (struct rts51x_chip *)__chip; |
366 | 360 | ||
367 | #ifdef SCSI_SCAN_DELAY | ||
368 | /* Wait until SCSI scan finished */ | ||
369 | wait_timeout((delay_use + 5) * HZ); | ||
370 | #endif | ||
371 | |||
372 | for (;;) { | 361 | for (;;) { |
373 | wait_timeout(POLLING_INTERVAL); | 362 | wait_timeout(POLLING_INTERVAL); |
374 | 363 | ||
@@ -432,38 +421,6 @@ static int rts51x_polling_thread(void *__chip) | |||
432 | return 0; | 421 | return 0; |
433 | } | 422 | } |
434 | 423 | ||
435 | #ifdef SCSI_SCAN_DELAY | ||
436 | /* Thread to carry out delayed SCSI-device scanning */ | ||
437 | static int rts51x_scan_thread(void *__chip) | ||
438 | { | ||
439 | struct rts51x_chip *chip = (struct rts51x_chip *)__chip; | ||
440 | |||
441 | printk(KERN_DEBUG | ||
442 | "rts51x: device found at %d\n", chip->usb->pusb_dev->devnum); | ||
443 | |||
444 | set_freezable(); | ||
445 | /* Wait for the timeout to expire or for a disconnect */ | ||
446 | if (delay_use > 0) { | ||
447 | printk(KERN_DEBUG "rts51x: waiting for device " | ||
448 | "to settle before scanning\n"); | ||
449 | wait_event_freezable_timeout(chip->usb->delay_wait, | ||
450 | test_bit(FLIDX_DONT_SCAN, | ||
451 | &chip->usb->dflags), | ||
452 | delay_use * HZ); | ||
453 | } | ||
454 | |||
455 | /* If the device is still connected, perform the scanning */ | ||
456 | if (!test_bit(FLIDX_DONT_SCAN, &chip->usb->dflags)) { | ||
457 | scsi_scan_host(rts51x_to_host(chip)); | ||
458 | printk(KERN_DEBUG "rts51x: device scan complete\n"); | ||
459 | |||
460 | /* Should we unbind if no devices were detected? */ | ||
461 | } | ||
462 | |||
463 | complete_and_exit(&chip->usb->scanning_done, 0); | ||
464 | } | ||
465 | #endif | ||
466 | |||
467 | /* Associate our private data with the USB device */ | 424 | /* Associate our private data with the USB device */ |
468 | static int associate_dev(struct rts51x_chip *chip, struct usb_interface *intf) | 425 | static int associate_dev(struct rts51x_chip *chip, struct usb_interface *intf) |
469 | { | 426 | { |
@@ -737,15 +694,6 @@ static void quiesce_and_remove_host(struct rts51x_chip *chip) | |||
737 | if (rts51x->pusb_dev->state == USB_STATE_NOTATTACHED) | 694 | if (rts51x->pusb_dev->state == USB_STATE_NOTATTACHED) |
738 | set_bit(FLIDX_DISCONNECTING, &rts51x->dflags); | 695 | set_bit(FLIDX_DISCONNECTING, &rts51x->dflags); |
739 | 696 | ||
740 | #ifdef SCSI_SCAN_DELAY | ||
741 | /* Prevent SCSI-scanning (if it hasn't started yet) | ||
742 | * and wait for the SCSI-scanning thread to stop. | ||
743 | */ | ||
744 | set_bit(FLIDX_DONT_SCAN, &rts51x->dflags); | ||
745 | wake_up(&rts51x->delay_wait); | ||
746 | wait_for_completion(&rts51x->scanning_done); | ||
747 | #endif | ||
748 | |||
749 | /* Removing the host will perform an orderly shutdown: caches | 697 | /* Removing the host will perform an orderly shutdown: caches |
750 | * synchronized, disks spun down, etc. | 698 | * synchronized, disks spun down, etc. |
751 | */ | 699 | */ |
@@ -757,9 +705,6 @@ static void quiesce_and_remove_host(struct rts51x_chip *chip) | |||
757 | scsi_lock(host); | 705 | scsi_lock(host); |
758 | set_bit(FLIDX_DISCONNECTING, &rts51x->dflags); | 706 | set_bit(FLIDX_DISCONNECTING, &rts51x->dflags); |
759 | scsi_unlock(host); | 707 | scsi_unlock(host); |
760 | #ifdef SCSI_SCAN_DELAY | ||
761 | wake_up(&rts51x->delay_wait); | ||
762 | #endif | ||
763 | } | 708 | } |
764 | 709 | ||
765 | /* Second stage of disconnect processing: deallocate all resources */ | 710 | /* Second stage of disconnect processing: deallocate all resources */ |
@@ -818,10 +763,6 @@ static int rts51x_probe(struct usb_interface *intf, | |||
818 | init_completion(&rts51x->control_exit); | 763 | init_completion(&rts51x->control_exit); |
819 | init_completion(&rts51x->polling_exit); | 764 | init_completion(&rts51x->polling_exit); |
820 | init_completion(&(rts51x->notify)); | 765 | init_completion(&(rts51x->notify)); |
821 | #ifdef SCSI_SCAN_DELAY | ||
822 | init_waitqueue_head(&rts51x->delay_wait); | ||
823 | init_completion(&rts51x->scanning_done); | ||
824 | #endif | ||
825 | 766 | ||
826 | chip->usb = rts51x; | 767 | chip->usb = rts51x; |
827 | 768 | ||
@@ -855,22 +796,7 @@ static int rts51x_probe(struct usb_interface *intf, | |||
855 | printk(KERN_WARNING RTS51X_TIP "Unable to add the scsi host\n"); | 796 | printk(KERN_WARNING RTS51X_TIP "Unable to add the scsi host\n"); |
856 | goto BadDevice; | 797 | goto BadDevice; |
857 | } | 798 | } |
858 | #ifdef SCSI_SCAN_DELAY | ||
859 | /* Start up the thread for delayed SCSI-device scanning */ | ||
860 | th = kthread_create(rts51x_scan_thread, chip, RTS51X_SCAN_THREAD); | ||
861 | if (IS_ERR(th)) { | ||
862 | printk(KERN_WARNING RTS51X_TIP | ||
863 | "Unable to start the device-scanning thread\n"); | ||
864 | complete(&rts51x->scanning_done); | ||
865 | quiesce_and_remove_host(chip); | ||
866 | result = PTR_ERR(th); | ||
867 | goto BadDevice; | ||
868 | } | ||
869 | |||
870 | wake_up_process(th); | ||
871 | #else | ||
872 | scsi_scan_host(rts51x_to_host(chip)); | 799 | scsi_scan_host(rts51x_to_host(chip)); |
873 | #endif | ||
874 | 800 | ||
875 | /* Start up our polling thread */ | 801 | /* Start up our polling thread */ |
876 | th = kthread_run(rts51x_polling_thread, chip, RTS51X_POLLING_THREAD); | 802 | th = kthread_run(rts51x_polling_thread, chip, RTS51X_POLLING_THREAD); |
diff --git a/drivers/staging/rts5139/rts51x.h b/drivers/staging/rts5139/rts51x.h index b2c58390bfc5..40ca432a9024 100644 --- a/drivers/staging/rts5139/rts51x.h +++ b/drivers/staging/rts5139/rts51x.h | |||
@@ -51,7 +51,6 @@ | |||
51 | #define RTS51X_POLLING_THREAD "rts5139-polling" | 51 | #define RTS51X_POLLING_THREAD "rts5139-polling" |
52 | 52 | ||
53 | #define POLLING_IN_THREAD | 53 | #define POLLING_IN_THREAD |
54 | /* #define SCSI_SCAN_DELAY */ | ||
55 | #define SUPPORT_FILE_OP | 54 | #define SUPPORT_FILE_OP |
56 | 55 | ||
57 | #define wait_timeout_x(task_state, msecs) \ | 56 | #define wait_timeout_x(task_state, msecs) \ |
@@ -116,10 +115,6 @@ struct rts51x_usb { | |||
116 | struct completion control_exit; /* control thread exit */ | 115 | struct completion control_exit; /* control thread exit */ |
117 | struct completion polling_exit; /* polling thread exit */ | 116 | struct completion polling_exit; /* polling thread exit */ |
118 | struct completion notify; /* thread begin/end */ | 117 | struct completion notify; /* thread begin/end */ |
119 | #ifdef SCSI_SCAN_DELAY | ||
120 | wait_queue_head_t delay_wait; /* wait during scan, reset */ | ||
121 | struct completion scanning_done; /* wait for scan thread */ | ||
122 | #endif | ||
123 | }; | 118 | }; |
124 | 119 | ||
125 | extern struct usb_driver rts51x_driver; | 120 | extern struct usb_driver rts51x_driver; |