Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1362352pxf; Fri, 19 Mar 2021 05:45:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWldWlssGt1F7Mpdlmlfvp53OFqah9Gb9FWiHnhgganABmWfx6Sk1HFVU62VVBQv78x8wS X-Received: by 2002:aa7:dd97:: with SMTP id g23mr9235000edv.154.1616157942097; Fri, 19 Mar 2021 05:45:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616157942; cv=none; d=google.com; s=arc-20160816; b=epmZPjxKmP0kuDk9JO8LMrlK9yKmxvs66Oe/JPyb9D44f8ELLYFc0Sc8Sl7f8+WbQC wzdye5aaUCUgm3EArVIyBUM/42hli4wd7Fek+08mHK/JcfYooIOJlp5SF7slrZZcKPc2 Itlg90WQeskR0925E7kjTuYsq+9nr2VCk6rPztaor1+9QJBpIymWlp3MzXa+9QM6z+pL 3dKXk0vC5ZZ97sg5pcKVPL1hmfvt8qaKMYlwS2mnYWzlOUCXKeiAzKFBmkYLkYFGvca2 I3uOHN+1rAWj2TDgGdWbhwhndOKJ/57JDK7dDYKru9AIUmmJLU4MFZJHrb8fcmSzPkJ/ ZejQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=WnJojV2RIcrSpG/FMHpx7hS8r2BmwynHcxEFLLXKjTQ=; b=Km+Ye7P4yMKrn3ZS2hHNEB2PgoYO4nFn9Csa1l+FOil3lVwgesElkezfkBXRW6Oyw1 tox5sk+ZIkqjr31LNxYNi8MVMYzf5ahAwhoNn/ZVzGYRmz75OJzWdOTkOEesUNlipU3m zMdq/vuqe6uWnuCqONDGSzIT6OHiIe1j1rps7TVbXYPSuP25mmffUHkiaSHyJbJgY1Jd Ze0SsE4zOZOs6/6hLeij6xvZRBzJ6YoOFL0j6jxhaXh4DDFOPLPFjnR0viympoZwodqK NIE0bk0A1znvyNVwjvJfvOO3dfzfPNyPXkMG/8tPKdZAzlnka/nG7hkrSiEoZXQlhF9h UDBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="Z/0OYnUq"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i5si4003906ejh.313.2021.03.19.05.45.19; Fri, 19 Mar 2021 05:45:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="Z/0OYnUq"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230273AbhCSMo2 (ORCPT + 99 others); Fri, 19 Mar 2021 08:44:28 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:37462 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230045AbhCSMoF (ORCPT ); Fri, 19 Mar 2021 08:44:05 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 12JCfv4J048333; Fri, 19 Mar 2021 07:41:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1616157717; bh=WnJojV2RIcrSpG/FMHpx7hS8r2BmwynHcxEFLLXKjTQ=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=Z/0OYnUq8Y14U0inB4NQ9WodFC7Fx1QcyxpxgOhFOvlicQQSuAlNZJKfkHvk28XsH a90xE809D2H+8Bxa8+YsiJBTh3k+DF0cLN7ubTaVBlHI1uHkeKn8yj2IDlYFSVmDFj zDfftVyF7cqnKr/hdRNRUZjgwrnuvxG3VXdGgijM= Received: from DFLE103.ent.ti.com (dfle103.ent.ti.com [10.64.6.24]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 12JCfvXf084873 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 19 Mar 2021 07:41:57 -0500 Received: from DFLE102.ent.ti.com (10.64.6.23) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Fri, 19 Mar 2021 07:41:57 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE102.ent.ti.com (10.64.6.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2 via Frontend Transport; Fri, 19 Mar 2021 07:41:57 -0500 Received: from a0393678-ssd.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 12JCfTf7011913; Fri, 19 Mar 2021 07:41:54 -0500 From: Kishon Vijay Abraham I To: Kishon Vijay Abraham I , Vinod Koul , Rob Herring , Philipp Zabel , Swapnil Jakhade CC: , , , Lokesh Vutla Subject: [PATCH v7 06/13] phy: cadence: Sierra: Move all reset_control_get*() to a separate function Date: Fri, 19 Mar 2021 18:11:21 +0530 Message-ID: <20210319124128.13308-7-kishon@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210319124128.13308-1-kishon@ti.com> References: <20210319124128.13308-1-kishon@ti.com> MIME-Version: 1.0 Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org No functional change. Group devm_reset_control_get() and devm_reset_control_get_optional() to a separate function. Signed-off-by: Kishon Vijay Abraham I Reviewed-by: Philipp Zabel --- drivers/phy/cadence/phy-cadence-sierra.c | 36 ++++++++++++++++-------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/drivers/phy/cadence/phy-cadence-sierra.c b/drivers/phy/cadence/phy-cadence-sierra.c index 7bf1b4c7774a..935f165404e4 100644 --- a/drivers/phy/cadence/phy-cadence-sierra.c +++ b/drivers/phy/cadence/phy-cadence-sierra.c @@ -509,6 +509,28 @@ static int cdns_sierra_phy_get_clocks(struct cdns_sierra_phy *sp, return 0; } +static int cdns_sierra_phy_get_resets(struct cdns_sierra_phy *sp, + struct device *dev) +{ + struct reset_control *rst; + + rst = devm_reset_control_get(dev, "sierra_reset"); + if (IS_ERR(rst)) { + dev_err(dev, "failed to get reset\n"); + return PTR_ERR(rst); + } + sp->phy_rst = rst; + + rst = devm_reset_control_get_optional(dev, "sierra_apb"); + if (IS_ERR(rst)) { + dev_err(dev, "failed to get apb reset\n"); + return PTR_ERR(rst); + } + sp->apb_rst = rst; + + return 0; +} + static int cdns_sierra_phy_probe(struct platform_device *pdev) { struct cdns_sierra_phy *sp; @@ -559,17 +581,9 @@ static int cdns_sierra_phy_probe(struct platform_device *pdev) if (ret) return ret; - sp->phy_rst = devm_reset_control_get(dev, "sierra_reset"); - if (IS_ERR(sp->phy_rst)) { - dev_err(dev, "failed to get reset\n"); - return PTR_ERR(sp->phy_rst); - } - - sp->apb_rst = devm_reset_control_get_optional(dev, "sierra_apb"); - if (IS_ERR(sp->apb_rst)) { - dev_err(dev, "failed to get apb reset\n"); - return PTR_ERR(sp->apb_rst); - } + ret = cdns_sierra_phy_get_resets(sp, dev); + if (ret) + return ret; ret = clk_prepare_enable(sp->clk); if (ret) -- 2.17.1