Commit 413ba6fb51fa8dc77be09552e506d00f31234e0d
Committed by
Greg Kroah-Hartman
1 parent
7c99200142
Exists in
master
and in
7 other branches
USB: set correct configuration in probe of ti_usb_3410_5052
This driver transfers firmware. It may just as well set the correct configuration. Signed-off-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Showing 1 changed file with 3 additions and 52 deletions Side-by-side Diff
drivers/usb/serial/ti_usb_3410_5052.c
... | ... | @@ -16,56 +16,6 @@ |
16 | 16 | * For questions or problems with this driver, contact Texas Instruments |
17 | 17 | * technical support, or Al Borchers <alborchers@steinerpoint.com>, or |
18 | 18 | * Peter Berger <pberger@brimson.com>. |
19 | - * | |
20 | - * This driver needs this hotplug script in /etc/hotplug/usb/ti_usb_3410_5052 | |
21 | - * or in /etc/hotplug.d/usb/ti_usb_3410_5052.hotplug to set the device | |
22 | - * configuration. | |
23 | - * | |
24 | - * #!/bin/bash | |
25 | - * | |
26 | - * BOOT_CONFIG=1 | |
27 | - * ACTIVE_CONFIG=2 | |
28 | - * | |
29 | - * if [[ "$ACTION" != "add" ]] | |
30 | - * then | |
31 | - * exit | |
32 | - * fi | |
33 | - * | |
34 | - * CONFIG_PATH=/sys${DEVPATH%/?*}/bConfigurationValue | |
35 | - * | |
36 | - * if [[ 0`cat $CONFIG_PATH` -ne $BOOT_CONFIG ]] | |
37 | - * then | |
38 | - * exit | |
39 | - * fi | |
40 | - * | |
41 | - * PRODUCT=${PRODUCT%/?*} # delete version | |
42 | - * VENDOR_ID=`printf "%d" 0x${PRODUCT%/?*}` | |
43 | - * PRODUCT_ID=`printf "%d" 0x${PRODUCT#*?/}` | |
44 | - * | |
45 | - * PARAM_PATH=/sys/module/ti_usb_3410_5052/parameters | |
46 | - * | |
47 | - * function scan() { | |
48 | - * s=$1 | |
49 | - * shift | |
50 | - * for i | |
51 | - * do | |
52 | - * if [[ $s -eq $i ]] | |
53 | - * then | |
54 | - * return 0 | |
55 | - * fi | |
56 | - * done | |
57 | - * return 1 | |
58 | - * } | |
59 | - * | |
60 | - * IFS=$IFS, | |
61 | - * | |
62 | - * if (scan $VENDOR_ID 1105 `cat $PARAM_PATH/vendor_3410` && | |
63 | - * scan $PRODUCT_ID 13328 `cat $PARAM_PATH/product_3410`) || | |
64 | - * (scan $VENDOR_ID 1105 `cat $PARAM_PATH/vendor_5052` && | |
65 | - * scan $PRODUCT_ID 20562 20818 20570 20575 `cat $PARAM_PATH/product_5052`) | |
66 | - * then | |
67 | - * echo $ACTIVE_CONFIG > $CONFIG_PATH | |
68 | - * fi | |
69 | 19 | */ |
70 | 20 | |
71 | 21 | #include <linux/kernel.h> |
72 | 22 | |
... | ... | @@ -457,9 +407,10 @@ |
457 | 407 | goto free_tdev; |
458 | 408 | } |
459 | 409 | |
460 | - /* the second configuration must be set (in sysfs by hotplug script) */ | |
410 | + /* the second configuration must be set */ | |
461 | 411 | if (dev->actconfig->desc.bConfigurationValue == TI_BOOT_CONFIG) { |
462 | - status = -ENODEV; | |
412 | + status = usb_driver_set_configuration(dev, TI_ACTIVE_CONFIG); | |
413 | + status = status ? status : -ENODEV; | |
463 | 414 | goto free_tdev; |
464 | 415 | } |
465 | 416 |