Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp6810721rwp; Tue, 18 Jul 2023 06:17:29 -0700 (PDT) X-Google-Smtp-Source: APBJJlEcylHosLxZelCd6+5Loev4Lhy1SJaHxY+8xQApSURzo40VOlQ8EogeQb/PAoCzY8RH72da X-Received: by 2002:a17:902:ce90:b0:1b8:417d:d042 with SMTP id f16-20020a170902ce9000b001b8417dd042mr16592805plg.20.1689686249535; Tue, 18 Jul 2023 06:17:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689686249; cv=none; d=google.com; s=arc-20160816; b=Qo+j72Wi3rHbBI6suX9BWv6Y8F/u6nlkVuW7kHe+XKxCMftyHm6KQpxwCH8AlcpMn4 D3AQ5gugbDXbzdSot150Kjs4ll25hVW3tE38xOrvOHSh3Uw+db1BOAjOBGZy3EmC3IFq 8+0b0R6Hk4B8nXHyk9LDp+Arz30U5OvnRcj+oUh+C2Ox1+Ga/RquemLgdRU7fpA6nikC e+XUgFSqS0D9BZSBKdqfOzcwpBH7gxMKQ4nW36eOp0y6CFbCrML4uoBl4d8PHHuzIGCW ticYPHgySB9nFZL3wBem3/GjNsvKTL5kPdrVfbh3PJCS9OWR+iPQwLFsBmJQYg23Tsgc 47Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ZObdJe8z/FH7zyHM59qxcKSRiK8MNQZG6bz1KjetFWc=; fh=xtfLt8Q5QcFdRr1PLlUL2oKPOWNEBSPpqK5PS3y+FWM=; b=Zokr/ygZj8CBTxr+mjKr0fc/tnjeNqqeYbkKtZK58ZqTZdnarniLOScSgaI1U7QX7d NoOBnxGT8Dyp0XfaiGHHqz+yY4UXhvR/4CihhVD6dIcvHYaBXJ5ZmYzy8ffJ1sku9Ju0 ZONCOCkB6zJ/TPgCH7ICA9cW0XeDTDaDcAA1K9jRhevquMJF9BxvKpAhZJHS1pmBWzww DAJ6Q/wThjvk1MIqRQs4vz35fgIxH0sXsuILPwhxkxonotCTskfe76WCap0V1NraoeZa ube1rQw3S1DOaPivJhTzaYa6bfBs9Mt8ceXxJ1Yo6OI510qyUsv8NLJr58nJTMPU4qjE AL2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=bGSb5Ygy; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x16-20020a170902821000b001b88f29c677si1534058pln.583.2023.07.18.06.17.16; Tue, 18 Jul 2023 06:17:29 -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; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=bGSb5Ygy; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230197AbjGRNK7 (ORCPT + 99 others); Tue, 18 Jul 2023 09:10:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232585AbjGRNKk (ORCPT ); Tue, 18 Jul 2023 09:10:40 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA6AC170D; Tue, 18 Jul 2023 06:10:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=ZObdJe8z/FH7zyHM59qxcKSRiK8MNQZG6bz1KjetFWc=; b=bGSb5YgyK1ofKeyANqnrfWiqLC DunnFcwfGSxCdPLD3qDwwGLCxZscB1JWxVai2j/EBpGbjtLA1LxBqwnuMz9Fuj14fatVofdQGOcXR Hwf2ATdxNjd+iLwFzCe7lKFiw7Zeeg/tdGOC6wda1EHC3F4y4XN0A9BjoTzEXPyXXK8g=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1qLkT1-001cvq-KC; Tue, 18 Jul 2023 15:10:15 +0200 Date: Tue, 18 Jul 2023 15:10:15 +0200 From: Andrew Lunn To: Marco Felsch 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: <9214ae14-b501-4d94-9d52-fd7dab2a86af@lunn.ch> References: <20230717164307.2868264-1-m.felsch@pengutronix.de> <20230717164307.2868264-2-m.felsch@pengutronix.de> <20230718083841.p67wflhjlwnu56j4@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230718083841.p67wflhjlwnu56j4@pengutronix.de> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 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' ? > 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. Andrew