From patchwork Mon Mar 8 05:07:25 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: 395334 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1421916jai; Sun, 7 Mar 2021 21:08:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJxNNy5ZedEjB8RcZ3lniWh27TfvVb0gWgrWj4ea3m8JRo/UT9qld+GCAzX2xA3QsGLfd3si X-Received: by 2002:a05:6402:35c9:: with SMTP id z9mr20360289edc.94.1615180134973; Sun, 07 Mar 2021 21:08:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615180134; cv=none; d=google.com; s=arc-20160816; b=Js7me64kLyO3AMkXiU6OjyisHJDRfAEKKffANdsgDJytQhU/D+1LEoBaYpBJ7eAt4Z KlqcSoul24RJDSLRm3AEEBvg02RiBHH06eeruN+URqA2cPtInol8D/8JaQURuJi4VtaW 87OHYrvkOlITZ6VJ3m3br1KakZ0bXV+XQonJyhi5or2grhYNTdvz69Oa9gxcqUm5vpUD 9ti8SXfH0LsFFAv4U8ZHQUDR0WZK7XCDIoZLH+n0hPs1rk+9pXQV4zv5pxMUeFJ6NHSp 5uFTh2DovTEjkRpDwPK6g3lknQZvcPyEpYGgxsJHpH0SMvCZAemlsvcDupnOAiZqEyMk 99lg== 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=rebgIEvymBNgqlXMPaAWIBbYerg5wiU4vFZ149we2zoivqmNhg+JgPE+sqpVQd5bRW 3Er1TsJiBH5bugmE5MC4GBSTEhWceDHt6tNINWPndYNOydMuCOthLhQxh/14/6cofV9b i7DVhJnx4yrdHjYPobgGZkvMR4odzRw9yaraNq8veu1wDj6e/eg029uncxbA56OB96k+ MAWT32RXVsJlD/ux6zL97x1Ff1ln0iuXZc3vEzm3P8PNuQZYYDK8WX9LSLCi+VJA4TKp iH+5FZk7b+Xn0qq7GL/IINZX6IkcNS3Im0D6yUg9Gr0gnI3yeF+6Kjs/+SHsckT6pbra BptQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=lp3NZukR; 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 w26si6504740ejn.699.2021.03.07.21.08.54; Sun, 07 Mar 2021 21:08:54 -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=lp3NZukR; 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 S234303AbhCHFIS (ORCPT + 6 others); Mon, 8 Mar 2021 00:08:18 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:38034 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234275AbhCHFIJ (ORCPT ); Mon, 8 Mar 2021 00:08:09 -0500 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 128584la023603; Sun, 7 Mar 2021 23:08:04 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1615180084; bh=WnJojV2RIcrSpG/FMHpx7hS8r2BmwynHcxEFLLXKjTQ=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=lp3NZukRwThTCLbk6tP775r66fCez+U6m8bc7mYbW+Is/I2cDCW0wKqoI6QdmKgSR cTScH0KmUKWKmAaS/VEzijH6TOnyu0m8ocE2x+Lzim4qfqvTfq0IhFryktG8DyCcRi XgCtSewj3va1c7o58EgWasrWKwgHBgUnYHhN6694= Received: from DLEE107.ent.ti.com (dlee107.ent.ti.com [157.170.170.37]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 128584E2040107 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Sun, 7 Mar 2021 23:08:04 -0600 Received: from DLEE108.ent.ti.com (157.170.170.38) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Sun, 7 Mar 2021 23:08:03 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE108.ent.ti.com (157.170.170.38) 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; Sun, 7 Mar 2021 23:08:03 -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 12857aL4086547; Sun, 7 Mar 2021 23:08:00 -0600 From: Kishon Vijay Abraham I To: Kishon Vijay Abraham I , Vinod Koul , Rob Herring , Philipp Zabel , Swapnil Jakhade CC: , , Lokesh Vutla Subject: [PATCH v5 06/13] phy: cadence: cadence-sierra: Move all reset_control_get*() to a separate function Date: Mon, 8 Mar 2021 10:37:25 +0530 Message-ID: <20210308050732.7140-7-kishon@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210308050732.7140-1-kishon@ti.com> References: <20210308050732.7140-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)