Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4866058iob; Mon, 9 May 2022 03:33:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmcVvrVokgNiHVa4bSoDfwnksKMbczqipY0uGAd/Ci6tYv2cnj6oTuYj3suiFBV/AuHK3e X-Received: by 2002:a17:902:9043:b0:14f:aa08:8497 with SMTP id w3-20020a170902904300b0014faa088497mr15681744plz.109.1652092428617; Mon, 09 May 2022 03:33:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652092428; cv=none; d=google.com; s=arc-20160816; b=wnmWTHxF6ooqBLN1SyvTffC5THJ/dhkYKIny3j1Fp7oF5ZQ4XSfy8WrIHQLFaqBKS7 8R8wWafIzZ9KVf7wfk9VFmTUagXDipf5AgqYWysiK5+nZ+83k96HZ1X0EAmy8f1yAQet 84r1qk3n85iMoi2g5V5db2tG2mIw/89AiaCW4YCmwvcg2gklWH7M50oj97lja5s8qVqf n3TzCBgdklxNTIU8cTbNCDvkgwj8mCC5ZnzdFseIMEPTyO5Jii/2x7j5ZuijzPPoRWMn chbAQp6lG19LaSWtYDvU8cJmAXAcbT4AKQjPppeanaPfs6faZi2xDc0mIaHdr5/TeJYs VDFQ== 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 :dkim-signature; bh=VgEKyO0L0uA3SGFAWkGQhNMbC7clsq3EFnRg59TyA70=; b=yhQDxZ/hFO/ZIfdJb60po4sDDJr3QSAvU2gz0lD4sS7u5e1bFc4vyCr8qrej9Kd8Bz bdOW5OK8EVeowg8gx6KyZWCWWpKpz3oGWmjfKREM74wfOPBts9SrJMiln6v1Fkbnx93R N2JFVZBhgacrpoq5pLwo3aJlOJPRpDPfGnkramW+2K2Mm1sYF5ZN96FwxKVbpUeBjaA9 GzKa2mxZM+yruS8CtXj0mrluOItNZAIlHNfFzBHBo7I1UjRqOmbCcJKTBWAOHEGvlsjf SzMnaVNs/bnYjs+2rF8tnJ1gJNULFQUESoAbq2n5nssGqVKqmJy7BwQEAMfES2LQuqOG 8R1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b="bBiGh/Ah"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id o21-20020a637315000000b003c60f6c2f55si13166290pgc.675.2022.05.09.03.33.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 03:33:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b="bBiGh/Ah"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 51C4425D10F; Mon, 9 May 2022 03:03:44 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236238AbiEIHzl (ORCPT + 99 others); Mon, 9 May 2022 03:55:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236537AbiEIHxC (ORCPT ); Mon, 9 May 2022 03:53:02 -0400 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 155C813C095 for ; Mon, 9 May 2022 00:49:09 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id bg25so7860448wmb.4 for ; Mon, 09 May 2022 00:49:09 -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=fRZyDAC5noxICsXaOAqau1/ttQLOHtWio9AdCHIvswcCePv31PpBJVfR1sCfKdkDnO 6CVhfA1CZgWSwhNacaCNSAvLJwh72q3cXiXFsj3DPsUlUWgHa52TlodzCfwhFCLAQJVP Vx+p+FjM1Y6sJobZOgW+B5yuEOrUJxs62DvnnsXSRy/CaDRtuJg6ljAMyK5OkZRMqNkr EWmNYA71iMdz5YFO8Fn6HdEv5kzCj0Huf0MmrD0GnPzmpinEP/krHUYBsiThXupkcrPQ SeTO39Upkp4BOzUmboHt4KjPagx9wUGUwtnqewUDjdc2Ifgf1SkUxIMxmaWd05WSCTub XLWg== X-Gm-Message-State: AOAM530xUJPkQaIOZmqhz50/IJR26q72EhtCVsGhn4SudIirsXa272Td /VimpOfrl5pMtITgdR7lbW9CuQ== 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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