1 From a3555d1f5c208f0a63eafee77381f68d304a0512 Mon Sep 17 00:00:00 2001
2 From: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
3 Date: Fri, 12 May 2023 17:58:37 +0100
4 Subject: [PATCH 12/21] net: phylink: constify fwnode arguments
6 Both phylink_create() and phylink_fwnode_phy_connect() do not modify
7 the fwnode argument that they are passed, so lets constify these.
9 Reviewed-by: Simon Horman <simon.horman@corigine.com>
10 Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
11 Signed-off-by: David S. Miller <davem@davemloft.net>
13 drivers/net/phy/phylink.c | 11 ++++++-----
14 include/linux/phylink.h | 9 +++++----
15 2 files changed, 11 insertions(+), 9 deletions(-)
17 --- a/drivers/net/phy/phylink.c
18 +++ b/drivers/net/phy/phylink.c
19 @@ -706,7 +706,7 @@ static int phylink_validate(struct phyli
22 static int phylink_parse_fixedlink(struct phylink *pl,
23 - struct fwnode_handle *fwnode)
24 + const struct fwnode_handle *fwnode)
26 struct fwnode_handle *fixed_node;
27 bool pause, asym_pause, autoneg;
28 @@ -817,7 +817,8 @@ static int phylink_parse_fixedlink(struc
32 -static int phylink_parse_mode(struct phylink *pl, struct fwnode_handle *fwnode)
33 +static int phylink_parse_mode(struct phylink *pl,
34 + const struct fwnode_handle *fwnode)
36 struct fwnode_handle *dn;
38 @@ -1440,7 +1441,7 @@ static void phylink_fixed_poll(struct ti
39 static const struct sfp_upstream_ops sfp_phylink_ops;
41 static int phylink_register_sfp(struct phylink *pl,
42 - struct fwnode_handle *fwnode)
43 + const struct fwnode_handle *fwnode)
47 @@ -1479,7 +1480,7 @@ static int phylink_register_sfp(struct p
48 * must use IS_ERR() to check for errors from this function.
50 struct phylink *phylink_create(struct phylink_config *config,
51 - struct fwnode_handle *fwnode,
52 + const struct fwnode_handle *fwnode,
53 phy_interface_t iface,
54 const struct phylink_mac_ops *mac_ops)
56 @@ -1809,7 +1810,7 @@ EXPORT_SYMBOL_GPL(phylink_of_phy_connect
57 * Returns 0 on success or a negative errno.
59 int phylink_fwnode_phy_connect(struct phylink *pl,
60 - struct fwnode_handle *fwnode,
61 + const struct fwnode_handle *fwnode,
64 struct fwnode_handle *phy_fwnode;
65 --- a/include/linux/phylink.h
66 +++ b/include/linux/phylink.h
67 @@ -568,16 +568,17 @@ void phylink_generic_validate(struct phy
68 unsigned long *supported,
69 struct phylink_link_state *state);
71 -struct phylink *phylink_create(struct phylink_config *, struct fwnode_handle *,
72 - phy_interface_t iface,
73 - const struct phylink_mac_ops *mac_ops);
74 +struct phylink *phylink_create(struct phylink_config *,
75 + const struct fwnode_handle *,
77 + const struct phylink_mac_ops *);
78 void phylink_destroy(struct phylink *);
79 bool phylink_expects_phy(struct phylink *pl);
81 int phylink_connect_phy(struct phylink *, struct phy_device *);
82 int phylink_of_phy_connect(struct phylink *, struct device_node *, u32 flags);
83 int phylink_fwnode_phy_connect(struct phylink *pl,
84 - struct fwnode_handle *fwnode,
85 + const struct fwnode_handle *fwnode,
87 void phylink_disconnect_phy(struct phylink *);