From: Florian Fainelli <f.fainelli@gmail•com>
To: netdev@vger•kernel.org
Cc: Florian Fainelli <f.fainelli@gmail•com>,
rmk+kernel@armlinux•org.uk, davem@davemloft•net, andrew@lunn•ch,
vivien.didelot@savoirfairelinux•com
Subject: [PATCH net-next v2 1/5] net: phy: phylink: Allow specifying PHY device flags
Date: Tue, 12 Dec 2017 16:00:25 -0800 [thread overview]
Message-ID: <20171213000029.8649-2-f.fainelli@gmail.com> (raw)
In-Reply-To: <20171213000029.8649-1-f.fainelli@gmail.com>
In order to let subsystems like DSA fully utilize PHYLINK, we need to be able
to communicate phy_device::flags from of_phy_{connect,attach} even when using
PHYLINK APIs.
Signed-off-by: Florian Fainelli <f.fainelli@gmail•com>
---
drivers/net/phy/phylink.c | 7 +++++--
include/linux/phylink.h | 2 +-
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index 2bfb548d3dff..94b43c5237fa 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -731,6 +731,7 @@ EXPORT_SYMBOL_GPL(phylink_connect_phy);
* phylink_of_phy_connect() - connect the PHY specified in the DT mode.
* @pl: a pointer to a &struct phylink returned from phylink_create()
* @dn: a pointer to a &struct device_node.
+ * @flags: PHY-specific flags to communicate to the PHY device driver
*
* Connect the phy specified in the device node @dn to the phylink instance
* specified by @pl. Actions specified in phylink_connect_phy() will be
@@ -738,7 +739,8 @@ EXPORT_SYMBOL_GPL(phylink_connect_phy);
*
* Returns 0 on success or a negative errno.
*/
-int phylink_of_phy_connect(struct phylink *pl, struct device_node *dn)
+int phylink_of_phy_connect(struct phylink *pl, struct device_node *dn,
+ u32 flags)
{
struct device_node *phy_node;
struct phy_device *phy_dev;
@@ -764,7 +766,8 @@ int phylink_of_phy_connect(struct phylink *pl, struct device_node *dn)
return 0;
}
- phy_dev = of_phy_attach(pl->netdev, phy_node, 0, pl->link_interface);
+ phy_dev = of_phy_attach(pl->netdev, phy_node, flags,
+ pl->link_interface);
/* We're done with the phy_node handle */
of_node_put(phy_node);
diff --git a/include/linux/phylink.h b/include/linux/phylink.h
index 4f0f452ff38d..36e342b450c7 100644
--- a/include/linux/phylink.h
+++ b/include/linux/phylink.h
@@ -188,7 +188,7 @@ struct phylink *phylink_create(struct net_device *, struct fwnode_handle *,
void phylink_destroy(struct phylink *);
int phylink_connect_phy(struct phylink *, struct phy_device *);
-int phylink_of_phy_connect(struct phylink *, struct device_node *);
+int phylink_of_phy_connect(struct phylink *, struct device_node *, u32 flags);
void phylink_disconnect_phy(struct phylink *);
void phylink_mac_change(struct phylink *, bool up);
--
2.14.1
next prev parent reply other threads:[~2017-12-13 0:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-13 0:00 [PATCH net-next v2 0/5] PHYLINK preparatory patches for DSA Florian Fainelli
2017-12-13 0:00 ` Florian Fainelli [this message]
2017-12-13 16:54 ` [PATCH net-next v2 1/5] net: phy: phylink: Allow specifying PHY device flags Andrew Lunn
2017-12-13 0:00 ` [PATCH net-next v2 2/5] net: phy: phylink: Use PHY device interface if N/A Florian Fainelli
2017-12-13 0:00 ` [PATCH net-next v2 3/5] net: phy: phylink: Remove error message Florian Fainelli
2017-12-13 16:56 ` Andrew Lunn
2017-12-13 0:00 ` [PATCH net-next v2 4/5] net: phy: phylink: Allow setting a custom link state callback Florian Fainelli
2017-12-13 16:58 ` Andrew Lunn
2017-12-13 0:00 ` [PATCH net-next v2 5/5] net: phy: phylink: Report MoCA as PORT_BNC Florian Fainelli
2017-12-13 16:59 ` Andrew Lunn
2017-12-13 20:55 ` [PATCH net-next v2 0/5] PHYLINK preparatory patches for DSA David Miller
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=20171213000029.8649-2-f.fainelli@gmail.com \
--to=f.fainelli@gmail$(echo .)com \
--cc=andrew@lunn$(echo .)ch \
--cc=davem@davemloft$(echo .)net \
--cc=netdev@vger$(echo .)kernel.org \
--cc=rmk+kernel@armlinux$(echo .)org.uk \
--cc=vivien.didelot@savoirfairelinux$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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