From patchwork Wed Mar 10 15:45:51 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: 396734 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp483349jai; Wed, 10 Mar 2021 07:47:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJxNV65DTskz6xlEYjbr6OBWdJVDwmZTSfC8P3uVq0xMJsfXL8TFQ2fZW8abh9lxariiNf4H X-Received: by 2002:aa7:da46:: with SMTP id w6mr4096173eds.40.1615391238575; Wed, 10 Mar 2021 07:47:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615391238; cv=none; d=google.com; s=arc-20160816; b=JzQIqqtuUBhGVWq2gu0hI6tcEXKUULDQGkhioJF7O0YT0VGyqD3sCOzGJb+wc0dmpP EYHT5rztW3rzbYGUpwARgGJQPR+T0oSjG2ASDu0fCY0G9vw8gYgt94tm41F9Wm27N2mw 1mMfHhsn07+K1sjzWjp+O3Fa8MQKhm7u5vmj2bhGW5Tq37kYdNA1hy+RJRGpyjaU2VKe neBEdKZIh2C0EoFGNCs+2kDS1rAYecicWmC3b7aq9s0Ejsvv5BdeiiCLt9R4O4GUkVAc 0GjQ2Qm2mdnG0canHHNVoXq3XjDlBF/SuG9SS80Bpo10t/7svDgDn2UKxwwoOfUM/T+d VEVQ== 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=XhFbs2z0Q4x4uvjx4L8ZSn3APMXW4uuhrlr0jlAaX0WAm1oJ4VVvjEWVXr+0gi5ol5 UTg6XMSlaz3UR50MXxHrE0qvdZfd6GkAQ5yYarHM85aFSNj2fyBZvTAzmr0xxs98r6U9 qiNQIPNrwoVlputqtCBo/CQRX1o45kYP9M2nvi2GpctXJb6BHDKqde1AITy7rZHVUKah MscsdKTsKiEZUWOD+9/tudZaUrc2TzWQ/CR2mM43WHed/nXxaT0DPGeAhhUlFrwBUZ1Q zcGC5IkdwjWTawZLPDbyrSEhuE1hL6Lg4RiFla5hzkH7y7eO5GAmkP2rk10xPvBmnSTK +lOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=hKiTgNWR; 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 t3si4576077ejy.142.2021.03.10.07.47.18; Wed, 10 Mar 2021 07:47:18 -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=hKiTgNWR; 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 S232978AbhCJPqn (ORCPT + 6 others); Wed, 10 Mar 2021 10:46:43 -0500 Received: from fllv0015.ext.ti.com ([198.47.19.141]:43814 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233221AbhCJPq3 (ORCPT ); Wed, 10 Mar 2021 10:46:29 -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 12AFkOK2117304; Wed, 10 Mar 2021 09:46:24 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1615391184; bh=WnJojV2RIcrSpG/FMHpx7hS8r2BmwynHcxEFLLXKjTQ=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=hKiTgNWRK+ru+XYC/YLgmqnSTz/rsTfjYG2o+LzPf3MltTVPM7pkH9xr6bhbnUTv6 Ydom9lQgCvK7m/UKQx5yVbbEUuY3o6IKPa2icvKj14ZysLk7AVq1S+yO+YAoPY4Gr/ aIsrFRNFa6aKOeGc/JdxngrnNh3I0b1gguFTvqU8= Received: from DFLE105.ent.ti.com (dfle105.ent.ti.com [10.64.6.26]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 12AFkO0Q088257 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 10 Mar 2021 09:46:24 -0600 Received: from DFLE106.ent.ti.com (10.64.6.27) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Wed, 10 Mar 2021 09:46:24 -0600 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE106.ent.ti.com (10.64.6.27) 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; Wed, 10 Mar 2021 09:46:24 -0600 Received: from a0393678-ssd.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 12AFk2KU066370; Wed, 10 Mar 2021 09:46:21 -0600 From: Kishon Vijay Abraham I To: Kishon Vijay Abraham I , Vinod Koul , Rob Herring , Philipp Zabel , Swapnil Jakhade CC: , , Lokesh Vutla Subject: [PATCH v6 06/13] phy: cadence: cadence-sierra: Move all reset_control_get*() to a separate function Date: Wed, 10 Mar 2021 21:15:51 +0530 Message-ID: <20210310154558.32078-7-kishon@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210310154558.32078-1-kishon@ti.com> References: <20210310154558.32078-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 Reviewed-by: Philipp Zabel --- drivers/phy/cadence/phy-cadence-sierra.c | 36 ++++++++++++++++-------- 1 file changed, 25 insertions(+), 11 deletions(-) -- 2.17.1 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)