cab9e5a37a664840b8d753cc24681ed10bd9e25d
[openwrt/staging/nbd.git] /
1 From faea89cd893a1a7af81185f026a64dad603ef72f Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jonas.gorski@gmail.com>
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
7 Directly use the platform device for generating the miibus name. This removes
8 the last user of bcm_enet_priv::mac_id and we can remove the field.
9
10 Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
11 ---
12 drivers/net/ethernet/broadcom/bcm63xx_enet.c | 3 +--
13 drivers/net/ethernet/broadcom/bcm63xx_enet.h | 3 ---
14 2 files changed, 1 insertion(+), 5 deletions(-)
15
16 --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
17 +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
18 @@ -1754,7 +1754,6 @@ static int bcm_enet_probe(struct platfor
19 dev->irq = priv->irq = res_irq->start;
20 priv->irq_rx = res_irq_rx->start;
21 priv->irq_tx = res_irq_tx->start;
22 - priv->mac_id = pdev->id;
23
24 priv->mac_clk = devm_clk_get(&pdev->dev, "enet");
25 if (IS_ERR(priv->mac_clk)) {
26 @@ -1822,7 +1821,7 @@ static int bcm_enet_probe(struct platfor
27 bus->priv = priv;
28 bus->read = bcm_enet_mdio_read_phylib;
29 bus->write = bcm_enet_mdio_write_phylib;
30 - sprintf(bus->id, "%s-%d", pdev->name, priv->mac_id);
31 + sprintf(bus->id, "%s-%d", pdev->name, pdev->id);
32
33 /* only probe bus where we think the PHY is, because
34 * the mdio read operation return 0 instead of 0xffff
35 --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.h
36 +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.h
37 @@ -193,9 +193,6 @@ struct bcm_enet_mib_counters {
38
39 struct bcm_enet_priv {
40
41 - /* mac id (from platform device id) */
42 - int mac_id;
43 -
44 /* base remapped address of device */
45 void __iomem *base;
46