ath79: add support for Huawei AP5030DN
[openwrt/openwrt.git] / target / linux / generic / backport-6.1 / 715-08-net-sfp-make-sfp_bus_find_fwnode-take-a-const-fwnode.patch
1 From a90ac762d345890b40d88a1385a34a2449c2d75e Mon Sep 17 00:00:00 2001
2 From: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
3 Date: Fri, 24 Mar 2023 09:23:42 +0000
4 Subject: [PATCH] net: sfp: make sfp_bus_find_fwnode() take a const fwnode
5
6 sfp_bus_find_fwnode() does not write to the fwnode, so let's make it
7 const.
8
9 Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
10 Reviewed-by: Simon Horman <simon.horman@corigine.com>
11 Signed-off-by: David S. Miller <davem@davemloft.net>
12 ---
13 drivers/net/phy/sfp-bus.c | 2 +-
14 include/linux/sfp.h | 5 +++--
15 2 files changed, 4 insertions(+), 3 deletions(-)
16
17 --- a/drivers/net/phy/sfp-bus.c
18 +++ b/drivers/net/phy/sfp-bus.c
19 @@ -603,7 +603,7 @@ static void sfp_upstream_clear(struct sf
20 * - %-ENOMEM if we failed to allocate the bus.
21 * - an error from the upstream's connect_phy() method.
22 */
23 -struct sfp_bus *sfp_bus_find_fwnode(struct fwnode_handle *fwnode)
24 +struct sfp_bus *sfp_bus_find_fwnode(const struct fwnode_handle *fwnode)
25 {
26 struct fwnode_reference_args ref;
27 struct sfp_bus *bus;
28 --- a/include/linux/sfp.h
29 +++ b/include/linux/sfp.h
30 @@ -548,7 +548,7 @@ int sfp_get_module_eeprom_by_page(struct
31 void sfp_upstream_start(struct sfp_bus *bus);
32 void sfp_upstream_stop(struct sfp_bus *bus);
33 void sfp_bus_put(struct sfp_bus *bus);
34 -struct sfp_bus *sfp_bus_find_fwnode(struct fwnode_handle *fwnode);
35 +struct sfp_bus *sfp_bus_find_fwnode(const struct fwnode_handle *fwnode);
36 int sfp_bus_add_upstream(struct sfp_bus *bus, void *upstream,
37 const struct sfp_upstream_ops *ops);
38 void sfp_bus_del_upstream(struct sfp_bus *bus);
39 @@ -610,7 +610,8 @@ static inline void sfp_bus_put(struct sf
40 {
41 }
42
43 -static inline struct sfp_bus *sfp_bus_find_fwnode(struct fwnode_handle *fwnode)
44 +static inline struct sfp_bus *
45 +sfp_bus_find_fwnode(const struct fwnode_handle *fwnode)
46 {
47 return NULL;
48 }