diff options
Diffstat (limited to 'drivers/usb/misc/sisusbvga/sisusb.c')
-rw-r--r-- | drivers/usb/misc/sisusbvga/sisusb.c | 127 |
1 files changed, 44 insertions, 83 deletions
diff --git a/drivers/usb/misc/sisusbvga/sisusb.c b/drivers/usb/misc/sisusbvga/sisusb.c index 196c8794a73c..738bd7c7451f 100644 --- a/drivers/usb/misc/sisusbvga/sisusb.c +++ b/drivers/usb/misc/sisusbvga/sisusb.c | |||
@@ -37,6 +37,7 @@ | |||
37 | */ | 37 | */ |
38 | 38 | ||
39 | #include <linux/config.h> | 39 | #include <linux/config.h> |
40 | #include <linux/mutex.h> | ||
40 | #include <linux/module.h> | 41 | #include <linux/module.h> |
41 | #include <linux/kernel.h> | 42 | #include <linux/kernel.h> |
42 | #include <linux/signal.h> | 43 | #include <linux/signal.h> |
@@ -52,6 +53,7 @@ | |||
52 | #include <linux/vmalloc.h> | 53 | #include <linux/vmalloc.h> |
53 | 54 | ||
54 | #include "sisusb.h" | 55 | #include "sisusb.h" |
56 | #include "sisusb_init.h" | ||
55 | 57 | ||
56 | #ifdef INCL_SISUSB_CON | 58 | #ifdef INCL_SISUSB_CON |
57 | #include <linux/font.h> | 59 | #include <linux/font.h> |
@@ -62,36 +64,6 @@ | |||
62 | /* Forward declarations / clean-up routines */ | 64 | /* Forward declarations / clean-up routines */ |
63 | 65 | ||
64 | #ifdef INCL_SISUSB_CON | 66 | #ifdef INCL_SISUSB_CON |
65 | int sisusb_setreg(struct sisusb_usb_data *sisusb, int port, u8 data); | ||
66 | int sisusb_getreg(struct sisusb_usb_data *sisusb, int port, u8 *data); | ||
67 | int sisusb_setidxreg(struct sisusb_usb_data *sisusb, int port, u8 index, u8 data); | ||
68 | int sisusb_getidxreg(struct sisusb_usb_data *sisusb, int port, u8 index, u8 *data); | ||
69 | int sisusb_setidxregandor(struct sisusb_usb_data *sisusb, int port, u8 idx, u8 myand, u8 myor); | ||
70 | int sisusb_setidxregor(struct sisusb_usb_data *sisusb, int port, u8 index, u8 myor); | ||
71 | int sisusb_setidxregand(struct sisusb_usb_data *sisusb, int port, u8 idx, u8 myand); | ||
72 | |||
73 | int sisusb_writeb(struct sisusb_usb_data *sisusb, u32 adr, u8 data); | ||
74 | int sisusb_readb(struct sisusb_usb_data *sisusb, u32 adr, u8 *data); | ||
75 | int sisusb_writew(struct sisusb_usb_data *sisusb, u32 adr, u16 data); | ||
76 | int sisusb_readw(struct sisusb_usb_data *sisusb, u32 adr, u16 *data); | ||
77 | int sisusb_copy_memory(struct sisusb_usb_data *sisusb, char *src, | ||
78 | u32 dest, int length, size_t *bytes_written); | ||
79 | |||
80 | int sisusb_reset_text_mode(struct sisusb_usb_data *sisusb, int init); | ||
81 | |||
82 | extern int SiSUSBSetMode(struct SiS_Private *SiS_Pr, unsigned short ModeNo); | ||
83 | extern int SiSUSBSetVESAMode(struct SiS_Private *SiS_Pr, unsigned short VModeNo); | ||
84 | |||
85 | extern void sisusb_init_concode(void); | ||
86 | extern int sisusb_console_init(struct sisusb_usb_data *sisusb, int first, int last); | ||
87 | extern void sisusb_console_exit(struct sisusb_usb_data *sisusb); | ||
88 | |||
89 | extern void sisusb_set_cursor(struct sisusb_usb_data *sisusb, unsigned int location); | ||
90 | |||
91 | extern int sisusbcon_do_font_op(struct sisusb_usb_data *sisusb, int set, int slot, | ||
92 | u8 *arg, int cmapsz, int ch512, int dorecalc, | ||
93 | struct vc_data *c, int fh, int uplock); | ||
94 | |||
95 | static int sisusb_first_vc = 0; | 67 | static int sisusb_first_vc = 0; |
96 | static int sisusb_last_vc = 0; | 68 | static int sisusb_last_vc = 0; |
97 | module_param_named(first, sisusb_first_vc, int, 0); | 69 | module_param_named(first, sisusb_first_vc, int, 0); |
@@ -102,7 +74,7 @@ MODULE_PARM_DESC(last, "Number of last console to take over (1 - MAX_NR_CONSOLES | |||
102 | 74 | ||
103 | static struct usb_driver sisusb_driver; | 75 | static struct usb_driver sisusb_driver; |
104 | 76 | ||
105 | DECLARE_MUTEX(disconnect_sem); | 77 | DEFINE_MUTEX(disconnect_mutex); |
106 | 78 | ||
107 | static void | 79 | static void |
108 | sisusb_free_buffers(struct sisusb_usb_data *sisusb) | 80 | sisusb_free_buffers(struct sisusb_usb_data *sisusb) |
@@ -1359,9 +1331,6 @@ sisusb_getreg(struct sisusb_usb_data *sisusb, int port, u8 *data) | |||
1359 | } | 1331 | } |
1360 | #endif | 1332 | #endif |
1361 | 1333 | ||
1362 | #ifndef INCL_SISUSB_CON | ||
1363 | static | ||
1364 | #endif | ||
1365 | int | 1334 | int |
1366 | sisusb_setidxreg(struct sisusb_usb_data *sisusb, int port, u8 index, u8 data) | 1335 | sisusb_setidxreg(struct sisusb_usb_data *sisusb, int port, u8 index, u8 data) |
1367 | { | 1336 | { |
@@ -1371,9 +1340,6 @@ sisusb_setidxreg(struct sisusb_usb_data *sisusb, int port, u8 index, u8 data) | |||
1371 | return ret; | 1340 | return ret; |
1372 | } | 1341 | } |
1373 | 1342 | ||
1374 | #ifndef INCL_SISUSB_CON | ||
1375 | static | ||
1376 | #endif | ||
1377 | int | 1343 | int |
1378 | sisusb_getidxreg(struct sisusb_usb_data *sisusb, int port, u8 index, u8 *data) | 1344 | sisusb_getidxreg(struct sisusb_usb_data *sisusb, int port, u8 index, u8 *data) |
1379 | { | 1345 | { |
@@ -1383,9 +1349,6 @@ sisusb_getidxreg(struct sisusb_usb_data *sisusb, int port, u8 index, u8 *data) | |||
1383 | return ret; | 1349 | return ret; |
1384 | } | 1350 | } |
1385 | 1351 | ||
1386 | #ifndef INCL_SISUSB_CON | ||
1387 | static | ||
1388 | #endif | ||
1389 | int | 1352 | int |
1390 | sisusb_setidxregandor(struct sisusb_usb_data *sisusb, int port, u8 idx, | 1353 | sisusb_setidxregandor(struct sisusb_usb_data *sisusb, int port, u8 idx, |
1391 | u8 myand, u8 myor) | 1354 | u8 myand, u8 myor) |
@@ -1415,18 +1378,12 @@ sisusb_setidxregmask(struct sisusb_usb_data *sisusb, int port, u8 idx, | |||
1415 | return ret; | 1378 | return ret; |
1416 | } | 1379 | } |
1417 | 1380 | ||
1418 | #ifndef INCL_SISUSB_CON | ||
1419 | static | ||
1420 | #endif | ||
1421 | int | 1381 | int |
1422 | sisusb_setidxregor(struct sisusb_usb_data *sisusb, int port, u8 index, u8 myor) | 1382 | sisusb_setidxregor(struct sisusb_usb_data *sisusb, int port, u8 index, u8 myor) |
1423 | { | 1383 | { |
1424 | return(sisusb_setidxregandor(sisusb, port, index, 0xff, myor)); | 1384 | return(sisusb_setidxregandor(sisusb, port, index, 0xff, myor)); |
1425 | } | 1385 | } |
1426 | 1386 | ||
1427 | #ifndef INCL_SISUSB_CON | ||
1428 | static | ||
1429 | #endif | ||
1430 | int | 1387 | int |
1431 | sisusb_setidxregand(struct sisusb_usb_data *sisusb, int port, u8 idx, u8 myand) | 1388 | sisusb_setidxregand(struct sisusb_usb_data *sisusb, int port, u8 idx, u8 myand) |
1432 | { | 1389 | { |
@@ -1448,6 +1405,8 @@ sisusb_readb(struct sisusb_usb_data *sisusb, u32 adr, u8 *data) | |||
1448 | return(sisusb_read_memio_byte(sisusb, SISUSB_TYPE_MEM, adr, data)); | 1405 | return(sisusb_read_memio_byte(sisusb, SISUSB_TYPE_MEM, adr, data)); |
1449 | } | 1406 | } |
1450 | 1407 | ||
1408 | #if 0 | ||
1409 | |||
1451 | int | 1410 | int |
1452 | sisusb_writew(struct sisusb_usb_data *sisusb, u32 adr, u16 data) | 1411 | sisusb_writew(struct sisusb_usb_data *sisusb, u32 adr, u16 data) |
1453 | { | 1412 | { |
@@ -1460,6 +1419,8 @@ sisusb_readw(struct sisusb_usb_data *sisusb, u32 adr, u16 *data) | |||
1460 | return(sisusb_read_memio_word(sisusb, SISUSB_TYPE_MEM, adr, data)); | 1419 | return(sisusb_read_memio_word(sisusb, SISUSB_TYPE_MEM, adr, data)); |
1461 | } | 1420 | } |
1462 | 1421 | ||
1422 | #endif /* 0 */ | ||
1423 | |||
1463 | int | 1424 | int |
1464 | sisusb_copy_memory(struct sisusb_usb_data *sisusb, char *src, | 1425 | sisusb_copy_memory(struct sisusb_usb_data *sisusb, char *src, |
1465 | u32 dest, int length, size_t *bytes_written) | 1426 | u32 dest, int length, size_t *bytes_written) |
@@ -2552,39 +2513,39 @@ sisusb_open(struct inode *inode, struct file *file) | |||
2552 | struct usb_interface *interface; | 2513 | struct usb_interface *interface; |
2553 | int subminor = iminor(inode); | 2514 | int subminor = iminor(inode); |
2554 | 2515 | ||
2555 | down(&disconnect_sem); | 2516 | mutex_lock(&disconnect_mutex); |
2556 | 2517 | ||
2557 | if (!(interface = usb_find_interface(&sisusb_driver, subminor))) { | 2518 | if (!(interface = usb_find_interface(&sisusb_driver, subminor))) { |
2558 | printk(KERN_ERR "sisusb[%d]: Failed to find interface\n", | 2519 | printk(KERN_ERR "sisusb[%d]: Failed to find interface\n", |
2559 | subminor); | 2520 | subminor); |
2560 | up(&disconnect_sem); | 2521 | mutex_unlock(&disconnect_mutex); |
2561 | return -ENODEV; | 2522 | return -ENODEV; |
2562 | } | 2523 | } |
2563 | 2524 | ||
2564 | if (!(sisusb = usb_get_intfdata(interface))) { | 2525 | if (!(sisusb = usb_get_intfdata(interface))) { |
2565 | up(&disconnect_sem); | 2526 | mutex_unlock(&disconnect_mutex); |
2566 | return -ENODEV; | 2527 | return -ENODEV; |
2567 | } | 2528 | } |
2568 | 2529 | ||
2569 | down(&sisusb->lock); | 2530 | mutex_lock(&sisusb->lock); |
2570 | 2531 | ||
2571 | if (!sisusb->present || !sisusb->ready) { | 2532 | if (!sisusb->present || !sisusb->ready) { |
2572 | up(&sisusb->lock); | 2533 | mutex_unlock(&sisusb->lock); |
2573 | up(&disconnect_sem); | 2534 | mutex_unlock(&disconnect_mutex); |
2574 | return -ENODEV; | 2535 | return -ENODEV; |
2575 | } | 2536 | } |
2576 | 2537 | ||
2577 | if (sisusb->isopen) { | 2538 | if (sisusb->isopen) { |
2578 | up(&sisusb->lock); | 2539 | mutex_unlock(&sisusb->lock); |
2579 | up(&disconnect_sem); | 2540 | mutex_unlock(&disconnect_mutex); |
2580 | return -EBUSY; | 2541 | return -EBUSY; |
2581 | } | 2542 | } |
2582 | 2543 | ||
2583 | if (!sisusb->devinit) { | 2544 | if (!sisusb->devinit) { |
2584 | if (sisusb->sisusb_dev->speed == USB_SPEED_HIGH) { | 2545 | if (sisusb->sisusb_dev->speed == USB_SPEED_HIGH) { |
2585 | if (sisusb_init_gfxdevice(sisusb, 0)) { | 2546 | if (sisusb_init_gfxdevice(sisusb, 0)) { |
2586 | up(&sisusb->lock); | 2547 | mutex_unlock(&sisusb->lock); |
2587 | up(&disconnect_sem); | 2548 | mutex_unlock(&disconnect_mutex); |
2588 | printk(KERN_ERR | 2549 | printk(KERN_ERR |
2589 | "sisusbvga[%d]: Failed to initialize " | 2550 | "sisusbvga[%d]: Failed to initialize " |
2590 | "device\n", | 2551 | "device\n", |
@@ -2592,8 +2553,8 @@ sisusb_open(struct inode *inode, struct file *file) | |||
2592 | return -EIO; | 2553 | return -EIO; |
2593 | } | 2554 | } |
2594 | } else { | 2555 | } else { |
2595 | up(&sisusb->lock); | 2556 | mutex_unlock(&sisusb->lock); |
2596 | up(&disconnect_sem); | 2557 | mutex_unlock(&disconnect_mutex); |
2597 | printk(KERN_ERR | 2558 | printk(KERN_ERR |
2598 | "sisusbvga[%d]: Device not attached to " | 2559 | "sisusbvga[%d]: Device not attached to " |
2599 | "USB 2.0 hub\n", | 2560 | "USB 2.0 hub\n", |
@@ -2609,9 +2570,9 @@ sisusb_open(struct inode *inode, struct file *file) | |||
2609 | 2570 | ||
2610 | file->private_data = sisusb; | 2571 | file->private_data = sisusb; |
2611 | 2572 | ||
2612 | up(&sisusb->lock); | 2573 | mutex_unlock(&sisusb->lock); |
2613 | 2574 | ||
2614 | up(&disconnect_sem); | 2575 | mutex_unlock(&disconnect_mutex); |
2615 | 2576 | ||
2616 | return 0; | 2577 | return 0; |
2617 | } | 2578 | } |
@@ -2642,14 +2603,14 @@ sisusb_release(struct inode *inode, struct file *file) | |||
2642 | struct sisusb_usb_data *sisusb; | 2603 | struct sisusb_usb_data *sisusb; |
2643 | int myminor; | 2604 | int myminor; |
2644 | 2605 | ||
2645 | down(&disconnect_sem); | 2606 | mutex_lock(&disconnect_mutex); |
2646 | 2607 | ||
2647 | if (!(sisusb = (struct sisusb_usb_data *)file->private_data)) { | 2608 | if (!(sisusb = (struct sisusb_usb_data *)file->private_data)) { |
2648 | up(&disconnect_sem); | 2609 | mutex_unlock(&disconnect_mutex); |
2649 | return -ENODEV; | 2610 | return -ENODEV; |
2650 | } | 2611 | } |
2651 | 2612 | ||
2652 | down(&sisusb->lock); | 2613 | mutex_lock(&sisusb->lock); |
2653 | 2614 | ||
2654 | if (sisusb->present) { | 2615 | if (sisusb->present) { |
2655 | /* Wait for all URBs to finish if device still present */ | 2616 | /* Wait for all URBs to finish if device still present */ |
@@ -2662,12 +2623,12 @@ sisusb_release(struct inode *inode, struct file *file) | |||
2662 | sisusb->isopen = 0; | 2623 | sisusb->isopen = 0; |
2663 | file->private_data = NULL; | 2624 | file->private_data = NULL; |
2664 | 2625 | ||
2665 | up(&sisusb->lock); | 2626 | mutex_unlock(&sisusb->lock); |
2666 | 2627 | ||
2667 | /* decrement the usage count on our device */ | 2628 | /* decrement the usage count on our device */ |
2668 | kref_put(&sisusb->kref, sisusb_delete); | 2629 | kref_put(&sisusb->kref, sisusb_delete); |
2669 | 2630 | ||
2670 | up(&disconnect_sem); | 2631 | mutex_unlock(&disconnect_mutex); |
2671 | 2632 | ||
2672 | return 0; | 2633 | return 0; |
2673 | } | 2634 | } |
@@ -2685,11 +2646,11 @@ sisusb_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos) | |||
2685 | if (!(sisusb = (struct sisusb_usb_data *)file->private_data)) | 2646 | if (!(sisusb = (struct sisusb_usb_data *)file->private_data)) |
2686 | return -ENODEV; | 2647 | return -ENODEV; |
2687 | 2648 | ||
2688 | down(&sisusb->lock); | 2649 | mutex_lock(&sisusb->lock); |
2689 | 2650 | ||
2690 | /* Sanity check */ | 2651 | /* Sanity check */ |
2691 | if (!sisusb->present || !sisusb->ready || !sisusb->sisusb_dev) { | 2652 | if (!sisusb->present || !sisusb->ready || !sisusb->sisusb_dev) { |
2692 | up(&sisusb->lock); | 2653 | mutex_unlock(&sisusb->lock); |
2693 | return -ENODEV; | 2654 | return -ENODEV; |
2694 | } | 2655 | } |
2695 | 2656 | ||
@@ -2784,7 +2745,7 @@ sisusb_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos) | |||
2784 | (*ppos) <= SISUSB_PCI_PSEUDO_PCIBASE + 0x5c) { | 2745 | (*ppos) <= SISUSB_PCI_PSEUDO_PCIBASE + 0x5c) { |
2785 | 2746 | ||
2786 | if (count != 4) { | 2747 | if (count != 4) { |
2787 | up(&sisusb->lock); | 2748 | mutex_unlock(&sisusb->lock); |
2788 | return -EINVAL; | 2749 | return -EINVAL; |
2789 | } | 2750 | } |
2790 | 2751 | ||
@@ -2808,7 +2769,7 @@ sisusb_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos) | |||
2808 | 2769 | ||
2809 | (*ppos) += bytes_read; | 2770 | (*ppos) += bytes_read; |
2810 | 2771 | ||
2811 | up(&sisusb->lock); | 2772 | mutex_unlock(&sisusb->lock); |
2812 | 2773 | ||
2813 | return errno ? errno : bytes_read; | 2774 | return errno ? errno : bytes_read; |
2814 | } | 2775 | } |
@@ -2827,11 +2788,11 @@ sisusb_write(struct file *file, const char __user *buffer, size_t count, | |||
2827 | if (!(sisusb = (struct sisusb_usb_data *)file->private_data)) | 2788 | if (!(sisusb = (struct sisusb_usb_data *)file->private_data)) |
2828 | return -ENODEV; | 2789 | return -ENODEV; |
2829 | 2790 | ||
2830 | down(&sisusb->lock); | 2791 | mutex_lock(&sisusb->lock); |
2831 | 2792 | ||
2832 | /* Sanity check */ | 2793 | /* Sanity check */ |
2833 | if (!sisusb->present || !sisusb->ready || !sisusb->sisusb_dev) { | 2794 | if (!sisusb->present || !sisusb->ready || !sisusb->sisusb_dev) { |
2834 | up(&sisusb->lock); | 2795 | mutex_unlock(&sisusb->lock); |
2835 | return -ENODEV; | 2796 | return -ENODEV; |
2836 | } | 2797 | } |
2837 | 2798 | ||
@@ -2930,7 +2891,7 @@ sisusb_write(struct file *file, const char __user *buffer, size_t count, | |||
2930 | (*ppos) <= SISUSB_PCI_PSEUDO_PCIBASE + SISUSB_PCI_PCONFSIZE) { | 2891 | (*ppos) <= SISUSB_PCI_PSEUDO_PCIBASE + SISUSB_PCI_PCONFSIZE) { |
2931 | 2892 | ||
2932 | if (count != 4) { | 2893 | if (count != 4) { |
2933 | up(&sisusb->lock); | 2894 | mutex_unlock(&sisusb->lock); |
2934 | return -EINVAL; | 2895 | return -EINVAL; |
2935 | } | 2896 | } |
2936 | 2897 | ||
@@ -2956,7 +2917,7 @@ sisusb_write(struct file *file, const char __user *buffer, size_t count, | |||
2956 | 2917 | ||
2957 | (*ppos) += bytes_written; | 2918 | (*ppos) += bytes_written; |
2958 | 2919 | ||
2959 | up(&sisusb->lock); | 2920 | mutex_unlock(&sisusb->lock); |
2960 | 2921 | ||
2961 | return errno ? errno : bytes_written; | 2922 | return errno ? errno : bytes_written; |
2962 | } | 2923 | } |
@@ -2970,11 +2931,11 @@ sisusb_lseek(struct file *file, loff_t offset, int orig) | |||
2970 | if (!(sisusb = (struct sisusb_usb_data *)file->private_data)) | 2931 | if (!(sisusb = (struct sisusb_usb_data *)file->private_data)) |
2971 | return -ENODEV; | 2932 | return -ENODEV; |
2972 | 2933 | ||
2973 | down(&sisusb->lock); | 2934 | mutex_lock(&sisusb->lock); |
2974 | 2935 | ||
2975 | /* Sanity check */ | 2936 | /* Sanity check */ |
2976 | if (!sisusb->present || !sisusb->ready || !sisusb->sisusb_dev) { | 2937 | if (!sisusb->present || !sisusb->ready || !sisusb->sisusb_dev) { |
2977 | up(&sisusb->lock); | 2938 | mutex_unlock(&sisusb->lock); |
2978 | return -ENODEV; | 2939 | return -ENODEV; |
2979 | } | 2940 | } |
2980 | 2941 | ||
@@ -2994,7 +2955,7 @@ sisusb_lseek(struct file *file, loff_t offset, int orig) | |||
2994 | ret = -EINVAL; | 2955 | ret = -EINVAL; |
2995 | } | 2956 | } |
2996 | 2957 | ||
2997 | up(&sisusb->lock); | 2958 | mutex_unlock(&sisusb->lock); |
2998 | return ret; | 2959 | return ret; |
2999 | } | 2960 | } |
3000 | 2961 | ||
@@ -3136,7 +3097,7 @@ sisusb_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | |||
3136 | if (!(sisusb = (struct sisusb_usb_data *)file->private_data)) | 3097 | if (!(sisusb = (struct sisusb_usb_data *)file->private_data)) |
3137 | return -ENODEV; | 3098 | return -ENODEV; |
3138 | 3099 | ||
3139 | down(&sisusb->lock); | 3100 | mutex_lock(&sisusb->lock); |
3140 | 3101 | ||
3141 | /* Sanity check */ | 3102 | /* Sanity check */ |
3142 | if (!sisusb->present || !sisusb->ready || !sisusb->sisusb_dev) { | 3103 | if (!sisusb->present || !sisusb->ready || !sisusb->sisusb_dev) { |
@@ -3193,7 +3154,7 @@ sisusb_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | |||
3193 | } | 3154 | } |
3194 | 3155 | ||
3195 | err_out: | 3156 | err_out: |
3196 | up(&sisusb->lock); | 3157 | mutex_unlock(&sisusb->lock); |
3197 | return retval; | 3158 | return retval; |
3198 | } | 3159 | } |
3199 | 3160 | ||
@@ -3258,7 +3219,7 @@ static int sisusb_probe(struct usb_interface *intf, | |||
3258 | } | 3219 | } |
3259 | kref_init(&sisusb->kref); | 3220 | kref_init(&sisusb->kref); |
3260 | 3221 | ||
3261 | init_MUTEX(&(sisusb->lock)); | 3222 | mutex_init(&(sisusb->lock)); |
3262 | 3223 | ||
3263 | /* Register device */ | 3224 | /* Register device */ |
3264 | if ((retval = usb_register_dev(intf, &usb_sisusb_class))) { | 3225 | if ((retval = usb_register_dev(intf, &usb_sisusb_class))) { |
@@ -3429,9 +3390,9 @@ static void sisusb_disconnect(struct usb_interface *intf) | |||
3429 | * protect all other routines from the disconnect | 3390 | * protect all other routines from the disconnect |
3430 | * case, not the other way round. | 3391 | * case, not the other way round. |
3431 | */ | 3392 | */ |
3432 | down(&disconnect_sem); | 3393 | mutex_lock(&disconnect_mutex); |
3433 | 3394 | ||
3434 | down(&sisusb->lock); | 3395 | mutex_lock(&sisusb->lock); |
3435 | 3396 | ||
3436 | /* Wait for all URBs to complete and kill them in case (MUST do) */ | 3397 | /* Wait for all URBs to complete and kill them in case (MUST do) */ |
3437 | if (!sisusb_wait_all_out_complete(sisusb)) | 3398 | if (!sisusb_wait_all_out_complete(sisusb)) |
@@ -3462,12 +3423,12 @@ static void sisusb_disconnect(struct usb_interface *intf) | |||
3462 | sisusb->present = 0; | 3423 | sisusb->present = 0; |
3463 | sisusb->ready = 0; | 3424 | sisusb->ready = 0; |
3464 | 3425 | ||
3465 | up(&sisusb->lock); | 3426 | mutex_unlock(&sisusb->lock); |
3466 | 3427 | ||
3467 | /* decrement our usage count */ | 3428 | /* decrement our usage count */ |
3468 | kref_put(&sisusb->kref, sisusb_delete); | 3429 | kref_put(&sisusb->kref, sisusb_delete); |
3469 | 3430 | ||
3470 | up(&disconnect_sem); | 3431 | mutex_unlock(&disconnect_mutex); |
3471 | 3432 | ||
3472 | printk(KERN_INFO "sisusbvga[%d]: Disconnected\n", minor); | 3433 | printk(KERN_INFO "sisusbvga[%d]: Disconnected\n", minor); |
3473 | } | 3434 | } |