Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp6470917pxu; Thu, 24 Dec 2020 03:19:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJzN7/mmPXIXzQ97THTKdN98dvvaK46jxSSEAjI/X9no1oA2GDDv9nbeDbiNjVcHIGQ30QGC X-Received: by 2002:a50:8387:: with SMTP id 7mr27254384edi.131.1608808746238; Thu, 24 Dec 2020 03:19:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608808746; cv=none; d=google.com; s=arc-20160816; b=ejsKzAal0cmpYTkjzrMAXzAJ7urH3CBBRMhcHhilwuPTUVxu20YgtPxrdB1f9vYmaP rW5UDa2P4E4BL4kf+5ch7peIp3lLvLTBhGGxU55llj8+wsLpr0b3RAAL2WvGWyx0c5V4 7TQB5nsrUocmq2SJyJhxJqvtMLFKslJgLrUhCM2WqyXz65Yzd5JoAlh5aKhpJH8fLiQs Pu+uOtlOhFXZFg1N+TQgmIDreS9zsAygv9tIBcjnvmyupIQO4kVrjIa3C/sARESa7IFX q+AO+T440txavMwwXHs2lzJdInNXnng4Zkv0zxIuDOkhgHlD0Jv6971L7e4zs2T/j30p ehzQ== 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=axVr3XWMk19ESn5W1bVQsDupXGBYMhIf9JSNFf61yAdK5ZTQb38WN8tzwKtZ6aztwa 5F8iaqObViMNz/hQrWPKI8zAHbrNU0/GqkZyn7rkL5/+DXgaPh/bRoGzvD7R+6Q19q0W Fb5KTKyFKlE44yZX530S6oSz29HCS3E88AI8bo8UwjcsCBK+5XEYs84tPz9b/SqGaxUb Uhl9h+wxyjCXfd6Wdn36u1I7eJxEc69HLbjFXOkUOZ7XNDoaQonJ9gv9nPP5ZoETlnVY Td4OWiuZRJWD3Sowv2MedcQ4M4fHs9DLshUGoQwG63OOGGt/Y1AvNzp+JwVtJDXO0qhg 4vaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=NXBK9g1t; 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 lx7si6552615ejb.280.2020.12.24.03.18.44; Thu, 24 Dec 2020 03:19:06 -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=NXBK9g1t; 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 S1728264AbgLXLSI (ORCPT + 99 others); Thu, 24 Dec 2020 06:18:08 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:37798 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726591AbgLXLSG (ORCPT ); Thu, 24 Dec 2020 06:18:06 -0500 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 0BOBHEiW041847; Thu, 24 Dec 2020 05:17:14 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1608808634; bh=+nl8LicT//augqm13+dqzPO4Zt/8O9Pq6Zxz1AFAlx0=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=NXBK9g1tSf8RnimtCvNmAHb4EhIAjmRwr++iCbThVu3FL1WVqbySNHyVXBGZpU4TM Zyx+8PLHPB5YbH1Rl3frr5gbdlG4y261lOYj75k8DgNeO7L2YF467SgfzYekcZ+juu xPpj2tk6uCXn2CA9DUdmYmUFT5MY0cTwAMRx7/aI= Received: from DFLE102.ent.ti.com (dfle102.ent.ti.com [10.64.6.23]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 0BOBHEZ3058458 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 24 Dec 2020 05:17:14 -0600 Received: from DFLE102.ent.ti.com (10.64.6.23) 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.1979.3; Thu, 24 Dec 2020 05:17:14 -0600 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.1979.3 via Frontend Transport; Thu, 24 Dec 2020 05:17:14 -0600 Received: from a0393678-ssd.dal.design.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 0BOBGWGD116630; Thu, 24 Dec 2020 05:17:09 -0600 From: Kishon Vijay Abraham I To: Kishon Vijay Abraham I , Vinod Koul , Rob Herring , Nishanth Menon , Philipp Zabel CC: , , Subject: [PATCH v3 07/15] phy: cadence: cadence-sierra: Move all reset_control_get*() to a separate function Date: Thu, 24 Dec 2020 16:46:19 +0530 Message-ID: <20201224111627.32590-8-kishon@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201224111627.32590-1-kishon@ti.com> References: <20201224111627.32590-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 --- 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