]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
usb: gadget: apply generic altsetting support check mechanism
authorRobert Baldyga <r.baldyga@samsung.com>
Tue, 28 Jul 2015 05:20:03 +0000 (07:20 +0200)
committerFelipe Balbi <balbi@ti.com>
Thu, 30 Jul 2015 16:43:36 +0000 (11:43 -0500)
Replace calls of gadget_supports_altsettings() function (which check altset
support by comparing UDC controller name with hardcoded names) with
gadget_is_altset_supported() which checks generic quirk bitfield.

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/function/f_obex.c
drivers/usb/gadget/function/u_ether.h
drivers/usb/gadget/legacy/nokia.c

index 5519f858904bc8336ab891be54f09340d3d6cf04..2682d59f56755272b3ff79926352bec171dcdf76 100644 (file)
@@ -297,7 +297,7 @@ static inline bool can_support_obex(struct usb_configuration *c)
         *
         * Altsettings are mandatory, however...
         */
-       if (!gadget_supports_altsettings(c->cdev->gadget))
+       if (!gadget_is_altset_supported(c->cdev->gadget))
                return false;
 
        /* everything else is *probably* fine ... */
index 334b389479165b4bf3391ee39e086f18a777ca9e..1384f000bd80838008023d3c7d388c5890b8ac4d 100644 (file)
@@ -259,7 +259,7 @@ void gether_disconnect(struct gether *);
 /* Some controllers can't support CDC Ethernet (ECM) ... */
 static inline bool can_support_ecm(struct usb_gadget *gadget)
 {
-       if (!gadget_supports_altsettings(gadget))
+       if (!gadget_is_altset_supported(gadget))
                return false;
 
        /* Everything else is *presumably* fine ... but this is a bit
index 8902f454b7bcf692dc12f3c063762b37cdd559fc..264c97e15478b27e99b53cc0062145a339fed74f 100644 (file)
@@ -292,7 +292,7 @@ static int nokia_bind(struct usb_composite_dev *cdev)
        nokia_config_500ma_driver.iConfiguration = status;
        nokia_config_100ma_driver.iConfiguration = status;
 
-       if (!gadget_supports_altsettings(gadget)) {
+       if (!gadget_is_altset_supported(gadget)) {
                status = -ENODEV;
                goto err_usb;
        }