715-13-v6.5-net-phylink-constify-fwnode-arguments.patch 3.2 KB

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