From patchwork Fri Oct 17 17:17:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 38959 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 17713202DB for ; Fri, 17 Oct 2014 17:19:16 +0000 (UTC) Received: by mail-wg0-f69.google.com with SMTP id b13sf721677wgh.0 for ; Fri, 17 Oct 2014 10:19:15 -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=hVwdL1WypM2uRRrlJQGg23+aIQEmppexT4p0tJeyiSs=; b=Gfc8bAeCPuPuKRLRbR6bA5T6r1ZYuw/cjVgCs1vJmta5Z2W9j7TStFhMLZMoRA4ukH IeoVT8aJOvtN30H/wCOKaROhgXbQceCAJ+GyyEH5/l6aiT11KZZah2/4N+KBAMzSXO5J PCtJ+XR0V8a0gXCdsaLoo8Z+/J8cCAQLgZUscFRJ7mK+jzXGdEq8mLobCj8tHNZog4al 45bZmWLDqJjZAauFM5iUV1DzqDqiirz2DECawRiDhvX/CmbFip3bCmc1b1LbtGmR0IQS nw191Y3Qgd1Xq3O1uvaoR+y0v1zCXWMQ/OON7h7G7v0TJQo5XyyyUTKIrfIGe4mr+xhR 8Pgw== X-Gm-Message-State: ALoCoQnVe3T8KHQbsrfQGcBYsX49xGXi78pYQpqYzY17FiJ740NNiFYi38S/3X2DL/YdwMWuihum X-Received: by 10.112.147.131 with SMTP id tk3mr1608056lbb.2.1413566355294; Fri, 17 Oct 2014 10:19:15 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.169 with SMTP id r9ls235329laj.57.gmail; Fri, 17 Oct 2014 10:19:14 -0700 (PDT) X-Received: by 10.152.3.168 with SMTP id d8mr10346908lad.34.1413566354871; Fri, 17 Oct 2014 10:19:14 -0700 (PDT) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com. [209.85.217.172]) by mx.google.com with ESMTPS id xe3si2954371lbb.114.2014.10.17.10.19.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 17 Oct 2014 10:19:14 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by mail-lb0-f172.google.com with SMTP id b6so1057839lbj.3 for ; Fri, 17 Oct 2014 10:19:14 -0700 (PDT) X-Received: by 10.112.189.10 with SMTP id ge10mr10136235lbc.23.1413566354770; Fri, 17 Oct 2014 10:19:14 -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 c5csp268251lbz; Fri, 17 Oct 2014 10:19:14 -0700 (PDT) X-Received: by 10.70.48.138 with SMTP id l10mr9695216pdn.139.1413566341220; Fri, 17 Oct 2014 10:19:01 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id tf2si376641pac.129.2014.10.17.10.19.00 for ; Fri, 17 Oct 2014 10:19:01 -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 S1753801AbaJQRS6 (ORCPT + 3 others); Fri, 17 Oct 2014 13:18:58 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:56037 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753719AbaJQRS3 (ORCPT ); Fri, 17 Oct 2014 13:18:29 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id s9HHILnj029557; Fri, 17 Oct 2014 12:18:21 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s9HHILrg001261; Fri, 17 Oct 2014 12:18:21 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.174.1; Fri, 17 Oct 2014 12:18:22 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s9HHIKnx031282; Fri, 17 Oct 2014 12:18:21 -0500 From: Felipe Balbi To: Linux USB Mailing List CC: Greg KH , , Paul Zimmerman , , , , , , , Felipe Balbi Subject: [PATCH 54/67] usb: gadget: udc: s3c-hsudc: do not rely on 'driver' argument Date: Fri, 17 Oct 2014 12:17:01 -0500 Message-ID: <1413566234-13537-55-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.1.0.GIT In-Reply-To: <1413566234-13537-1-git-send-email-balbi@ti.com> References: <1413566234-13537-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.172 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: , future patches will remove the extra 'driver' argument to ->udc_stop(), in order to do that, we must make sure that our UDC does not rely on it first. Signed-off-by: Felipe Balbi --- drivers/usb/gadget/udc/s3c-hsudc.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/usb/gadget/udc/s3c-hsudc.c b/drivers/usb/gadget/udc/s3c-hsudc.c index f658f69..f3bb2fa 100644 --- a/drivers/usb/gadget/udc/s3c-hsudc.c +++ b/drivers/usb/gadget/udc/s3c-hsudc.c @@ -1199,11 +1199,7 @@ static int s3c_hsudc_stop(struct usb_gadget *gadget, if (!hsudc) return -ENODEV; - if (!driver || driver != hsudc->driver) - return -EINVAL; - spin_lock_irqsave(&hsudc->lock, flags); - hsudc->driver = NULL; hsudc->gadget.speed = USB_SPEED_UNKNOWN; s3c_hsudc_uninit_phy(); @@ -1222,7 +1218,9 @@ static int s3c_hsudc_stop(struct usb_gadget *gadget, regulator_bulk_disable(ARRAY_SIZE(hsudc->supplies), hsudc->supplies); dev_info(hsudc->dev, "unregistered gadget driver '%s'\n", - driver->driver.name); + hsudc->driver->driver.name); + hsudc->driver = NULL; + return 0; }