1 --- a/drivers/net/ethernet/broadcom/bgmac.c
2 +++ b/drivers/net/ethernet/broadcom/bgmac.c
5 #include <linux/interrupt.h>
6 #include <linux/dma-mapping.h>
7 +#include <linux/platform_data/b53.h>
9 #include <bcm47xx_nvram.h>
11 @@ -1396,6 +1397,17 @@ static void bgmac_mii_unregister(struct
12 mdiobus_free(mii_bus);
15 +static struct b53_platform_data bgmac_b53_pdata = {
18 +static struct platform_device bgmac_b53_dev = {
19 + .name = "b53-srab-switch",
22 + .platform_data = &bgmac_b53_pdata,
26 /**************************************************
28 **************************************************/
29 @@ -1495,6 +1507,16 @@ static int bgmac_probe(struct bcma_devic
33 + if (core->id.id != BCMA_CHIP_ID_BCM4707 &&
34 + core->id.id != BCMA_CHIP_ID_BCM53018 &&
35 + !bgmac_b53_pdata.regs) {
36 + bgmac_b53_pdata.regs = ioremap_nocache(0x18007000, 0x1000);
38 + err = platform_device_register(&bgmac_b53_dev);
40 + bgmac->b53_device = &bgmac_b53_dev;
43 err = register_netdev(bgmac->net_dev);
45 bgmac_err(bgmac, "Cannot register net device\n");
46 @@ -1524,6 +1546,10 @@ static void bgmac_remove(struct bcma_dev
48 struct bgmac *bgmac = bcma_get_drvdata(core);
50 + if (bgmac->b53_device)
51 + platform_device_unregister(&bgmac_b53_dev);
52 + bgmac->b53_device = NULL;
54 netif_napi_del(&bgmac->napi);
55 unregister_netdev(bgmac->net_dev);
56 bgmac_mii_unregister(bgmac);
57 --- a/drivers/net/ethernet/broadcom/bgmac.h
58 +++ b/drivers/net/ethernet/broadcom/bgmac.h
59 @@ -428,6 +428,9 @@ struct bgmac {
64 + /* platform device for associated switch */
65 + struct platform_device *b53_device;
68 static inline u32 bgmac_read(struct bgmac *bgmac, u16 offset)