Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1580338pxb; Mon, 8 Mar 2021 00:44:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJzViazhkdn3EDgvLgSKTv/e8/hDLJ+iL/JgQd+r2KU/EM438GYy0w9xnP2dIPaWxOP99FHP X-Received: by 2002:a17:907:9870:: with SMTP id ko16mr14007314ejc.227.1615193055335; Mon, 08 Mar 2021 00:44:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615193055; cv=none; d=google.com; s=arc-20160816; b=niLgh0QOXRbxoyomSozge8skeMlM+pNNBl6xZQblO5MXh7mtdHzx8/IJlyj5NHkef1 zGPRJYCTirhfUMARb32I31aHzQ81gyvDfv7PMq+jCoiVtn07JQn2tF113y4hm86Wyk0x /82L2ri5epatBBIoOdbYHSYDZrvCVuUH96XgIaWWrBQxAtPIKNSwk+EyWDem85Oi9vjN mNRbDKqGEvetKtLpDAc97enOTZ7LLpjYavyyTH7Td6m6MChzaCwV3ZMplLZ7uwEVOwok 5NbWOUj9d1H2vkLz7obxKwvOZUZA5axRuQigex/1bkZ4sT503XWRwM7ByPD2BfVAv+qR nLhg== 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=szQHJpa0JOKtMP2jb7c98cJ8N5EWeSbpX/hieDljZzhaOQFYsPBPK/tw4mXAzUAkWI lStV012/z9RN5Eiym0MnO8WFggxqUvrPxlRUaQGALqza6vL2esbZLZucAbdLstf91W08 8GPkTJr7Qz1BZ8t2WyPGqGcjcwM4btcrsrpFffPpBIzUe/IcCnZK25mmKC2XXbx9TMMH ATQa4vYExJjnaIhUOwtNhDY2NPKMJ1kDNXsPBAFDSUWf24sFOKQCWldMaxviFXryGfqx KxO2zwDVaEtPoc6YJ8SwkBw2zzMp2EshGl7QRdaqQOgKOGz9zJrXebRiEEcCvvG4QU5T uwhw== 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 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 f7si6643883eja.553.2021.03.08.00.43.52; Mon, 08 Mar 2021 00:44:15 -0800 (PST) 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=lp3NZukR; 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 S234338AbhCHFIW (ORCPT + 99 others); Mon, 8 Mar 2021 00:08:22 -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 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