From: Claudiu Beznea <claudiu.beznea@microchip.com>
To: <nicolas.ferre@microchip.com>, <davem@davemloft.net>,
<edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>,
<linux@armlinux.org.uk>, <andrew@lunn.ch>, <hkallweit1@gmail.com>
Cc: <sergiu.moga@microchip.com>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
Claudiu Beznea <claudiu.beznea@microchip.com>
Subject: [PATCH 1/2] net: phylink: add helper to initialize phylink's phydev
Date: Mon, 5 Dec 2022 17:33:27 +0200 [thread overview]
Message-ID: <20221205153328.503576-2-claudiu.beznea@microchip.com> (raw)
In-Reply-To: <20221205153328.503576-1-claudiu.beznea@microchip.com>
Add helper to initialize phydev embedded in a phylink object.
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
---
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
next prev parent reply other threads:[~2022-12-05 15:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-05 15:33 [PATCH 0/2] net: macb: fix connectivity after resume Claudiu Beznea
2022-12-05 15:33 ` Claudiu Beznea [this message]
2022-12-05 15:57 ` [PATCH 1/2] net: phylink: add helper to initialize phylink's phydev Russell King (Oracle)
2022-12-07 10:49 ` Claudiu.Beznea
2022-12-07 12:23 ` Russell King (Oracle)
2022-12-05 15:33 ` [PATCH 2/2] net: macb: fix connectivity after resume Claudiu Beznea
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221205153328.503576-2-claudiu.beznea@microchip.com \
--to=claudiu.beznea@microchip.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=nicolas.ferre@microchip.com \
--cc=pabeni@redhat.com \
--cc=sergiu.moga@microchip.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®