Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: bcmgenet: remove unused platform code

This effectively reverts b0ba512e25d7 ("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 <hkallweit1@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://patch.msgid.link/108b4e64-55d4-4b4e-9a11-3c810c319d66@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Heiner Kallweit and committed by
Jakub Kicinski
378e6523 a8e846b8

+7 -108
-1
MAINTAINERS
··· 5123 5123 F: drivers/net/ethernet/broadcom/genet/ 5124 5124 F: drivers/net/ethernet/broadcom/unimac.h 5125 5125 F: drivers/net/mdio/mdio-bcm-unimac.c 5126 - F: include/linux/platform_data/bcmgenet.h 5127 5126 F: include/linux/platform_data/mdio-bcm-unimac.h 5128 5127 5129 5128 BROADCOM IPROC ARM ARCHITECTURE
+6 -14
drivers/net/ethernet/broadcom/genet/bcmgenet.c
··· 35 35 #include <linux/ip.h> 36 36 #include <linux/ipv6.h> 37 37 #include <linux/phy.h> 38 - #include <linux/platform_data/bcmgenet.h> 39 38 40 39 #include <linux/unaligned.h> 41 40 ··· 3925 3926 3926 3927 static int bcmgenet_probe(struct platform_device *pdev) 3927 3928 { 3928 - struct bcmgenet_platform_data *pd = pdev->dev.platform_data; 3929 3929 const struct bcmgenet_plat_data *pdata; 3930 3930 struct bcmgenet_priv *priv; 3931 3931 struct net_device *dev; ··· 4008 4010 priv->version = pdata->version; 4009 4011 priv->dma_max_burst_length = pdata->dma_max_burst_length; 4010 4012 priv->flags = pdata->flags; 4011 - } else { 4012 - priv->version = pd->genet_version; 4013 - priv->dma_max_burst_length = DMA_MAX_BURST_LENGTH; 4014 4013 } 4015 4014 4016 4015 priv->clk = devm_clk_get_optional(&priv->pdev->dev, "enet"); ··· 4057 4062 if (device_get_phy_mode(&pdev->dev) == PHY_INTERFACE_MODE_INTERNAL) 4058 4063 bcmgenet_power_up(priv, GENET_POWER_PASSIVE); 4059 4064 4060 - if (pd && !IS_ERR_OR_NULL(pd->mac_address)) 4061 - eth_hw_addr_set(dev, pd->mac_address); 4062 - else 4063 - if (device_get_ethdev_address(&pdev->dev, dev)) 4064 - if (has_acpi_companion(&pdev->dev)) { 4065 - u8 addr[ETH_ALEN]; 4065 + if (device_get_ethdev_address(&pdev->dev, dev)) 4066 + if (has_acpi_companion(&pdev->dev)) { 4067 + u8 addr[ETH_ALEN]; 4066 4068 4067 - bcmgenet_get_hw_addr(priv, addr); 4068 - eth_hw_addr_set(dev, addr); 4069 - } 4069 + bcmgenet_get_hw_addr(priv, addr); 4070 + eth_hw_addr_set(dev, addr); 4071 + } 4070 4072 4071 4073 if (!is_valid_ether_addr(dev->dev_addr)) { 4072 4074 dev_warn(&pdev->dev, "using random Ethernet MAC\n");
+1 -74
drivers/net/ethernet/broadcom/genet/bcmmii.c
··· 20 20 #include <linux/of.h> 21 21 #include <linux/of_net.h> 22 22 #include <linux/of_mdio.h> 23 - #include <linux/platform_data/bcmgenet.h> 24 23 #include <linux/platform_data/mdio-bcm-unimac.h> 25 24 26 25 #include "bcmgenet.h" ··· 435 436 return priv->mdio_dn; 436 437 } 437 438 438 - static void bcmgenet_mii_pdata_init(struct bcmgenet_priv *priv, 439 - struct unimac_mdio_pdata *ppd) 440 - { 441 - struct device *kdev = &priv->pdev->dev; 442 - struct bcmgenet_platform_data *pd = kdev->platform_data; 443 - 444 - if (pd->phy_interface != PHY_INTERFACE_MODE_MOCA && pd->mdio_enabled) { 445 - /* 446 - * Internal or external PHY with MDIO access 447 - */ 448 - if (pd->phy_address >= 0 && pd->phy_address < PHY_MAX_ADDR) 449 - ppd->phy_mask = 1 << pd->phy_address; 450 - else 451 - ppd->phy_mask = 0; 452 - } 453 - } 454 - 455 439 static int bcmgenet_mii_wait(void *wait_func_data) 456 440 { 457 441 struct bcmgenet_priv *priv = wait_func_data; ··· 449 467 static int bcmgenet_mii_register(struct bcmgenet_priv *priv) 450 468 { 451 469 struct platform_device *pdev = priv->pdev; 452 - struct bcmgenet_platform_data *pdata = pdev->dev.platform_data; 453 470 struct device_node *dn = pdev->dev.of_node; 454 471 struct unimac_mdio_pdata ppd; 455 472 struct platform_device *ppdev; ··· 492 511 ppdev->dev.parent = &pdev->dev; 493 512 if (dn) 494 513 ppdev->dev.of_node = bcmgenet_mii_of_find_mdio(priv); 495 - else if (pdata) 496 - bcmgenet_mii_pdata_init(priv, &ppd); 497 514 else 498 515 ppd.phy_mask = ~0; 499 516 ··· 573 594 return 0; 574 595 } 575 596 576 - static int bcmgenet_mii_pd_init(struct bcmgenet_priv *priv) 577 - { 578 - struct device *kdev = &priv->pdev->dev; 579 - struct bcmgenet_platform_data *pd = kdev->platform_data; 580 - char phy_name[MII_BUS_ID_SIZE + 3]; 581 - char mdio_bus_id[MII_BUS_ID_SIZE]; 582 - struct phy_device *phydev; 583 - 584 - snprintf(mdio_bus_id, MII_BUS_ID_SIZE, "%s-%d", 585 - UNIMAC_MDIO_DRV_NAME, priv->pdev->id); 586 - 587 - if (pd->phy_interface != PHY_INTERFACE_MODE_MOCA && pd->mdio_enabled) { 588 - snprintf(phy_name, MII_BUS_ID_SIZE, PHY_ID_FMT, 589 - mdio_bus_id, pd->phy_address); 590 - 591 - /* 592 - * Internal or external PHY with MDIO access 593 - */ 594 - phydev = phy_attach(priv->dev, phy_name, pd->phy_interface); 595 - if (IS_ERR(phydev)) { 596 - dev_err(kdev, "failed to register PHY device\n"); 597 - return PTR_ERR(phydev); 598 - } 599 - } else { 600 - /* 601 - * MoCA port or no MDIO access. 602 - * Use fixed PHY to represent the link layer. 603 - */ 604 - struct fixed_phy_status fphy_status = { 605 - .link = 1, 606 - .speed = pd->phy_speed, 607 - .duplex = pd->phy_duplex, 608 - .pause = 0, 609 - .asym_pause = 0, 610 - }; 611 - 612 - phydev = fixed_phy_register(&fphy_status, NULL); 613 - if (IS_ERR(phydev)) { 614 - dev_err(kdev, "failed to register fixed PHY device\n"); 615 - return PTR_ERR(phydev); 616 - } 617 - 618 - /* Make sure we initialize MoCA PHYs with a link down */ 619 - phydev->link = 0; 620 - 621 - } 622 - 623 - priv->phy_interface = pd->phy_interface; 624 - 625 - return 0; 626 - } 627 - 628 597 static int bcmgenet_mii_bus_init(struct bcmgenet_priv *priv) 629 598 { 630 599 struct device *kdev = &priv->pdev->dev; ··· 583 656 else if (has_acpi_companion(kdev)) 584 657 return bcmgenet_phy_interface_init(priv); 585 658 else 586 - return bcmgenet_mii_pd_init(priv); 659 + return -EINVAL; 587 660 } 588 661 589 662 int bcmgenet_mii_init(struct net_device *dev)
-19
include/linux/platform_data/bcmgenet.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 2 - #ifndef __LINUX_PLATFORM_DATA_BCMGENET_H__ 3 - #define __LINUX_PLATFORM_DATA_BCMGENET_H__ 4 - 5 - #include <linux/types.h> 6 - #include <linux/if_ether.h> 7 - #include <linux/phy.h> 8 - 9 - struct bcmgenet_platform_data { 10 - bool mdio_enabled; 11 - phy_interface_t phy_interface; 12 - int phy_address; 13 - int phy_speed; 14 - int phy_duplex; 15 - u8 mac_address[ETH_ALEN]; 16 - int genet_version; 17 - }; 18 - 19 - #endif