Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1193769

[PATCH 6/7] usb: gadget: apply generic altsetting support check mechanism

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Robert Baldyga <r.baldyga@samsung.com>
Newsgroups linux.kernel
Subject [PATCH 6/7] usb: gadget: apply generic altsetting support check mechanism
Date Tue, 28 Jul 2015 07:30:02 +0200
Message-ID <pR5CG-86P-9@gated-at.bofh.it> (permalink)
References <pR5CG-86P-11@gated-at.bofh.it>
X-Original-To balbi@ti.com
X-Auditid cbfee61b-f79706d000001b96-9a-55b7112d6a10
X-Mailer git-send-email 1.9.1
X-Brightmail-Tracker H4sIAAAAAAAAA+NgFtrKLMWRmVeSWpSXmKPExsVy+t9jAV1dwe2hBj2rDC1mvWxnsTh4v96i 6e8rFovmxevZLC6sM7fY9Pgaq8XlXXPYLBYta2W2WHvkLrvFg8M72S1mvRF24PboX/eZ1WPn rLvsHvvnrmH32Lyk3qNvyypGj+M3tjN5fN4k57F993KWAI4oLpuU1JzMstQifbsEroy3b3uY Cw4KVKz4LdHAOJOvi5GTQ0LAROL18T1MELaYxIV769m6GLk4hASWMkpsa17FCOH8ZJSYNmMd C0gVm4COxJbvExhBbBEBAYn1Ly6xgxQxCyxmkti+7QMzSEJYIETi/LbtYA0sAqoS666uBGrg 4OAVcJXYeaYGYpucxMljk1lBbE4BN4mP63ewgdhCQCUPbrQxT2DkXcDIsIpRIrUguaA4KT3X KC+1XK84Mbe4NC9dLzk/dxMjODCfSe9gPLzL/RCjAAejEg/viw3bQoVYE8uKK3MPMUpwMCuJ 8PZ9BgrxpiRWVqUW5ccXleakFh9ilOZgURLn1TfZFCokkJ5YkpqdmlqQWgSTZeLglGpg1Flb 48H95/XC2VLbc47X1v2W1Nuh/XWePrPJhCqnlNMv7kXar9NffcWgxJx30lmO3W8nWL1cwC4x S700qXBC7FqGh36muw5pL5P8se7DW8+Vn4qXBwRyiXXeMb2ferq7J3S5zM/tswKXti2qXn0g tr/25lnrYxcenf92OXfb5jNZWydOLv/NkqfEUpyRaKjFXFScCADxttMiSAIAAA==
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 58
Organization linux.* mail to news gateway
X-Original-Cc gregkh@linuxfoundation.org, daniel@zonque.org, haojian.zhuang@gmail.com, robert.jarzmik@free.fr, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, andrzej.p@samsung.com, m.szyprowski@samsung.com, Robert Baldyga <r.baldyga@samsung.com>
X-Original-Date Tue, 28 Jul 2015 07:20:03 +0200
X-Original-Message-ID <1438060804-21706-7-git-send-email-r.baldyga@samsung.com>
X-Original-References <1438060804-21706-1-git-send-email-r.baldyga@samsung.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref aioe.org linux.kernel:1193769

Show key headers only | View raw


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>
---
 drivers/usb/gadget/function/f_obex.c  | 2 +-
 drivers/usb/gadget/function/u_ether.h | 2 +-
 drivers/usb/gadget/legacy/nokia.c     | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/gadget/function/f_obex.c b/drivers/usb/gadget/function/f_obex.c
index 5519f85..2682d59 100644
--- a/drivers/usb/gadget/function/f_obex.c
+++ b/drivers/usb/gadget/function/f_obex.c
@@ -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 ... */
diff --git a/drivers/usb/gadget/function/u_ether.h b/drivers/usb/gadget/function/u_ether.h
index 334b3894..1384f00 100644
--- a/drivers/usb/gadget/function/u_ether.h
+++ b/drivers/usb/gadget/function/u_ether.h
@@ -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
diff --git a/drivers/usb/gadget/legacy/nokia.c b/drivers/usb/gadget/legacy/nokia.c
index 8902f45..264c97e 100644
--- a/drivers/usb/gadget/legacy/nokia.c
+++ b/drivers/usb/gadget/legacy/nokia.c
@@ -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;
 	}
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 6/7] usb: gadget: apply generic altsetting support check  mechanism Robert Baldyga <r.baldyga@samsung.com> - 2015-07-28 07:30 +0200

csiph-web