Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp2620278imn; Tue, 2 Aug 2022 09:36:39 -0700 (PDT) X-Google-Smtp-Source: AA6agR7Po4X1ExvSSZeB4WrPCfZ0TTCxgU5vVWUBrNQM65hszdyCv4pjk4k8qszqCPcRKoKOzl8o X-Received: by 2002:a17:90b:3b48:b0:1f5:330a:3a0f with SMTP id ot8-20020a17090b3b4800b001f5330a3a0fmr298829pjb.93.1659458198621; Tue, 02 Aug 2022 09:36:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659458198; cv=none; d=google.com; s=arc-20160816; b=GDuRGzn1UuIhMj18aLYcRcxEaURPOTBVWyRwkN9aklPyR47PlxK1OG3kw9xlDt7J9a yiIOD6K1uwjhKw+OmRffut8n1ZaA5o/aA71Hmv04/uALr5QmU4gIOyDxHkoODUu59Vkz vRuaXrokBfjHNYMu0lLShVqD+WL+F4ujh76W348Mnd3J0gb25Kz4QlaLe2+vXgY0rkYJ qVTmAV32DGBCnvnE5pLdYHB2Z23Job40jvyrzhYq1gihpBAKscJwQq3nIo7AspUtayEX QhZ3psY0WaWypOabppj9AJvQIDz7uieyBban0XLq8PSDZAVrMK+LK/SEwBg29Pn4hrS/ tPfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Ct3O1AmciEZwkranU1E9vtNcyjno6LJTBStJe4kXxyc=; b=gGVtPkybMx1otVBpD/ycxaawPjKnGdveISquglXu38HB+7sO6Oxg0qmKR5Y6Sikl5a JxvlHkxgi/L5B/5WHoWX7arIQXuaOYzBBWiMjaj2rW15WV2/Jepiv8E8ZWELo+RIexl6 muS8zLayu+Wcm4yQeWsEfsFckIsZhqIXBlriXz7j+sGOpWbAZeSOiPO2NTPhNkLfKyz6 m3x7SPTf4hEi4+XA3dcVkSLs1aBMuKHKlJg8WSDB6G9YgB6nt12pqluuepSIT25jXp0t zbBjDZ384eQDbeDWEskITby5WC2Co4J4Nq0MAasdWhtWnBWJwjpybDj1DaB6qyrQTOzB mjzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qUreBEos; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c3-20020a654203000000b0040dea781c31si8759190pgq.319.2022.08.02.09.36.24; Tue, 02 Aug 2022 09:36:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qUreBEos; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237414AbiHBPOv (ORCPT + 99 others); Tue, 2 Aug 2022 11:14:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236698AbiHBPOU (ORCPT ); Tue, 2 Aug 2022 11:14:20 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7062D167CA; Tue, 2 Aug 2022 08:14:19 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 1D823B81F3A; Tue, 2 Aug 2022 15:14:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3AE7DC43151; Tue, 2 Aug 2022 15:14:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1659453256; bh=HDXSUJAM6KP/jceAZJSA5f6hHQ5LwdeRI3r8X6y5ils=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qUreBEosfSUZFnnsF46nBBB1G1aIvl2/nh2ElYeeYb6ttZVzKyuOY8xvCGlV/ncQB jkFdPCt23Lem9bsE8iNEHD96FPyJPZ6kERpW0ft/l1+F74wr4BZ/nnQzngibu8GZzM vDU9tM4bSm5bad1YFVFZEVoQIHTbISSyI2BG7fdPY/bxSraWQ+Xnlo/fdHDbgbzPMv bDCpnPUR4XoTtQ+wGb3lgCbsCpcX6Lgaaq/tJsakdW3VyOWpIeK+27kq0cfAjAqe7T vHFwsx1kstJh7LskeHAqAOHggaF5liARMTogPtKsuzQKfDBI1pr/i1TqYxfCBNQCm6 twIDMAHz4yrHA== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1oItbM-0000Ti-M9; Tue, 02 Aug 2022 17:14:32 +0200 From: Johan Hovold To: Greg Kroah-Hartman , Felipe Balbi Cc: Rob Herring , Krzysztof Kozlowski , Andy Gross , Bjorn Andersson , Manivannan Sadhasivam , Konrad Dybcio , Krishna Kurapati , Stephen Boyd , Doug Anderson , "Matthias Kaehlcke" , Pavankumar Kondeti , quic_ppratap@quicinc.com, quic_vpulyala@quicinc.com, linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 8/8] usb: dwc3: qcom: clean up suspend callbacks Date: Tue, 2 Aug 2022 17:14:04 +0200 Message-Id: <20220802151404.1797-9-johan+linaro@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220802151404.1797-1-johan+linaro@kernel.org> References: <20220802151404.1797-1-johan+linaro@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Clean up the suspend callbacks by separating the error and success paths to improve readability. Also drop a related redundant initialisation. Signed-off-by: Johan Hovold --- drivers/usb/dwc3/dwc3-qcom.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c index 1bd2818b4daa..01e8c2fc6914 100644 --- a/drivers/usb/dwc3/dwc3-qcom.c +++ b/drivers/usb/dwc3/dwc3-qcom.c @@ -944,14 +944,15 @@ static int __maybe_unused dwc3_qcom_pm_suspend(struct device *dev) { struct dwc3_qcom *qcom = dev_get_drvdata(dev); bool wakeup = device_may_wakeup(dev); - int ret = 0; - + int ret; ret = dwc3_qcom_suspend(qcom, wakeup); - if (!ret) - qcom->pm_suspended = true; + if (ret) + return ret; - return ret; + qcom->pm_suspended = true; + + return 0; } static int __maybe_unused dwc3_qcom_pm_resume(struct device *dev) @@ -961,10 +962,12 @@ static int __maybe_unused dwc3_qcom_pm_resume(struct device *dev) int ret; ret = dwc3_qcom_resume(qcom, wakeup); - if (!ret) - qcom->pm_suspended = false; + if (ret) + return ret; - return ret; + qcom->pm_suspended = false; + + return 0; } static int __maybe_unused dwc3_qcom_runtime_suspend(struct device *dev) -- 2.35.1