Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp6847567rwp; Tue, 18 Jul 2023 06:45:48 -0700 (PDT) X-Google-Smtp-Source: APBJJlHXg2CAx6Sg6c5k1in0+7sQ8hXmDAT68WLJR+o/cMQZSlOcYqs0nCkCwY4PwSM3E/5vpvxY X-Received: by 2002:a05:6358:9886:b0:133:4ce:4e8c with SMTP id q6-20020a056358988600b0013304ce4e8cmr14563404rwa.29.1689687948021; Tue, 18 Jul 2023 06:45:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689687947; cv=none; d=google.com; s=arc-20160816; b=jt1RWkooJTRLfsT92QsQNhlcdjyeNwHfazsDvV6iOJ45lCZAC6ZQOu5ZhprTbS5aLX VFjHhQDXArCm1Q287gHYewDPu4eH5aJN6QzrGg5zrdoXvR7/QNcMqjGXjsZwiF/zqqfD Jy/VbLF8r/qK4V0uUqQq5t5mtQTxaP2qEhVNlsmnVq92kEg3jD8zd9b5AjzZrrtnSEzg IqEp24r1tLEypXdq7FQ5aO3t2sdsmKI1G88TCx0I5EnLU3ipRoDBDWi0D/XPIhXA9uTn NxBXBXDaWPkL1kglWhCw7fvwha/FyCZLxt9MGw5CIfHXxpm/43q7A453wmEY8AK235LQ QRUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=wRpukWUvHQpYxq64u1DA2F5ubHd/9wyLHrct3/Pjsz4=; fh=JAekWGGAN/5nNRzEdl3j8uZg1u4oOZCz9QGYctGnai0=; b=cfyVgN97izTx0/ZNTr6N+/FatkV9MiOQ4xKTNKpdy9iIYJEAAzRRMhRqk8fDS/yM4+ urkEvU9BApARJKfQ1N1OJcbe6dw1JZ/2kZCq1PNUDVjBAy+WcNX8/yy4SIYiH5rDcvI3 EyBMm1sNJqy4A2wuwmaEPPTXl6caGn2SKSVl4sjOvApuf2F4nFAtfkOHgfbjwJRsC2d0 tqPbv9dqjB8grraKoARa1FWZCpjsOizPyRj3XDbs5Q/kxUEVm0GrQtRU8fTtC6VeCRw0 QRB63AIRUVouIRZY7BZ//Cf49j2m5P4vbO8oDf9sCuoSgXHV4VA++XRFwhbxeOIMPK3V sHsg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k17-20020a634b51000000b0055bce775e67si1562114pgl.159.2023.07.18.06.45.35; Tue, 18 Jul 2023 06:45:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231556AbjGRNPj (ORCPT + 99 others); Tue, 18 Jul 2023 09:15:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231292AbjGRNPh (ORCPT ); Tue, 18 Jul 2023 09:15:37 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 592F6B3 for ; Tue, 18 Jul 2023 06:15:36 -0700 (PDT) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qLkXq-00057f-Ex; Tue, 18 Jul 2023 15:15:14 +0200 Received: from mfe by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1qLkXi-0002h3-Rr; Tue, 18 Jul 2023 15:15:06 +0200 Date: Tue, 18 Jul 2023 15:15:06 +0200 From: Marco Felsch To: Andrew Lunn Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, peppe.cavallaro@st.com, alexandre.torgue@foss.st.com, joabreu@synopsys.com, mcoquelin.stm32@gmail.com, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: Re: [PATCH net-next 2/2] net: stmmac: platform: add support for phy-supply Message-ID: <20230718131506.ro2o45qhggykwhwc@pengutronix.de> References: <20230717164307.2868264-1-m.felsch@pengutronix.de> <20230717164307.2868264-2-m.felsch@pengutronix.de> <20230718083841.p67wflhjlwnu56j4@pengutronix.de> <9214ae14-b501-4d94-9d52-fd7dab2a86af@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9214ae14-b501-4d94-9d52-fd7dab2a86af@lunn.ch> User-Agent: NeoMutt/20180716 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: mfe@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 On 23-07-18, Andrew Lunn wrote: > On Tue, Jul 18, 2023 at 10:38:41AM +0200, Marco Felsch wrote: > > On 23-07-18, Andrew Lunn wrote: > > > > +static int stmmac_phy_power(struct platform_device *pdev, > > > > + struct plat_stmmacenet_data *plat, > > > > + bool enable) > > > > +{ > > > > + struct regulator *regulator = plat->phy_regulator; > > > > + int ret = 0; > > > > + > > > > + if (regulator) { > > > > + if (enable) > > > > + ret = regulator_enable(regulator); > > > > + else > > > > + regulator_disable(regulator); > > > > + } > > > > + > > > > + if (ret) > > > > + dev_err(&pdev->dev, "Fail to enable regulator\n"); > > > > > > 'enable' is only correct 50% of the time. > > > > You mean to move it under the enable path. > > Or don't use the word 'enable'. 'modify' ? I changed it but kept the 'enable'. > > Good point didn't consider WOL. Is there a way to check if WOL is > > enabled? > > Yes, plenty of MAC drivers do this. Look around. Yep, checked the code and found the interesting parts :) Thanks for the hint. Regards, Marco