From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E2906C433EF for ; Mon, 9 May 2022 07:51:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7PGgWOO92Pf/RCN/mZof8T9J6+eD5ss95EJMY1GZgvo=; b=4VOyrjUKuSzuVf wsM2b2/2Y3Nvf40jalpdMQO5GN+CfJYi/1VIePd+gicNItDaA5vh0ocvoe4AN5LAN3aclyOCP+XKf zmovIxpqQnrApWpCCKN1zG5vLtKRraeocw9wrv9bPHmCr4oOim8Xo5amnf6mPokcgEIw4Xj/waIzO L5XQFbnVxijviSUSWy7rnqlZM4x89flDrosGpkKHXHpBtsO4Jd4NfadsZDhKCmdh9BTJ1p6YxWMzz ctqKMsKArmLnhhtKzGUvhp7nMGk+LagF+lJzQIwlyKe/RECeevdEetsllzDTpf3UkCG/59QhnqQWs RlRVnDwye0FGwjXE9boA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nny9f-00Cxhw-Bh; Mon, 09 May 2022 07:50:07 +0000 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nny8k-00CxTR-G2 for linux-arm-kernel@lists.infradead.org; Mon, 09 May 2022 07:49:14 +0000 Received: by mail-wm1-x333.google.com with SMTP id q20so7869075wmq.1 for ; Mon, 09 May 2022 00:49:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VgEKyO0L0uA3SGFAWkGQhNMbC7clsq3EFnRg59TyA70=; b=bBiGh/AhGl38/MpaSnWoH0kWx8noJq58musIpZ/g2oeqIKpuW2Su1Y4ZgNGVc2+Dz6 eXZiC83MRh77Kw3wvrYE2FR9xnbKOu9zRJEiqGkQIGyxLFuKlF9LDz5gXlubAdjw1rDy WwH53vZ1MkSY48ocvhfyQEHnOx3fjcof2u4WLTKJmBcsRR3KDpvkUKuhW7s9VWTNwXfv RveFcmrPMlo9oDIBI6fj7bhQ8q8DTI/LJBkvk9rJAWZ6ecAiiJWhEHZfOE9jTwbD8Mde Lah4Ki9hI1OHi/rRtcH5nwvxEwepu0M84Wkgdz7Ei73qHvAm68iq93wkbgAhbBr5uQ4V 9BVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VgEKyO0L0uA3SGFAWkGQhNMbC7clsq3EFnRg59TyA70=; b=iAVvH6VozlWFGk2NcnMcOB3xbsgBP1C1SwF6Dj+t1J6yRXAtecQRIVPObh2OUyj+DN i2Zx11Kh5QzBl41Yj46jHEtFIc1JJ61oibyM5FVqW7oxEEtrGCuOMoHJ/wJlk0VQuuMN M5L8JiWhyikumvumLDC8bgOm0Dz/nINpFVfjfFBbhMCYLUl8ZNM28JXIfzFxdWpUGZsJ vNEvxLelsIgeh7YvSl+NnfbN49kgEzaXQOYeXSCcnSBXxDUlnfyjIT/TSkPBgcqht8u6 2oxzclx3h33X8riFAs1k2H81uFY1SnEZdMMOMDq9Xz4TmooDgFvrfYSUBylEkS+bnvWu +B/A== X-Gm-Message-State: AOAM530WqxsHCi/VNpk0gDTEbGlcFbo/OsYMmNgpcviTuC2eI0OSBXhU UfHeE2bcOFx1bR5eF2lFveE4nw== X-Google-Smtp-Source: ABdhPJwiYLJm2AFKSikbo89a1SKZiOmfCAFxQ5X7TJwAoWGnUQJ66VAG9OF9Sr3O4w9WN8Znulrgyg== X-Received: by 2002:a7b:c202:0:b0:394:1e7d:af44 with SMTP id x2-20020a7bc202000000b003941e7daf44mr14700879wmi.139.1652082547691; Mon, 09 May 2022 00:49:07 -0700 (PDT) Received: from localhost.localdomain (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.googlemail.com with ESMTPSA id bw22-20020a0560001f9600b0020c5253d8d8sm11784768wrb.36.2022.05.09.00.49.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 00:49:07 -0700 (PDT) From: Corentin Labbe To: alexandre.torgue@foss.st.com, andrew@lunn.ch, broonie@kernel.org, calvin.johnson@oss.nxp.com, davem@davemloft.net, edumazet@google.com, hkallweit1@gmail.com, jernej.skrabec@gmail.com, joabreu@synopsys.com, krzysztof.kozlowski+dt@linaro.org, kuba@kernel.org, lgirdwood@gmail.com, linux@armlinux.org.uk, pabeni@redhat.com, peppe.cavallaro@st.com, robh+dt@kernel.org, samuel@sholland.org, wens@csie.org Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev, Corentin Labbe Subject: [PATCH 2/6] net: stmmac: dwmac-sun8i: remove regulator Date: Mon, 9 May 2022 07:48:53 +0000 Message-Id: <20220509074857.195302-3-clabbe@baylibre.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220509074857.195302-1-clabbe@baylibre.com> References: <20220509074857.195302-1-clabbe@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220509_004910_605470_C4C42250 X-CRM114-Status: GOOD ( 19.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Now regulator is handled by phy core, there is no need to handle it in stmmac driver. Signed-off-by: Corentin Labbe --- .../net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 37 +------------------ 1 file changed, 2 insertions(+), 35 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c index f834472599f7..17888813c707 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c @@ -17,7 +17,6 @@ #include #include #include -#include #include #include @@ -59,7 +58,6 @@ struct emac_variant { /* struct sunxi_priv_data - hold all sunxi private data * @ephy_clk: reference to the optional EPHY clock for the internal PHY - * @regulator: reference to the optional regulator * @rst_ephy: reference to the optional EPHY reset for the internal PHY * @variant: reference to the current board variant * @regmap: regmap for using the syscon @@ -69,7 +67,6 @@ struct emac_variant { */ struct sunxi_priv_data { struct clk *ephy_clk; - struct regulator *regulator; struct reset_control *rst_ephy; const struct emac_variant *variant; struct regmap_field *regmap_field; @@ -568,29 +565,11 @@ static int sun8i_dwmac_init(struct platform_device *pdev, void *priv) { struct net_device *ndev = platform_get_drvdata(pdev); struct sunxi_priv_data *gmac = priv; - int ret; - if (gmac->regulator) { - ret = regulator_enable(gmac->regulator); - if (ret) { - dev_err(&pdev->dev, "Fail to enable regulator\n"); - return ret; - } - } - - if (gmac->use_internal_phy) { - ret = sun8i_dwmac_power_internal_phy(netdev_priv(ndev)); - if (ret) - goto err_disable_regulator; - } + if (gmac->use_internal_phy) + return sun8i_dwmac_power_internal_phy(netdev_priv(ndev)); return 0; - -err_disable_regulator: - if (gmac->regulator) - regulator_disable(gmac->regulator); - - return ret; } static void sun8i_dwmac_core_init(struct mac_device_info *hw, @@ -1034,9 +1013,6 @@ static void sun8i_dwmac_exit(struct platform_device *pdev, void *priv) if (gmac->variant->soc_has_internal_phy) sun8i_dwmac_unpower_internal_phy(gmac); - - if (gmac->regulator) - regulator_disable(gmac->regulator); } static void sun8i_dwmac_set_mac_loopback(void __iomem *ioaddr, bool enable) @@ -1157,15 +1133,6 @@ static int sun8i_dwmac_probe(struct platform_device *pdev) return -EINVAL; } - /* Optional regulator for PHY */ - gmac->regulator = devm_regulator_get_optional(dev, "phy"); - if (IS_ERR(gmac->regulator)) { - if (PTR_ERR(gmac->regulator) == -EPROBE_DEFER) - return -EPROBE_DEFER; - dev_info(dev, "No regulator found\n"); - gmac->regulator = NULL; - } - /* The "GMAC clock control" register might be located in the * CCU address range (on the R40), or the system control address * range (on most other sun8i and later SoCs). -- 2.35.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel