790-07-v6.4-net-dsa-mt7530-move-SGMII-PCS-creation-to-mt7530_pro.patch 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. From 6b64b5bc3045a7e1ee5278df4f4ff315cd43d88a Mon Sep 17 00:00:00 2001
  2. From: Daniel Golle <[email protected]>
  3. Date: Mon, 3 Apr 2023 02:18:04 +0100
  4. Subject: [PATCH 07/48] net: dsa: mt7530: move SGMII PCS creation to
  5. mt7530_probe function
  6. Move creating the SGMII PCS from mt753x_setup() to the more appropriate
  7. mt7530_probe() function.
  8. This is done also in preparation of moving all functions related to
  9. MDIO-connected MT753x switches to a separate module.
  10. Signed-off-by: Daniel Golle <[email protected]>
  11. Reviewed-by: Andrew Lunn <[email protected]>
  12. Signed-off-by: David S. Miller <[email protected]>
  13. ---
  14. drivers/net/dsa/mt7530.c | 13 +++++++------
  15. 1 file changed, 7 insertions(+), 6 deletions(-)
  16. --- a/drivers/net/dsa/mt7530.c
  17. +++ b/drivers/net/dsa/mt7530.c
  18. @@ -3082,12 +3082,6 @@ mt753x_setup(struct dsa_switch *ds)
  19. if (ret && priv->irq)
  20. mt7530_free_irq_common(priv);
  21. - if (priv->id == ID_MT7531) {
  22. - ret = mt7531_create_sgmii(priv);
  23. - if (ret && priv->irq)
  24. - mt7530_free_irq_common(priv);
  25. - }
  26. -
  27. return ret;
  28. }
  29. @@ -3204,6 +3198,7 @@ mt7530_probe(struct mdio_device *mdiodev
  30. static struct regmap_config *regmap_config;
  31. struct mt7530_priv *priv;
  32. struct device_node *dn;
  33. + int ret;
  34. dn = mdiodev->dev.of_node;
  35. @@ -3296,6 +3291,12 @@ mt7530_probe(struct mdio_device *mdiodev
  36. if (IS_ERR(priv->regmap))
  37. return PTR_ERR(priv->regmap);
  38. + if (priv->id == ID_MT7531) {
  39. + ret = mt7531_create_sgmii(priv);
  40. + if (ret)
  41. + return ret;
  42. + }
  43. +
  44. return dsa_register_switch(priv->ds);
  45. }