diff options
Diffstat (limited to 'drivers/usb/gadget/serial.c')
-rw-r--r-- | drivers/usb/gadget/serial.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/usb/gadget/serial.c b/drivers/usb/gadget/serial.c index ba9acd531024..b992546c394d 100644 --- a/drivers/usb/gadget/serial.c +++ b/drivers/usb/gadget/serial.c | |||
@@ -369,7 +369,7 @@ static struct usb_gadget_driver gs_gadget_driver = { | |||
369 | #endif /* CONFIG_USB_GADGET_DUALSPEED */ | 369 | #endif /* CONFIG_USB_GADGET_DUALSPEED */ |
370 | .function = GS_LONG_NAME, | 370 | .function = GS_LONG_NAME, |
371 | .bind = gs_bind, | 371 | .bind = gs_bind, |
372 | .unbind = gs_unbind, | 372 | .unbind = __exit_p(gs_unbind), |
373 | .setup = gs_setup, | 373 | .setup = gs_setup, |
374 | .disconnect = gs_disconnect, | 374 | .disconnect = gs_disconnect, |
375 | .driver = { | 375 | .driver = { |
@@ -1413,7 +1413,7 @@ requeue: | |||
1413 | * Called on module load. Allocates and initializes the device | 1413 | * Called on module load. Allocates and initializes the device |
1414 | * structure and a control request. | 1414 | * structure and a control request. |
1415 | */ | 1415 | */ |
1416 | static int gs_bind(struct usb_gadget *gadget) | 1416 | static int __init gs_bind(struct usb_gadget *gadget) |
1417 | { | 1417 | { |
1418 | int ret; | 1418 | int ret; |
1419 | struct usb_ep *ep; | 1419 | struct usb_ep *ep; |
@@ -1538,7 +1538,7 @@ autoconf_fail: | |||
1538 | * Called on module unload. Frees the control request and device | 1538 | * Called on module unload. Frees the control request and device |
1539 | * structure. | 1539 | * structure. |
1540 | */ | 1540 | */ |
1541 | static void gs_unbind(struct usb_gadget *gadget) | 1541 | static void __exit gs_unbind(struct usb_gadget *gadget) |
1542 | { | 1542 | { |
1543 | struct gs_dev *dev = get_gadget_data(gadget); | 1543 | struct gs_dev *dev = get_gadget_data(gadget); |
1544 | 1544 | ||
@@ -2178,10 +2178,9 @@ static int gs_alloc_ports(struct gs_dev *dev, gfp_t kmalloc_flags) | |||
2178 | return -EIO; | 2178 | return -EIO; |
2179 | 2179 | ||
2180 | for (i=0; i<GS_NUM_PORTS; i++) { | 2180 | for (i=0; i<GS_NUM_PORTS; i++) { |
2181 | if ((port=(struct gs_port *)kmalloc(sizeof(struct gs_port), kmalloc_flags)) == NULL) | 2181 | if ((port=kzalloc(sizeof(struct gs_port), kmalloc_flags)) == NULL) |
2182 | return -ENOMEM; | 2182 | return -ENOMEM; |
2183 | 2183 | ||
2184 | memset(port, 0, sizeof(struct gs_port)); | ||
2185 | port->port_dev = dev; | 2184 | port->port_dev = dev; |
2186 | port->port_num = i; | 2185 | port->port_num = i; |
2187 | port->port_line_coding.dwDTERate = cpu_to_le32(GS_DEFAULT_DTE_RATE); | 2186 | port->port_line_coding.dwDTERate = cpu_to_le32(GS_DEFAULT_DTE_RATE); |