From patchwork Wed Sep 16 23:11:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 11781105 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 70BFE112E for ; Wed, 16 Sep 2020 23:12:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5050622209 for ; Wed, 16 Sep 2020 23:12:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="XLNZNOBP" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726670AbgIPXMM (ORCPT ); Wed, 16 Sep 2020 19:12:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726545AbgIPXMJ (ORCPT ); Wed, 16 Sep 2020 19:12:09 -0400 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7818C061788 for ; Wed, 16 Sep 2020 16:12:08 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id d9so4050pfd.3 for ; Wed, 16 Sep 2020 16:12:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Vwuz9czqgbQRvCC3ZX7F2/qyG2jwlM/7PwjxT5zSKTM=; b=XLNZNOBPWFIuxhDT+ijS91l4/FnXKk70u1qNb3bt5/MQdcAiuyEUFZ+06poMzwWhnz 810Yk7Rlvf79KO953X9SG2PGaFXdwL8Gi0t5oIRRFViH2OTeWRQdG4KJcfoUr/XWrdlN 0elocy25qeXg6ux/F8pDd4WkMztmb+HU9azBM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Vwuz9czqgbQRvCC3ZX7F2/qyG2jwlM/7PwjxT5zSKTM=; b=RvpEBQVmjzBoU9T4DYgG9+2Vhpn4903TE/kYuvgPSP6Sthck+SEsiNsnZMuGPVgZdC B15+TCrBYZ4z1GZ5eFvUbZWeGkPswPA2gdCTRwtVG34dQc5HB/udlxamgc1NkmfMluam f7BomnEGSNUIriu+oC3VeJvP8Q36DIgjdRFvLE2zEa7NuXQFAnPgB6RrBLkQ7QYM3+sD 35Z8zu9eY0lRIfVjJe6Sy63lsTmtvUzVRi9bF2X1ghTddG35R8gY2Zi87Qa7nqiaNrJ/ YA+XuQSpJjjWFcRQDL/iQSxfgVUo+7Oo34j1t6gAsG/Q55m4YXrUeC+89JV86w7Oz1tN 5jfA== X-Gm-Message-State: AOAM531MZz/m3Fcvs+GaErqvpiuQKOWxNgtHtr5WrwSjZntTR7eHaOVn 4kTTYzChqrnYE5tVeYvHqL1Pqg== X-Google-Smtp-Source: ABdhPJwzRBIxYPbhp3I6OQb9e8/ewsoJ6j1JGFE8D1utziVy3z1Guu0NagTtEELLeQJt/X6C06OcmQ== X-Received: by 2002:a62:3387:0:b029:13f:ed60:b208 with SMTP id z129-20020a6233870000b029013fed60b208mr15164869pfz.24.1600297928510; Wed, 16 Sep 2020 16:12:08 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:1:3e52:82ff:fe6c:83ab]) by smtp.gmail.com with ESMTPSA id u6sm3643254pjy.37.2020.09.16.16.12.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2020 16:12:08 -0700 (PDT) From: Stephen Boyd To: Kishon Vijay Abraham I , Vinod Koul Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Jeykumar Sankaran , Chandan Uddaraju , Vara Reddy , Tanmay Shah , Bjorn Andersson , Manu Gautam , Sandeep Maheswaram , Douglas Anderson , Sean Paul , Jonathan Marek , Dmitry Baryshkov , Rob Clark Subject: [PATCH v4 03/10] phy: qcom-qmp: Remove 'initialized' in favor of 'init_count' Date: Wed, 16 Sep 2020 16:11:55 -0700 Message-Id: <20200916231202.3637932-4-swboyd@chromium.org> X-Mailer: git-send-email 2.28.0.618.gf4bc123cb7-goog In-Reply-To: <20200916231202.3637932-1-swboyd@chromium.org> References: <20200916231202.3637932-1-swboyd@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org We already track if any phy inside the qmp wrapper has been initialized by means of the struct qcom_qmp::init_count member. Let's drop the duplicate 'initialized' member to simplify the code a bit. Cc: Jeykumar Sankaran Cc: Chandan Uddaraju Cc: Vara Reddy Cc: Tanmay Shah Reviewed-by: Bjorn Andersson Cc: Manu Gautam Cc: Sandeep Maheswaram Cc: Douglas Anderson Cc: Sean Paul Cc: Jonathan Marek Cc: Dmitry Baryshkov Cc: Rob Clark Signed-off-by: Stephen Boyd --- drivers/phy/qualcomm/phy-qcom-qmp.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp.c b/drivers/phy/qualcomm/phy-qcom-qmp.c index 7ee9e966dc6d..4a23ba9361b3 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp.c @@ -1844,7 +1844,6 @@ struct qmp_phy { * @phys: array of per-lane phy descriptors * @phy_mutex: mutex lock for PHY common block initialization * @init_count: phy common block initialization count - * @phy_initialized: indicate if PHY has been initialized * @ufs_reset: optional UFS PHY reset handle */ struct qcom_qmp { @@ -1861,7 +1860,6 @@ struct qcom_qmp { struct mutex phy_mutex; int init_count; - bool phy_initialized; struct reset_control *ufs_reset; }; @@ -2748,7 +2746,6 @@ static int qcom_qmp_phy_enable(struct phy *phy) dev_err(qmp->dev, "phy initialization timed-out\n"); goto err_pcs_ready; } - qmp->phy_initialized = true; return 0; err_pcs_ready: @@ -2792,8 +2789,6 @@ static int qcom_qmp_phy_disable(struct phy *phy) qcom_qmp_phy_com_exit(qmp); - qmp->phy_initialized = false; - return 0; } @@ -2868,7 +2863,7 @@ static int __maybe_unused qcom_qmp_phy_runtime_suspend(struct device *dev) if (cfg->type != PHY_TYPE_USB3) return 0; - if (!qmp->phy_initialized) { + if (!qmp->init_count) { dev_vdbg(dev, "PHY not initialized, bailing out\n"); return 0; } @@ -2894,7 +2889,7 @@ static int __maybe_unused qcom_qmp_phy_runtime_resume(struct device *dev) if (cfg->type != PHY_TYPE_USB3) return 0; - if (!qmp->phy_initialized) { + if (!qmp->init_count) { dev_vdbg(dev, "PHY not initialized, bailing out\n"); return 0; }