kernel: backport bgmac patch moving MDIO code into separated file

This prepares bgmac for the biggest change: dropping bcma dependency.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
This commit is contained in:
Rafał Miłecki
2016-08-17 00:06:14 +02:00
parent 6d3fbf2818
commit f2103c50ab
2 changed files with 685 additions and 9 deletions

View File

@@ -12,9 +12,9 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
#include <linux/bcm47xx_nvram.h>
static const struct bcma_device_id bgmac_bcma_tbl[] = {
@@ -1681,6 +1682,17 @@ static void bgmac_mii_unregister(struct
mdiobus_free(mii_bus);
}
@@ -1403,6 +1404,17 @@ static const struct ethtool_ops bgmac_et
.get_drvinfo = bgmac_get_drvinfo,
};
+static struct b53_platform_data bgmac_b53_pdata = {
+};
@@ -28,9 +28,9 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+};
+
/**************************************************
* BCMA bus ops
* MII
**************************************************/
@@ -1829,6 +1841,14 @@ static int bgmac_probe(struct bcma_devic
@@ -1630,6 +1642,14 @@ static int bgmac_probe(struct bcma_devic
net_dev->hw_features = net_dev->features;
net_dev->vlan_features = net_dev->features;
@@ -45,7 +45,7 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
err = register_netdev(bgmac->net_dev);
if (err) {
dev_err(bgmac->dev, "Cannot register net device\n");
@@ -1855,6 +1875,10 @@ static void bgmac_remove(struct bcma_dev
@@ -1657,6 +1677,10 @@ static void bgmac_remove(struct bcma_dev
{
struct bgmac *bgmac = bcma_get_drvdata(core);
@@ -54,8 +54,8 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+ bgmac->b53_device = NULL;
+
unregister_netdev(bgmac->net_dev);
bgmac_mii_unregister(bgmac);
netif_napi_del(&bgmac->napi);
phy_disconnect(bgmac->net_dev->phydev);
bcma_mdio_mii_unregister(bgmac->mii_bus);
--- a/drivers/net/ethernet/broadcom/bgmac.h
+++ b/drivers/net/ethernet/broadcom/bgmac.h
@@ -454,6 +454,9 @@ struct bgmac {
@@ -67,4 +67,4 @@ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+ struct platform_device *b53_device;
};
static inline u32 bgmac_read(struct bgmac *bgmac, u16 offset)
struct mii_bus *bcma_mdio_mii_register(struct bcma_device *core, u8 phyaddr);