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-
456438static 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)
467449static 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-
649576static 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
662589int bcmgenet_mii_init (struct net_device * dev )
0 commit comments