aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/gmidi.c
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2006-12-05 06:15:33 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-12-20 13:14:26 -0500
commit6bea476cf628eb7bb18a036ac6a8fed1ad319951 (patch)
tree1d73df1432d393ecf82c16604fa40f0f8a1aa581 /drivers/usb/gadget/gmidi.c
parent5f8364b7d63acdc2216ca0f7d0a8557c318479ea (diff)
USB: gadget driver unbind() is optional; section fixes; misc
Allow gadget drivers to omit the unbind() method. When they're statically linked, that's an appropriate memory saving tweak. Similarly, provide consistent/simpler handling for a should-not-happen error case: removing a peripheral controller driver when a gadget driver is still loaded. Such code dates back to early versions of the first implementation of the gadget API, and has never been triggered. Includes relevant section annotation fixs for gmidi.c, file_storage.c, and serial.c; we don't yet have an "init or exit" annotation. Also some whitespace fixes in gmidi.c (space at EOL, before tabs, etc). Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget/gmidi.c')
-rw-r--r--drivers/usb/gadget/gmidi.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/usb/gadget/gmidi.c b/drivers/usb/gadget/gmidi.c
index 31351826f2ba..f1a679656c96 100644
--- a/drivers/usb/gadget/gmidi.c
+++ b/drivers/usb/gadget/gmidi.c
@@ -123,7 +123,7 @@ struct gmidi_device {
123 struct usb_request *req; /* for control responses */ 123 struct usb_request *req; /* for control responses */
124 u8 config; 124 u8 config;
125 struct usb_ep *in_ep, *out_ep; 125 struct usb_ep *in_ep, *out_ep;
126 struct snd_card *card; 126 struct snd_card *card;
127 struct snd_rawmidi *rmidi; 127 struct snd_rawmidi *rmidi;
128 struct snd_rawmidi_substream *in_substream; 128 struct snd_rawmidi_substream *in_substream;
129 struct snd_rawmidi_substream *out_substream; 129 struct snd_rawmidi_substream *out_substream;
@@ -490,7 +490,7 @@ static void gmidi_complete(struct usb_ep *ep, struct usb_request *req)
490 int status = req->status; 490 int status = req->status;
491 491
492 switch (status) { 492 switch (status) {
493 case 0: /* normal completion */ 493 case 0: /* normal completion */
494 if (ep == dev->out_ep) { 494 if (ep == dev->out_ep) {
495 /* we received stuff. 495 /* we received stuff.
496 req is queued again, below */ 496 req is queued again, below */
@@ -505,7 +505,7 @@ static void gmidi_complete(struct usb_ep *ep, struct usb_request *req)
505 break; 505 break;
506 506
507 /* this endpoint is normally active while we're configured */ 507 /* this endpoint is normally active while we're configured */
508 case -ECONNABORTED: /* hardware forced ep reset */ 508 case -ECONNABORTED: /* hardware forced ep reset */
509 case -ECONNRESET: /* request dequeued */ 509 case -ECONNRESET: /* request dequeued */
510 case -ESHUTDOWN: /* disconnect from host */ 510 case -ESHUTDOWN: /* disconnect from host */
511 VDBG(dev, "%s gone (%d), %d/%d\n", ep->name, status, 511 VDBG(dev, "%s gone (%d), %d/%d\n", ep->name, status,
@@ -656,7 +656,7 @@ gmidi_set_config(struct gmidi_device *dev, unsigned number, gfp_t gfp_flags)
656 case USB_SPEED_LOW: speed = "low"; break; 656 case USB_SPEED_LOW: speed = "low"; break;
657 case USB_SPEED_FULL: speed = "full"; break; 657 case USB_SPEED_FULL: speed = "full"; break;
658 case USB_SPEED_HIGH: speed = "high"; break; 658 case USB_SPEED_HIGH: speed = "high"; break;
659 default: speed = "?"; break; 659 default: speed = "?"; break;
660 } 660 }
661 661
662 dev->config = number; 662 dev->config = number;
@@ -1308,7 +1308,7 @@ static struct usb_gadget_driver gmidi_driver = {
1308 .speed = USB_SPEED_FULL, 1308 .speed = USB_SPEED_FULL,
1309 .function = (char *)longname, 1309 .function = (char *)longname,
1310 .bind = gmidi_bind, 1310 .bind = gmidi_bind,
1311 .unbind = __exit_p(gmidi_unbind), 1311 .unbind = gmidi_unbind,
1312 1312
1313 .setup = gmidi_setup, 1313 .setup = gmidi_setup,
1314 .disconnect = gmidi_disconnect, 1314 .disconnect = gmidi_disconnect,
@@ -1316,7 +1316,7 @@ static struct usb_gadget_driver gmidi_driver = {
1316 .suspend = gmidi_suspend, 1316 .suspend = gmidi_suspend,
1317 .resume = gmidi_resume, 1317 .resume = gmidi_resume,
1318 1318
1319 .driver = { 1319 .driver = {
1320 .name = (char *)shortname, 1320 .name = (char *)shortname,
1321 .owner = THIS_MODULE, 1321 .owner = THIS_MODULE,
1322 }, 1322 },