From patchwork Thu Mar 4 04:41:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 392721 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp348589jai; Thu, 4 Mar 2021 14:16:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJztfDxh+jvLcOvDHrAkMGA21OWatI2dN6mYFTiTwsuDvLfaMjK1bZPGw0yUk/LrpTGDRE5Q X-Received: by 2002:a17:906:40c7:: with SMTP id a7mr6547007ejk.109.1614896183086; Thu, 04 Mar 2021 14:16:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614896183; cv=none; d=google.com; s=arc-20160816; b=UqTw2VGZQBlNrkx3XT8tb9lcFjirfZjjnEVRRjnIr+toN5m6PRVmO59ZkDyNaPqroX 2XYB2N3w27hxq6Fae6ifDBq94JzFvKDzGUxLbqPdfxMQHWwk2an88NR8cxG9L3JsCq/t HJlDqHtKxIJrRd5gdA/vLPyNLIMxQE3iP/iwNNviP8O+lG+mJebyHxVDjhVQPyYkP3Re pZ/CWlRaS9V19uaZ4dEc06e7N0aw8Ohljx2k1zYu6QQ7JCRImX4ADuV+lzbDQQKrOK3L Ygke/B1UEg6hFK5LDdhvhmPbcwSl/Mext9QO6hSj05O225BkCcoowIuSacawDoD3p2PE 1JeA== 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=+nl8LicT//augqm13+dqzPO4Zt/8O9Pq6Zxz1AFAlx0=; b=gAQw2in1ho5ZEpDKNvswiwnNYLwZWbHtx7bOamf6RLkY3ydUWKYk6GijvC4JUvuS0L p68svYmBYoCpiBA9ZwhWCIBLZ2n/IDioYEiXZO1beCa3BuFpGajr2L6IVBuGVZ0Agosc xB3Pt1B0VbAsJqzhxhKVHlh3EWIFAQ4abySrftKIu6aGZ7q/h3WdAH2lJpwTusjnDgRw FTu1bLYcWk0CYkPZss5V6MtY3G9xBTucnGDg3owaXzO87VHLIQwf4R/rNLc7NRfjkyqT CNmIop2cW/0+8+LGN6Rv3RbNkMMWkXZpjzKxLp2pW6GUd/lCkg9CFcD44be9xwtl08hb h6mA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=jG1byoob; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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 k6si527757edj.545.2021.03.04.14.16.22; Thu, 04 Mar 2021 14:16:23 -0800 (PST) Received-SPF: pass (google.com: domain of devicetree-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=jG1byoob; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-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 S233525AbhCDEm7 (ORCPT + 6 others); Wed, 3 Mar 2021 23:42:59 -0500 Received: from fllv0015.ext.ti.com ([198.47.19.141]:36658 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233562AbhCDEmq (ORCPT ); Wed, 3 Mar 2021 23:42:46 -0500 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 1244fqBt101871; Wed, 3 Mar 2021 22:41:52 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1614832912; bh=+nl8LicT//augqm13+dqzPO4Zt/8O9Pq6Zxz1AFAlx0=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=jG1byoob+iIiwwXsI1shApgzPLhNsefhBe2hy/sBO5CEUFke3eMjw/fmMYLlAxRSB HrFYQJZ3BwSq3QWBeWQvvaZm7H7735IDwhKmc+3oSMNCBqkN9bo0e395hcf512L8dB 5k7afYeYp+vkCrV3XudNhS9IYZMSkIs9kID0nFIQ= Received: from DLEE102.ent.ti.com (dlee102.ent.ti.com [157.170.170.32]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 1244fqMS056042 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 3 Mar 2021 22:41:52 -0600 Received: from DLEE105.ent.ti.com (157.170.170.35) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Wed, 3 Mar 2021 22:41:52 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Wed, 3 Mar 2021 22:41:51 -0600 Received: from a0393678-ssd.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 1244fQfn042911; Wed, 3 Mar 2021 22:41:48 -0600 From: Kishon Vijay Abraham I To: Kishon Vijay Abraham I , Vinod Koul , Rob Herring , Philipp Zabel , Swapnil Jakhade CC: , , Lokesh Vutla Subject: [PATCH v4 06/13] phy: cadence: cadence-sierra: Move all reset_control_get*() to a separate function Date: Thu, 4 Mar 2021 10:11:15 +0530 Message-ID: <20210304044122.15166-7-kishon@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210304044122.15166-1-kishon@ti.com> References: <20210304044122.15166-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: devicetree@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 --- drivers/phy/cadence/phy-cadence-sierra.c | 36 ++++++++++++++++-------- 1 file changed, 25 insertions(+), 11 deletions(-) -- 2.17.1 Reviewed-by: Philipp Zabel 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)