Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2390086ioo; Sat, 28 May 2022 12:08:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTklfd5aaeyhmPoIvuRX/Q7tILLY1sFqLQPcAVEeG2if+B+kN3Mze2fVQ6buOsPbO1f3+y X-Received: by 2002:a65:604a:0:b0:3f9:f423:b474 with SMTP id a10-20020a65604a000000b003f9f423b474mr31137870pgp.527.1653764888358; Sat, 28 May 2022 12:08:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653764888; cv=none; d=google.com; s=arc-20160816; b=eFobrHjfXQEVBodyb7AHsHlmcDoSBdFRKLeFqg4a3tg2bvg3NjFaUIeoE+d6+cHz6W R+MSn15GuQYJ56i7na3/9+Ir9py6RbPo7T9RYyqqOYG49OkR6UnjoiviQNQKDuAPeyXP +Kh42QMTV8ZbM50QpPJ8QlrP21t2gVx7gwmFJiZKITgq6B6uypKnHKrKYDfgfAPk1uGH bsrRKtiZm4VRotOvhQqKXkhEEA6/BL1MVKCPS2Xgl9XMd2iH+iwkuZdauXRV4HfyXmyY lnb+GceEroTRKxF3Vh4qmtTkyEyc6HWa718XB4NQffyb0IsHznKLqfJ+CmH0dyMn/Q5U fNLA== 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:subject:cc:to:from:date :dkim-signature; bh=WXww1ZUDe0DDQ7APHZrgxDiz3KnakZMLOJFjUi0wzn0=; b=DH4/26PRRZIlqX0pmBDDwMBotXVTSaoWkMiGMPWz5hTWvNZRxfqplf96pVn/omSdq2 oDRHK4FZXpSstmiXqftz1MhlfnJ3YQW+I7Sxb8KvsWcN4mMGMrUYKEkt0yOMyUXAK7rY dLtSx8VGGqCggJueMUXL4Qof9eUlYlzpwatEzl6DsfYwnTh1nuBlMDdvZo9jQMr4w+jw 0sL2bo4/aU7x/yL+fanKOXFQBbTz1ikr1pBiIPBwK5043lq1/2mWzhxEq5imk81M5ADB MFwpGCoFUtjMbls1qC0Rj6Ej6ESaMd3wOLIWqcN8iuoUMsq7JmCpc4yXpNPqtTiH268E itxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aRsOSLBv; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id h193-20020a636cca000000b003abaf9f081bsi10669918pgc.752.2022.05.28.12.08.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 12:08:08 -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=@kernel.org header.s=k20201202 header.b=aRsOSLBv; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4C9516317; Sat, 28 May 2022 11:46:40 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239788AbiE0EAx (ORCPT + 99 others); Fri, 27 May 2022 00:00:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229696AbiE0EAu (ORCPT ); Fri, 27 May 2022 00:00:50 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2F72E27A8; Thu, 26 May 2022 21:00:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 9AF88B82281; Fri, 27 May 2022 04:00:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9A33C385A9; Fri, 27 May 2022 04:00:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653624046; bh=AIn4JDCvAfCC2uEkwjg1qq8LYA0cehvmuztjXF/NZcg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=aRsOSLBvnd62P0sGwVb67mpQvRy4aPsy1ClDRfM2GmGBhWWxCfVeafDNxmpiTs0WM kUyVfzVnLYg+nAcs3fq+jsNRAfx+toFcYiz7qCVhD5B1gLWAYDxFQH1J8Jx9hMGN0A UZISU+Ybd60FbtMKglpZ8+wdzDwIpHSk+4gO8DAysauLnnD0KF/xlVOYmE5rAoJ8aA vFc4jSMkDkaqwsJQqMptP/AW2tMU8S6C5gIQrShcgFsL6lLHVsDYmohpKBfa3MRYIx xpbZV4nKpSjO+m3vqkpTLelcgmDS1hZelYMjZqFoG4kugeSv2+Z73ZfnUELw9HMkro abTGLhuKi6Itg== Date: Thu, 26 May 2022 21:00:44 -0700 From: Jakub Kicinski To: "Viorel Suman (OSS)" Cc: Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Paolo Abeni , Luo Jie , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-imx@nxp.com, Viorel Suman Subject: Re: [PATCH] net: phy: at803x: disable WOL at probe Message-ID: <20220526210044.638128f6@kernel.org> In-Reply-To: <20220525103657.22384-1-viorel.suman@oss.nxp.com> References: <20220525103657.22384-1-viorel.suman@oss.nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,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 Wed, 25 May 2022 13:36:57 +0300 Viorel Suman (OSS) wrote: > diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c > index 73926006d319..6277d1b1d814 100644 > --- a/drivers/net/phy/at803x.c > +++ b/drivers/net/phy/at803x.c > @@ -443,10 +443,10 @@ static int at803x_set_wol(struct phy_device *phydev, > AT803X_LOC_MAC_ADDR_0_15_OFFSET, > }; > > - if (!ndev) > - return -ENODEV; > - > if (wol->wolopts & WAKE_MAGIC) { > + if (!ndev) > + return -ENODEV; Please move the ndev variable into the scope. It'll make it clear that it can't be used elsewhere in this function. > mac = (const u8 *) ndev->dev_addr; > > if (!is_valid_ether_addr(mac)) > @@ -857,6 +857,9 @@ static int at803x_probe(struct phy_device *phydev) > if (phydev->drv->phy_id == ATH8031_PHY_ID) { > int ccr = phy_read(phydev, AT803X_REG_CHIP_CONFIG); > int mode_cfg; > + struct ethtool_wolinfo wol = { > + .wolopts = 0, > + }; > > if (ccr < 0) > goto err; > @@ -872,6 +875,13 @@ static int at803x_probe(struct phy_device *phydev) > priv->is_fiber = true; > break; > } > + > + /* Disable WOL by default */ > + ret = at803x_set_wol(phydev, &wol); > + if (ret < 0) { > + phydev_err(phydev, "failed to disable WOL on probe: %d\n", ret); > + return ret; Don't you need to goto err; here? > + } > } > > return 0;