From patchwork Mon Oct 20 10:45:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 39035 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D3BD3203C5 for ; Mon, 20 Oct 2014 10:46:01 +0000 (UTC) Received: by mail-lb0-f197.google.com with SMTP id p9sf2330444lbv.4 for ; Mon, 20 Oct 2014 03:46:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=e/b7iAvcTG9mEh6Gya2xJvafguAaYvXjFDdKUcGbUoI=; b=buIfTUdJsyQip+STlE9d5ziZ8SQlvozWYi3FaZTt03wEJ97ZXRGST6iYSenmMxSwum 0wCnlayvaomUGeSrYbJs/dAKcT83JQb6o7rJT5wmPSgUz7BZPH8hI9savPCMUmsHkCW5 dkFXAMGUyHcFIwLPdv9CEqtjPAa7PwzUc27cfwn7bgpeG7kCeR5zbDb0RW5e3vOxNov+ mUnfSZkkejC0QxCxlhpM0S4s7tHnGPlnDJzJjHfMW5JB6rl0GHd6A/8x/rCD875ZW6c2 iuDwuGcLDJPsUrhktAcbysqYlPK9K9Yl2oAfan3b3pPoMAgdLJWTVXGAxdQ2MA1I7VkL itHA== X-Gm-Message-State: ALoCoQmTS++YZopdKkQiOXt3vm6whOEdaYB1JBRyf9zAm6JSXtwIPN/jZr5cED5/iO0R5nOgIt2K X-Received: by 10.181.11.130 with SMTP id ei2mr2332545wid.3.1413801960640; Mon, 20 Oct 2014 03:46:00 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.170.133 with SMTP id am5ls462757lac.54.gmail; Mon, 20 Oct 2014 03:46:00 -0700 (PDT) X-Received: by 10.152.43.229 with SMTP id z5mr2615339lal.86.1413801960373; Mon, 20 Oct 2014 03:46:00 -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 bn10si13664603lbc.108.2014.10.20.03.46.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 20 Oct 2014 03:46:00 -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 p9so3665590lbv.33 for ; Mon, 20 Oct 2014 03:46:00 -0700 (PDT) X-Received: by 10.112.130.41 with SMTP id ob9mr25984392lbb.74.1413801960289; Mon, 20 Oct 2014 03:46:00 -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 c5csp278549lbz; Mon, 20 Oct 2014 03:45:59 -0700 (PDT) X-Received: by 10.66.180.166 with SMTP id dp6mr26666707pac.101.1413801958839; Mon, 20 Oct 2014 03:45:58 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id po9si7583575pdb.3.2014.10.20.03.45.58 for ; Mon, 20 Oct 2014 03:45:58 -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 S1753544AbaJTKpz (ORCPT + 3 others); Mon, 20 Oct 2014 06:45:55 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:54314 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753529AbaJTKpx (ORCPT ); Mon, 20 Oct 2014 06:45:53 -0400 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NDQ00KWROP7R410@mailout1.w1.samsung.com>; Mon, 20 Oct 2014 11:48:43 +0100 (BST) X-AuditID: cbfec7f4-b7f6c6d00000120b-56-5444e7dd4daf Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 6C.54.04619.DD7E4445; Mon, 20 Oct 2014 11:45:49 +0100 (BST) Received: from amdc1339.digital.local ([106.116.147.30]) by eusync4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NDQ009U7OK7MS20@eusync4.samsung.com>; Mon, 20 Oct 2014 11:45:49 +0100 (BST) From: Marek Szyprowski To: linux-usb@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Felipe Balbi , Kyungmin Park , Robert Baldyga , Paul Zimmerman , Krzysztof Kozlowski Subject: [PATCH v2 03/10] usb: dwc2/gadget: fix gadget unregistration in udc_stop() function Date: Mon, 20 Oct 2014 12:45:33 +0200 Message-id: <1413801940-31086-4-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 In-reply-to: <1413801940-31086-1-git-send-email-m.szyprowski@samsung.com> References: <1413801940-31086-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrCJMWRmVeSWpSXmKPExsVy+t/xa7p3n7uEGExYLWlx8H69xesXhhZn m96wW8w4v4/JYtGyVmaLtUfusltsnzKdyeLB4Z3sDhwefVtWMXps2f+Z0eP4je1MHp83yQWw RHHZpKTmZJalFunbJXBlnJk9hbngLVvFuX2LWRsYX7N2MXJySAiYSBx4t5sJwhaTuHBvPVsX IxeHkMBSRolZTZ/YIZw+Jomf1w+zgFSxCRhKdL3tYgOxRQQcJJYsvQNmMwv8ZJSYPNUGxBYW iJN4uKkVrJ5FQFXi/PYNYNt4BTwkphxezgKxTU7i/8sVYJs5BTwl3ryYxghiCwHVbFr+kmUC I+8CRoZVjKKppckFxUnpuYZ6xYm5xaV56XrJ+bmbGCEh9WUH4+JjVocYBTgYlXh4BSxdQoRY E8uKK3MPMUpwMCuJ8HbfBgrxpiRWVqUW5ccXleakFh9iZOLglGpgjFLJiXrj1v5swYmDfKX2 1ssm8f6zfrPPRCErpin9afvsJ8eZHZQMdh8K3VP53uOA+uVw8beL+TdLnd1Y2fHj7HTjtdFr zF22My4M0BK9mMPEtl57kWTbtd7ci27zF/Hrf+e99+Vc0xLvWfrJraIzjpdYlm3sWGe2nq/u 1uSlW6X7uhsLswPWKrEUZyQaajEXFScCAEU9wcoHAgAA 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: m.szyprowski@samsung.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: , udc_stop() should clear ->driver pointer unconditionally to let the UDC framework to work correctly with both registering/unregistering gadgets and enabling/disabling gadgets by writing to /sys/class/udc/*hsotg/soft_connect interface. Signed-off-by: Marek Szyprowski Acked-by: Paul Zimmerman --- drivers/usb/dwc2/gadget.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index 8870e38c1d82..a4b4def23afd 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c @@ -2940,9 +2940,7 @@ static int s3c_hsotg_udc_stop(struct usb_gadget *gadget, spin_lock_irqsave(&hsotg->lock, flags); - if (!driver) - hsotg->driver = NULL; - + hsotg->driver = NULL; hsotg->gadget.speed = USB_SPEED_UNKNOWN; spin_unlock_irqrestore(&hsotg->lock, flags);