Skip to content

Commit 378e652

Browse files
hkallweitkuba-moo
authored andcommitted
net: bcmgenet: remove unused platform code
This effectively reverts b0ba512 ("net: bcmgenet: enable driver to work without a device tree"). There has never been an in-tree user of struct bcmgenet_platform_data, all devices use OF or ACPI. Signed-off-by: Heiner Kallweit <[email protected]> Reviewed-by: Simon Horman <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent a8e846b commit 378e652

File tree

4 files changed

+7
-108
lines changed

4 files changed

+7
-108
lines changed

MAINTAINERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5123,7 +5123,6 @@ F: Documentation/devicetree/bindings/net/brcm,unimac-mdio.yaml
51235123
F: drivers/net/ethernet/broadcom/genet/
51245124
F: drivers/net/ethernet/broadcom/unimac.h
51255125
F: drivers/net/mdio/mdio-bcm-unimac.c
5126-
F: include/linux/platform_data/bcmgenet.h
51275126
F: include/linux/platform_data/mdio-bcm-unimac.h
51285127

51295128
BROADCOM IPROC ARM ARCHITECTURE

drivers/net/ethernet/broadcom/genet/bcmgenet.c

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
#include <linux/ip.h>
3636
#include <linux/ipv6.h>
3737
#include <linux/phy.h>
38-
#include <linux/platform_data/bcmgenet.h>
3938

4039
#include <linux/unaligned.h>
4140

@@ -3926,7 +3925,6 @@ MODULE_DEVICE_TABLE(of, bcmgenet_match);
39263925

39273926
static int bcmgenet_probe(struct platform_device *pdev)
39283927
{
3929-
struct bcmgenet_platform_data *pd = pdev->dev.platform_data;
39303928
const struct bcmgenet_plat_data *pdata;
39313929
struct bcmgenet_priv *priv;
39323930
struct net_device *dev;
@@ -4010,9 +4008,6 @@ static int bcmgenet_probe(struct platform_device *pdev)
40104008
priv->version = pdata->version;
40114009
priv->dma_max_burst_length = pdata->dma_max_burst_length;
40124010
priv->flags = pdata->flags;
4013-
} else {
4014-
priv->version = pd->genet_version;
4015-
priv->dma_max_burst_length = DMA_MAX_BURST_LENGTH;
40164011
}
40174012

40184013
priv->clk = devm_clk_get_optional(&priv->pdev->dev, "enet");
@@ -4062,16 +4057,13 @@ static int bcmgenet_probe(struct platform_device *pdev)
40624057
if (device_get_phy_mode(&pdev->dev) == PHY_INTERFACE_MODE_INTERNAL)
40634058
bcmgenet_power_up(priv, GENET_POWER_PASSIVE);
40644059

4065-
if (pd && !IS_ERR_OR_NULL(pd->mac_address))
4066-
eth_hw_addr_set(dev, pd->mac_address);
4067-
else
4068-
if (device_get_ethdev_address(&pdev->dev, dev))
4069-
if (has_acpi_companion(&pdev->dev)) {
4070-
u8 addr[ETH_ALEN];
4060+
if (device_get_ethdev_address(&pdev->dev, dev))
4061+
if (has_acpi_companion(&pdev->dev)) {
4062+
u8 addr[ETH_ALEN];
40714063

4072-
bcmgenet_get_hw_addr(priv, addr);
4073-
eth_hw_addr_set(dev, addr);
4074-
}
4064+
bcmgenet_get_hw_addr(priv, addr);
4065+
eth_hw_addr_set(dev, addr);
4066+
}
40754067

40764068
if (!is_valid_ether_addr(dev->dev_addr)) {
40774069
dev_warn(&pdev->dev, "using random Ethernet MAC\n");

drivers/net/ethernet/broadcom/genet/bcmmii.c

Lines changed: 1 addition & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include <linux/of.h>
2121
#include <linux/of_net.h>
2222
#include <linux/of_mdio.h>
23-
#include <linux/platform_data/bcmgenet.h>
2423
#include <linux/platform_data/mdio-bcm-unimac.h>
2524

2625
#include "bcmgenet.h"
@@ -436,23 +435,6 @@ static struct device_node *bcmgenet_mii_of_find_mdio(struct bcmgenet_priv *priv)
436435
return priv->mdio_dn;
437436
}
438437

439-
static void bcmgenet_mii_pdata_init(struct bcmgenet_priv *priv,
440-
struct unimac_mdio_pdata *ppd)
441-
{
442-
struct device *kdev = &priv->pdev->dev;
443-
struct bcmgenet_platform_data *pd = kdev->platform_data;
444-
445-
if (pd->phy_interface != PHY_INTERFACE_MODE_MOCA && pd->mdio_enabled) {
446-
/*
447-
* Internal or external PHY with MDIO access
448-
*/
449-
if (pd->phy_address >= 0 && pd->phy_address < PHY_MAX_ADDR)
450-
ppd->phy_mask = 1 << pd->phy_address;
451-
else
452-
ppd->phy_mask = 0;
453-
}
454-
}
455-
456438
static int bcmgenet_mii_wait(void *wait_func_data)
457439
{
458440
struct bcmgenet_priv *priv = wait_func_data;
@@ -467,7 +449,6 @@ static int bcmgenet_mii_wait(void *wait_func_data)
467449
static int bcmgenet_mii_register(struct bcmgenet_priv *priv)
468450
{
469451
struct platform_device *pdev = priv->pdev;
470-
struct bcmgenet_platform_data *pdata = pdev->dev.platform_data;
471452
struct device_node *dn = pdev->dev.of_node;
472453
struct unimac_mdio_pdata ppd;
473454
struct platform_device *ppdev;
@@ -511,8 +492,6 @@ static int bcmgenet_mii_register(struct bcmgenet_priv *priv)
511492
ppdev->dev.parent = &pdev->dev;
512493
if (dn)
513494
ppdev->dev.of_node = bcmgenet_mii_of_find_mdio(priv);
514-
else if (pdata)
515-
bcmgenet_mii_pdata_init(priv, &ppd);
516495
else
517496
ppd.phy_mask = ~0;
518497

@@ -594,58 +573,6 @@ static int bcmgenet_mii_of_init(struct bcmgenet_priv *priv)
594573
return 0;
595574
}
596575

597-
static int bcmgenet_mii_pd_init(struct bcmgenet_priv *priv)
598-
{
599-
struct device *kdev = &priv->pdev->dev;
600-
struct bcmgenet_platform_data *pd = kdev->platform_data;
601-
char phy_name[MII_BUS_ID_SIZE + 3];
602-
char mdio_bus_id[MII_BUS_ID_SIZE];
603-
struct phy_device *phydev;
604-
605-
snprintf(mdio_bus_id, MII_BUS_ID_SIZE, "%s-%d",
606-
UNIMAC_MDIO_DRV_NAME, priv->pdev->id);
607-
608-
if (pd->phy_interface != PHY_INTERFACE_MODE_MOCA && pd->mdio_enabled) {
609-
snprintf(phy_name, MII_BUS_ID_SIZE, PHY_ID_FMT,
610-
mdio_bus_id, pd->phy_address);
611-
612-
/*
613-
* Internal or external PHY with MDIO access
614-
*/
615-
phydev = phy_attach(priv->dev, phy_name, pd->phy_interface);
616-
if (IS_ERR(phydev)) {
617-
dev_err(kdev, "failed to register PHY device\n");
618-
return PTR_ERR(phydev);
619-
}
620-
} else {
621-
/*
622-
* MoCA port or no MDIO access.
623-
* Use fixed PHY to represent the link layer.
624-
*/
625-
struct fixed_phy_status fphy_status = {
626-
.link = 1,
627-
.speed = pd->phy_speed,
628-
.duplex = pd->phy_duplex,
629-
.pause = 0,
630-
.asym_pause = 0,
631-
};
632-
633-
phydev = fixed_phy_register(&fphy_status, NULL);
634-
if (IS_ERR(phydev)) {
635-
dev_err(kdev, "failed to register fixed PHY device\n");
636-
return PTR_ERR(phydev);
637-
}
638-
639-
/* Make sure we initialize MoCA PHYs with a link down */
640-
phydev->link = 0;
641-
642-
}
643-
644-
priv->phy_interface = pd->phy_interface;
645-
646-
return 0;
647-
}
648-
649576
static int bcmgenet_mii_bus_init(struct bcmgenet_priv *priv)
650577
{
651578
struct device *kdev = &priv->pdev->dev;
@@ -656,7 +583,7 @@ static int bcmgenet_mii_bus_init(struct bcmgenet_priv *priv)
656583
else if (has_acpi_companion(kdev))
657584
return bcmgenet_phy_interface_init(priv);
658585
else
659-
return bcmgenet_mii_pd_init(priv);
586+
return -EINVAL;
660587
}
661588

662589
int bcmgenet_mii_init(struct net_device *dev)

include/linux/platform_data/bcmgenet.h

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)