Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4024712pxb; Mon, 8 Feb 2021 06:17:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJyRkgbKLSDlOmzseVr4PUjvhAzS8D/fl3/jOJuB/Z+A2pmfuG5QuZpBmL0hevkK9glVB5sQ X-Received: by 2002:a50:9f4e:: with SMTP id b72mr17740851edf.4.1612793826999; Mon, 08 Feb 2021 06:17:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612793826; cv=none; d=google.com; s=arc-20160816; b=KTXaIgusC/YBCxTqxo5WDffkz5D7zG6dNo54xUoh8roG0ZrliS8y67yG1pge2Tndu+ Xu1qZlSZPaPvJNRGeAzKqdJFApVqt04ZyWGJ8zep5zgX2yVn36PflHbMheMGYSvzTmtb 46ORBt9dfWxQ63fR8yYZSVyIIdbrzpPz1XffUCYM/AauDUxfo1buId+v1uoQB+Kpz24N zKmxFy4RYiEnSXRa5W+pCs1+wOZv6GwtFCVkn9ApJZ7xzsw4xKXELPEEZ8chuB+e7p9l QqS78eQS11lHB6IeHvIa0TfA6Fngdm1ZWu76OPuwwa/usOdkrsGGjpv0cGAYBQ9dVCXj 7MCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=wxjToKS6a+mmbg2yUjmJL592ZOgSgXPtftqtcio8o1s=; b=HuY//+AOmzHrjl4JxEj0usHHmCPjcuBczVYEDfbD8uFf/wtgk+ywmPDHxAnfMO+ABQ 4u3hfXWhKqbbxUi3VWkgzUQBtYjTyX+ndNSPRPyDEipXcSCz9g0Ic3WgJlwsnPue/t83 bhq+Sn/1P1L76MbMyG9rC2cKZDkGATpL++XorrgsGKTBfw062f46tlVz+ivCz13mTulr 54z0Wnx5yQrnf2nYOslPmKvClaOSWda+dfmHurRzN6iMu6M6uFl0cqJNG5xsIY2XpTBg hdjoWQYLGW2nnevi811rYDU/hzaanNoFI8GveRImIGKgQa2rdfl8ULl1Wew65qJeDLuF XeiQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z1si10966575ejm.462.2021.02.08.06.16.41; Mon, 08 Feb 2021 06:17: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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232802AbhBHONN (ORCPT + 99 others); Mon, 8 Feb 2021 09:13:13 -0500 Received: from mail.baikalelectronics.com ([87.245.175.226]:57076 "EHLO mail.baikalelectronics.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232069AbhBHN6N (ORCPT ); Mon, 8 Feb 2021 08:58:13 -0500 From: Serge Semin To: Rob Herring , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Jakub Kicinski , Johan Hovold , Maxime Ripard , Joao Pinto , Lars Persson , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Maxime Coquelin CC: Serge Semin , Serge Semin , Alexey Malahov , Pavel Parkhomenko , Vyacheslav Mitrofanov , , , , , Subject: [PATCH v2 21/24] net: stmmac: dwmac-imx: Discard Tx clock request Date: Mon, 8 Feb 2021 16:56:05 +0300 Message-ID: <20210208135609.7685-22-Sergey.Semin@baikalelectronics.ru> In-Reply-To: <20210208135609.7685-1-Sergey.Semin@baikalelectronics.ru> References: <20210208135609.7685-1-Sergey.Semin@baikalelectronics.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-ClientProxiedBy: MAIL.baikal.int (192.168.51.25) To mail (192.168.51.25) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since the Tx clock is now requested and enabled/disabled in the STMMAC DT-based platform config method, there is no need in duplicating the same procedures in the DW MAC iMX sub-driver. Signed-off-by: Serge Semin --- .../net/ethernet/stmicro/stmmac/dwmac-imx.c | 21 +++++-------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c index 223f69da7e95..8b2c7f1ba745 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c @@ -40,7 +40,6 @@ struct imx_dwmac_ops { struct imx_priv_data { struct device *dev; - struct clk *clk_tx; struct clk *clk_mem; struct regmap *intf_regmap; u32 intf_reg_off; @@ -104,12 +103,6 @@ static int imx_dwmac_init(struct platform_device *pdev, void *priv) return ret; } - ret = clk_prepare_enable(dwmac->clk_tx); - if (ret) { - dev_err(&pdev->dev, "tx clock enable failed\n"); - goto clk_tx_en_failed; - } - if (dwmac->ops->set_intf_mode) { ret = dwmac->ops->set_intf_mode(plat_dat); if (ret) @@ -119,8 +112,6 @@ static int imx_dwmac_init(struct platform_device *pdev, void *priv) return 0; intf_mode_failed: - clk_disable_unprepare(dwmac->clk_tx); -clk_tx_en_failed: clk_disable_unprepare(dwmac->clk_mem); return ret; } @@ -129,7 +120,6 @@ static void imx_dwmac_exit(struct platform_device *pdev, void *priv) { struct imx_priv_data *dwmac = priv; - clk_disable_unprepare(dwmac->clk_tx); clk_disable_unprepare(dwmac->clk_mem); } @@ -162,7 +152,7 @@ static void imx_dwmac_fix_speed(void *priv, unsigned int speed) return; } - err = clk_set_rate(dwmac->clk_tx, rate); + err = clk_set_rate(plat_dat->tx_clk, rate); if (err < 0) dev_err(dwmac->dev, "failed to set tx rate %lu\n", rate); } @@ -176,10 +166,9 @@ imx_dwmac_parse_dt(struct imx_priv_data *dwmac, struct device *dev) if (of_get_property(np, "snps,rmii_refclk_ext", NULL)) dwmac->rmii_refclk_ext = true; - dwmac->clk_tx = devm_clk_get(dev, "tx"); - if (IS_ERR(dwmac->clk_tx)) { - dev_err(dev, "failed to get tx clock\n"); - return PTR_ERR(dwmac->clk_tx); + if (!dwmac->plat_dat->tx_clk) { + dev_err(dev, "no tx clock found\n"); + return -EINVAL; } dwmac->clk_mem = NULL; @@ -239,6 +228,7 @@ static int imx_dwmac_probe(struct platform_device *pdev) dwmac->ops = data; dwmac->dev = &pdev->dev; + dwmac->plat_dat = plat_dat; ret = imx_dwmac_parse_dt(dwmac, &pdev->dev); if (ret) { @@ -251,7 +241,6 @@ static int imx_dwmac_probe(struct platform_device *pdev) plat_dat->exit = imx_dwmac_exit; plat_dat->fix_mac_speed = imx_dwmac_fix_speed; plat_dat->bsp_priv = dwmac; - dwmac->plat_dat = plat_dat; ret = imx_dwmac_init(pdev, dwmac); if (ret) -- 2.29.2