diff options
Diffstat (limited to 'drivers/usb/gadget/printer.c')
| -rw-r--r-- | drivers/usb/gadget/printer.c | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/drivers/usb/gadget/printer.c b/drivers/usb/gadget/printer.c index a341dde6f9c3..65a8834f274b 100644 --- a/drivers/usb/gadget/printer.c +++ b/drivers/usb/gadget/printer.c | |||
| @@ -8,15 +8,6 @@ | |||
| 8 | * it under the terms of the GNU General Public License as published by | 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation; either version 2 of the License, or | 9 | * the Free Software Foundation; either version 2 of the License, or |
| 10 | * (at your option) any later version. | 10 | * (at your option) any later version. |
| 11 | * | ||
| 12 | * This program is distributed in the hope that it will be useful, | ||
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | * GNU General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License | ||
| 18 | * along with this program; if not, write to the Free Software | ||
| 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 20 | */ | 11 | */ |
| 21 | 12 | ||
| 22 | #include <linux/module.h> | 13 | #include <linux/module.h> |
| @@ -971,23 +962,15 @@ printer_set_config(struct printer_dev *dev, unsigned number) | |||
| 971 | usb_gadget_vbus_draw(dev->gadget, | 962 | usb_gadget_vbus_draw(dev->gadget, |
| 972 | dev->gadget->is_otg ? 8 : 100); | 963 | dev->gadget->is_otg ? 8 : 100); |
| 973 | } else { | 964 | } else { |
| 974 | char *speed; | ||
| 975 | unsigned power; | 965 | unsigned power; |
| 976 | 966 | ||
| 977 | power = 2 * config_desc.bMaxPower; | 967 | power = 2 * config_desc.bMaxPower; |
| 978 | usb_gadget_vbus_draw(dev->gadget, power); | 968 | usb_gadget_vbus_draw(dev->gadget, power); |
| 979 | 969 | ||
| 980 | switch (gadget->speed) { | ||
| 981 | case USB_SPEED_FULL: speed = "full"; break; | ||
| 982 | #ifdef CONFIG_USB_GADGET_DUALSPEED | ||
| 983 | case USB_SPEED_HIGH: speed = "high"; break; | ||
| 984 | #endif | ||
| 985 | default: speed = "?"; break; | ||
| 986 | } | ||
| 987 | |||
| 988 | dev->config = number; | 970 | dev->config = number; |
| 989 | INFO(dev, "%s speed config #%d: %d mA, %s\n", | 971 | INFO(dev, "%s config #%d: %d mA, %s\n", |
| 990 | speed, number, power, driver_desc); | 972 | usb_speed_string(gadget->speed), |
| 973 | number, power, driver_desc); | ||
| 991 | } | 974 | } |
| 992 | return result; | 975 | return result; |
| 993 | } | 976 | } |
| @@ -1611,7 +1594,7 @@ cleanup(void) | |||
| 1611 | if (status) | 1594 | if (status) |
| 1612 | ERROR(dev, "usb_gadget_unregister_driver %x\n", status); | 1595 | ERROR(dev, "usb_gadget_unregister_driver %x\n", status); |
| 1613 | 1596 | ||
| 1614 | unregister_chrdev_region(g_printer_devno, 2); | 1597 | unregister_chrdev_region(g_printer_devno, 1); |
| 1615 | class_destroy(usb_gadget_class); | 1598 | class_destroy(usb_gadget_class); |
| 1616 | mutex_unlock(&usb_printer_gadget.lock_printer_io); | 1599 | mutex_unlock(&usb_printer_gadget.lock_printer_io); |
| 1617 | } | 1600 | } |
