From patchwork Fri Oct 17 17:09:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 38897 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 79C47202DB for ; Fri, 17 Oct 2014 17:10:26 +0000 (UTC) Received: by mail-lb0-f198.google.com with SMTP id 10sf711584lbg.9 for ; Fri, 17 Oct 2014 10:10:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=IcNAO+XtLifpDiWx9Y+iDKH/p1zoh09g8dGnvgnnoog=; b=hTyMuTn/2Svgd+Ei9JcKHpZslaXMIC4O1mFdWkVjMx/TaIZUyoTh3/lQb/vPOF+lXR 9u/R4c2NCeV9GxOT2I8IPEietgQVn/CNU7mTbMA3+Ita9G9cA9rM8LfaPtqUWS+/t71V B5AULqOdfwKY85vVjM6fVRh2j3e1AXC94yhENLryBhwvDweYuPRpD/ZrOF9Suzt0AfIH TyYFaV5/fYC+RnoZIna8lyHtDvd4FrsOuxz6z2ed+qBved9Mu4lI1uNuuwFXhBttqSLu RezAgyX0/27ZRDSl9raimNCHwq8yW5fFf6ImrDvGAHqG0h4STUNQg8fgNKfT7Z+vBY2Z AbyA== X-Gm-Message-State: ALoCoQkDjSaaF5wE1oW2H+7NTHcMz1rfQIRd0bvN+xWYLxhJGm79W6eOb90Vz00q/ljk9a+Yu0mm X-Received: by 10.112.32.163 with SMTP id k3mr15124lbi.17.1413565825275; Fri, 17 Oct 2014 10:10:25 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.234.233 with SMTP id uh9ls273574lac.70.gmail; Fri, 17 Oct 2014 10:10:25 -0700 (PDT) X-Received: by 10.112.47.132 with SMTP id d4mr10133400lbn.64.1413565825122; Fri, 17 Oct 2014 10:10:25 -0700 (PDT) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com. [209.85.217.174]) by mx.google.com with ESMTPS id r9si2995854lag.32.2014.10.17.10.10.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 17 Oct 2014 10:10:24 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) client-ip=209.85.217.174; Received: by mail-lb0-f174.google.com with SMTP id p9so1047409lbv.33 for ; Fri, 17 Oct 2014 10:10:24 -0700 (PDT) X-Received: by 10.112.77.74 with SMTP id q10mr1917853lbw.66.1413565824800; Fri, 17 Oct 2014 10:10:24 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.84.229 with SMTP id c5csp266669lbz; Fri, 17 Oct 2014 10:10:23 -0700 (PDT) X-Received: by 10.68.212.5 with SMTP id ng5mr9768078pbc.15.1413565823233; Fri, 17 Oct 2014 10:10:23 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cy3si1554535pbc.205.2014.10.17.10.10.22 for ; Fri, 17 Oct 2014 10:10:23 -0700 (PDT) Received-SPF: none (google.com: linux-usb-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753446AbaJQRKT (ORCPT + 3 others); Fri, 17 Oct 2014 13:10:19 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:35991 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753398AbaJQRKS (ORCPT ); Fri, 17 Oct 2014 13:10:18 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id s9HHAI4Y024639 for ; Fri, 17 Oct 2014 12:10:18 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s9HHAIp0023087 for ; Fri, 17 Oct 2014 12:10:18 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.174.1; Fri, 17 Oct 2014 12:10:17 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s9HHAHdt022132; Fri, 17 Oct 2014 12:10:18 -0500 From: Felipe Balbi To: Linux USB Mailing List CC: Felipe Balbi Subject: [PATCH 03/28] usb: dwc3: gadget: move isoc endpoint check to unlocked set_halt Date: Fri, 17 Oct 2014 12:09:39 -0500 Message-ID: <1413565804-13061-4-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.1.0.GIT In-Reply-To: <1413565804-13061-1-git-send-email-balbi@ti.com> References: <1413565804-13061-1-git-send-email-balbi@ti.com> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: balbi@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , __dwc3_gadget_ep_set_halt() is the function which handles the actual halt feature. In order to cope with some extra cleanup comming as a follow-up patch let's move the isochronous endpoint check there too. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/gadget.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 3818b26b..fd92f63 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -1208,6 +1208,11 @@ int __dwc3_gadget_ep_set_halt(struct dwc3_ep *dep, int value) struct dwc3 *dwc = dep->dwc; int ret; + if (usb_endpoint_xfer_isoc(dep->endpoint.desc)) { + dev_err(dwc->dev, "%s is of Isochronous type\n", dep->name); + return -EINVAL; + } + memset(¶ms, 0x00, sizeof(params)); if (value) { @@ -1241,15 +1246,7 @@ static int dwc3_gadget_ep_set_halt(struct usb_ep *ep, int value) int ret; spin_lock_irqsave(&dwc->lock, flags); - - if (usb_endpoint_xfer_isoc(dep->endpoint.desc)) { - dev_err(dwc->dev, "%s is of Isochronous type\n", dep->name); - ret = -EINVAL; - goto out; - } - ret = __dwc3_gadget_ep_set_halt(dep, value); -out: spin_unlock_irqrestore(&dwc->lock, flags); return ret;