001-4.16-04-bcm63xx_enet-use-platform-device-id-directly-for-mii.patch 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. From faea89cd893a1a7af81185f026a64dad603ef72f Mon Sep 17 00:00:00 2001
  2. From: Jonas Gorski <[email protected]>
  3. Date: Sun, 17 Dec 2017 12:58:12 +0100
  4. Subject: [PATCH 4/4] bcm63xx_enet: use platform device id directly for miibus
  5. name
  6. Directly use the platform device for generating the miibus name. This removes
  7. the last user of bcm_enet_priv::mac_id and we can remove the field.
  8. Signed-off-by: Jonas Gorski <[email protected]>
  9. ---
  10. drivers/net/ethernet/broadcom/bcm63xx_enet.c | 3 +--
  11. drivers/net/ethernet/broadcom/bcm63xx_enet.h | 3 ---
  12. 2 files changed, 1 insertion(+), 5 deletions(-)
  13. --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
  14. +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
  15. @@ -1770,7 +1770,6 @@ static int bcm_enet_probe(struct platfor
  16. dev->irq = priv->irq = res_irq->start;
  17. priv->irq_rx = res_irq_rx->start;
  18. priv->irq_tx = res_irq_tx->start;
  19. - priv->mac_id = pdev->id;
  20. priv->mac_clk = devm_clk_get(&pdev->dev, "enet");
  21. if (IS_ERR(priv->mac_clk)) {
  22. @@ -1838,7 +1837,7 @@ static int bcm_enet_probe(struct platfor
  23. bus->priv = priv;
  24. bus->read = bcm_enet_mdio_read_phylib;
  25. bus->write = bcm_enet_mdio_write_phylib;
  26. - sprintf(bus->id, "%s-%d", pdev->name, priv->mac_id);
  27. + sprintf(bus->id, "%s-%d", pdev->name, pdev->id);
  28. /* only probe bus where we think the PHY is, because
  29. * the mdio read operation return 0 instead of 0xffff
  30. --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.h
  31. +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.h
  32. @@ -192,9 +192,6 @@ struct bcm_enet_mib_counters {
  33. struct bcm_enet_priv {
  34. - /* mac id (from platform device id) */
  35. - int mac_id;
  36. -
  37. /* base remapped address of device */
  38. void __iomem *base;