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>

authored by Oliver Neukum and committed by Greg Kroah-Hartman 413ba6fb 7c992001

+3 -52
+3 -52
drivers/usb/serial/ti_usb_3410_5052.c
··· 16 * For questions or problems with this driver, contact Texas Instruments 17 * technical support, or Al Borchers <alborchers@steinerpoint.com>, or 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 */ 70 71 #include <linux/kernel.h> ··· 407 goto free_tdev; 408 } 409 410 - /* the second configuration must be set (in sysfs by hotplug script) */ 411 if (dev->actconfig->desc.bConfigurationValue == TI_BOOT_CONFIG) { 412 - status = -ENODEV; 413 goto free_tdev; 414 } 415
··· 16 * For questions or problems with this driver, contact Texas Instruments 17 * technical support, or Al Borchers <alborchers@steinerpoint.com>, or 18 * Peter Berger <pberger@brimson.com>. 19 */ 20 21 #include <linux/kernel.h> ··· 457 goto free_tdev; 458 } 459 460 + /* the second configuration must be set */ 461 if (dev->actconfig->desc.bConfigurationValue == TI_BOOT_CONFIG) { 462 + status = usb_driver_set_configuration(dev, TI_ACTIVE_CONFIG); 463 + status = status ? status : -ENODEV; 464 goto free_tdev; 465 } 466