Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 522B725FA21 for ; Mon, 7 Apr 2025 18:39:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744051168; cv=none; b=BJ9dIy4ePR+CJNGkOUOIwwTF/SEEovRjh96rv/ZRZBn571Y8w2I0nYMcWGzd6tCPfotWIaGoxRPsYrYq/UPoAeLVThMBPYtNoxA1KsVjo55+WKD2Nfi24GTHCLUWaStl2bmt/abIM5fSctp8x/56Oqz4ezpGFLB6y5MoxtTnpw4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744051168; c=relaxed/simple; bh=Nczvf+c/chruR9kgJUAO77W8NenM+uQI8qIKZwOeHLk=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=jxSsJvE0ly513zpeHpPOMLGfoYbCF4c9HI81mPY6EV3MFr361AsnHvAuO88qYIT1O4HAhNIadEAGf6zMMVZvpyVH3QqgEB/bZOywI7h8D40Q8b+AppMT2ng+1cVWdCX331QmxHEHl0kLRcVDAWZU96OI3srE1CQr5DcDofF453I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=K/Uowfzx; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="K/Uowfzx" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=7+k8l60Jz29isMjvUltmDyPcIdk3zSjT5fRqSkqwuVw=; b=K/UowfzxYQzkpVrgomY9rjzdDV T79PoPiBig959UMX8og4dwts15l/1eYRDGbcp4rIDvuMpRvxmwAsbdgpFn/kL8Z6xhdBkF75pvzH6 H00/A7+UFsdLNgTKd9tFOddhujUtTecGImGg6fjBYmRH6kHAt6XwMSbLvjETsPnckUa1u+zddznYg A2ISIpTHuAw28s+81sxwzBZ7P+mLLZluDhgLBVrUffUeyLLD3sFLOBRWRv2JzDYiSAFS27PGs5fNz nggsl0uoHbAf1aI4c2/TqJdw2ybpJOlSrJp3cCk4Ig+dT8ptr7B2DvZGCnMcFj4vf2/znABsGSRAT VGv37MlQ==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:47490 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u1rNM-0005re-2S; Mon, 07 Apr 2025 19:39:16 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1u1rMq-0013OH-PI; Mon, 07 Apr 2025 19:38:44 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Alexandre Torgue , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Jon Hunter , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Maxime Coquelin , netdev@vger.kernel.org, Paolo Abeni , Prabhakar , Thierry Reding Subject: [PATCH net-next 1/2] net: stmmac: provide stmmac_pltfr_find_clk() Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" Message-Id: Sender: Russell King Date: Mon, 07 Apr 2025 19:38:44 +0100 Provide a generic way to find a clock in the bulk data. Signed-off-by: Russell King (Oracle) --- drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 11 +++++++++++ drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h | 3 +++ 2 files changed, 14 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index c73eff6a56b8..43c869f64c39 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c @@ -709,6 +709,17 @@ devm_stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac) #endif /* CONFIG_OF */ EXPORT_SYMBOL_GPL(devm_stmmac_probe_config_dt); +struct clk *stmmac_pltfr_find_clk(struct plat_stmmacenet_data *plat_dat, + const char *name) +{ + for (int i = 0; i < plat_dat->num_clks; i++) + if (strcmp(plat_dat->clks[i].id, name) == 0) + return plat_dat->clks[i].clk; + + return NULL; +} +EXPORT_SYMBOL_GPL(stmmac_pltfr_find_clk); + int stmmac_get_platform_resources(struct platform_device *pdev, struct stmmac_resources *stmmac_res) { diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h index 72dc1a32e46d..6e6561e29d6e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h @@ -14,6 +14,9 @@ struct plat_stmmacenet_data * devm_stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac); +struct clk *stmmac_pltfr_find_clk(struct plat_stmmacenet_data *plat_dat, + const char *name); + int stmmac_get_platform_resources(struct platform_device *pdev, struct stmmac_resources *stmmac_res); -- 2.30.2