Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 15543C433EF for ; Fri, 28 Jan 2022 08:13:00 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1AD8483865; Fri, 28 Jan 2022 09:12:34 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="pbdTwJP0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CD98E8380E; Fri, 28 Jan 2022 09:12:17 +0100 (CET) Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 30A66837EF for ; Fri, 28 Jan 2022 09:12:14 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=a-govindraju@ti.com Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 20S8C9dg121462; Fri, 28 Jan 2022 02:12:09 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1643357529; bh=oXqCtTZ0P7F5EaQ+6mCvW3aln2JeIimc7mVYmJll5Jg=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=pbdTwJP0slX7OX+B/pEPobvr5AHGj38pJTB7rn5W82ahwJOqIxHYSGw1IcaA/BDhY ClJVtDJUc5ous4sNBhkVuBDJCLRKNvOIWq0kd1adxTv/WNRNrOLF2A5bg/AuJtoyrV 5gmupJWmYX7THnLlMTXn7ZCndkIXOPPpdEdVhwX4= Received: from DLEE108.ent.ti.com (dlee108.ent.ti.com [157.170.170.38]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 20S8C9ei014411 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 28 Jan 2022 02:12:09 -0600 Received: from DLEE111.ent.ti.com (157.170.170.22) 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.2308.14; Fri, 28 Jan 2022 02:12:08 -0600 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE111.ent.ti.com (157.170.170.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14 via Frontend Transport; Fri, 28 Jan 2022 02:12:08 -0600 Received: from gsaswath-HP-ProBook-640-G5.dal.design.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 20S8BqpB098664; Fri, 28 Jan 2022 02:12:06 -0600 From: Aswath Govindraju To: CC: , Sanket Parmar , Alan Douglas , Swapnil Jakhade , Kishon Vijay Abraham I , Tero Kristo , Vignesh Raghavendra , Aswath Govindraju Subject: [PATCH v2 05/25] phy: cadence: Sierra: Move all reset_control_get*() to a separate function Date: Fri, 28 Jan 2022 13:41:32 +0530 Message-ID: <20220128081152.14901-6-a-govindraju@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220128081152.14901-1-a-govindraju@ti.com> References: <20220128081152.14901-1-a-govindraju@ti.com> MIME-Version: 1.0 Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean From: Kishon Vijay Abraham I 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 Signed-off-by: Aswath Govindraju --- drivers/phy/cadence/phy-cadence-sierra.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/phy/cadence/phy-cadence-sierra.c b/drivers/phy/cadence/phy-cadence-sierra.c index d07cf1d97df2..eaa32939c1c2 100644 --- a/drivers/phy/cadence/phy-cadence-sierra.c +++ b/drivers/phy/cadence/phy-cadence-sierra.c @@ -480,6 +480,21 @@ 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 udevice *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; + + return 0; +} + static int cdns_sierra_phy_probe(struct udevice *dev) { struct cdns_sierra_phy *sp = dev_get_priv(dev); @@ -520,6 +535,10 @@ static int cdns_sierra_phy_probe(struct udevice *dev) return PTR_ERR(sp->phy_rst); } + ret = cdns_sierra_phy_get_resets(sp, dev); + if (ret) + return ret; + ret = clk_prepare_enable(sp->clk); if (ret) return ret; -- 2.17.1