Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6139484rwb; Mon, 5 Dec 2022 08:26:12 -0800 (PST) X-Google-Smtp-Source: AA0mqf7fYtWymnLcSRkCR+gwdyA8Gyrp5VEpIf+fw/DzI3feHFCvycLyiA+cpkxnEF0OqDLC94/R X-Received: by 2002:a17:906:5dd2:b0:7c0:af0b:b3a2 with SMTP id p18-20020a1709065dd200b007c0af0bb3a2mr11802746ejv.654.1670257572660; Mon, 05 Dec 2022 08:26:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670257572; cv=none; d=google.com; s=arc-20160816; b=PLPo+k/U4I/u8flwfKG2LZuc1hf+gbw62p9Yvat1x3xQ1pPEcVz94JADk9YYx+s3D5 GTUwB3xlNkF4jjjcSSGht3VCnJ74coa9qxUhvzNI/ZYQ0qH8iLZrqmBcgmdLSgtlTUVF 5NrgXyeYAv1gFE+15I/mbebqKR9HDFyTOp5gC0ZL97tL0ArUvIlGGH1l33mnJ7xU5hU9 D4kHiozp3Mdsw9jgHbPttZZHraKN4wIPCagkPbgSvNdLxjssXn2m1DfxPHCXcEF2St44 T4RIrl1JVFk6Ek/eY8b3cR4OrjfiR/bfSPQpupCKHYEx4CtPwMYPWDd37907Ozh3sNX3 /6MQ== 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=OqRiauWqcJ4NVfo2zL+LLADj3ml3XwRlPFFG7JpBvFg=; b=rRSnI3PkdUb2IMDfoirm6R0PXO5QAeDoQUTorM1953QQI1dMDG1adv/osJkFawUVPN efSQH9h4q7I00GBP9Ytcsbptifz01tpYicd7qaXBy6YIJ3rxCL4Y2ta+vpyCg49PoIl8 4c/FRv+5I3aRxNTa4DCkGAp9q2X3ec5bKPDJ3YZEtX+LQtcmw8XLHDrHWhhxuP/gKXkY KqJPo/2MyK2AqdKceKl6i4tCQYw7vglNb4nd62emoKzq7gurTLWWwDSxm23FS63TuEvQ wMP5VPayYhl9Z5a7Y2JSdKpnRusL4p/4yZp04m11tvhb7vADPFT664UY205n/WsbgwlQ c7IA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=YDsCWzvs; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f17-20020a170906825100b007c101caa660si626306ejx.243.2022.12.05.08.25.53; Mon, 05 Dec 2022 08:26:12 -0800 (PST) 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=@microchip.com header.s=mchp header.b=YDsCWzvs; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232876AbiLEPb1 (ORCPT + 81 others); Mon, 5 Dec 2022 10:31:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230353AbiLEPaw (ORCPT ); Mon, 5 Dec 2022 10:30:52 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E73A86332; Mon, 5 Dec 2022 07:29:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1670254188; x=1701790188; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Fr+m1IBK+OruzgQto/Ovdj+7udSquCWkwSxcuR1wIjY=; b=YDsCWzvswP5V+DGGBFz1N4qMY5ffRN1HL7odO1kHBHAlltNRRL5ytOVq vCDwusBPAHFnG8c7wVgGHbtBKakgVYZmkyWuzKtYZP2R6YP64s75teU1B j8lUcUUTeQDOnanL9mibIWjAVdle6K0DiQdnhDX5G1CMGmRb132R0Bzpg M2vvvENhJczdIKOWOhcEnEWWOstGLCYLc94LXY0SiGcRAYNarRRhT46x9 1HXGaFxTmP3Al0RrtxxAUlJ3nI5BKm6hOvU/ZTmGC+0/VOh2GygSITulJ TwpyEQGMgJwrPm511qnoeXKzw2IUFMJzoi4wX7tw4OMHbSHGrIO2aARHC Q==; X-IronPort-AV: E=Sophos;i="5.96,219,1665471600"; d="scan'208";a="126541656" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 05 Dec 2022 08:29:37 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Mon, 5 Dec 2022 08:29:36 -0700 Received: from localhost.localdomain (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Mon, 5 Dec 2022 08:29:34 -0700 From: Claudiu Beznea To: , , , , , , , CC: , , , Claudiu Beznea Subject: [PATCH 1/2] net: phylink: add helper to initialize phylink's phydev Date: Mon, 5 Dec 2022 17:33:27 +0200 Message-ID: <20221205153328.503576-2-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20221205153328.503576-1-claudiu.beznea@microchip.com> References: <20221205153328.503576-1-claudiu.beznea@microchip.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS 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 Add helper to initialize phydev embedded in a phylink object. Signed-off-by: Claudiu Beznea --- drivers/net/phy/phylink.c | 10 ++++++++++ include/linux/phylink.h | 1 + 2 files changed, 11 insertions(+) diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index 09cc65c0da93..1e2478b8cd5f 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -2541,6 +2541,16 @@ int phylink_ethtool_set_eee(struct phylink *pl, struct ethtool_eee *eee) } EXPORT_SYMBOL_GPL(phylink_ethtool_set_eee); +/** + * phylink_init_phydev() - initialize phydev associated to phylink + * @pl: a pointer to a &struct phylink returned from phylink_create() + */ +int phylink_init_phydev(struct phylink *pl) +{ + return phy_init_hw(pl->phydev); +} +EXPORT_SYMBOL_GPL(phylink_init_phydev); + /* This emulates MII registers for a fixed-mode phy operating as per the * passed in state. "aneg" defines if we report negotiation is possible. * diff --git a/include/linux/phylink.h b/include/linux/phylink.h index c492c26202b5..6a969aa75c7f 100644 --- a/include/linux/phylink.h +++ b/include/linux/phylink.h @@ -609,6 +609,7 @@ int phylink_ethtool_set_eee(struct phylink *, struct ethtool_eee *); int phylink_mii_ioctl(struct phylink *, struct ifreq *, int); int phylink_speed_down(struct phylink *pl, bool sync); int phylink_speed_up(struct phylink *pl); +int phylink_init_phydev(struct phylink *pl); #define phylink_zero(bm) \ bitmap_zero(bm, __ETHTOOL_LINK_MODE_MASK_NBITS) -- 2.34.1