aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/renesas/ravb_main.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2016-12-03 11:46:54 -0500
committerDavid S. Miller <davem@davemloft.net>2016-12-03 12:29:53 -0500
commit2745529ac7358fdac72e6b388da2e934bd9da82c (patch)
tree245bb05b1a18189c5a5212db914c70a636d8267a /drivers/net/ethernet/renesas/ravb_main.c
parentab17cb1fea82b346bdecd4f2d7f0e84e80f847af (diff)
parent8dc0f265d39a3933f4c1f846c7c694f12a2ab88a (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Couple conflicts resolved here: 1) In the MACB driver, a bug fix to properly initialize the RX tail pointer properly overlapped with some changes to support variable sized rings. 2) In XGBE we had a "CONFIG_PM" --> "CONFIG_PM_SLEEP" fix overlapping with a reorganization of the driver to support ACPI, OF, as well as PCI variants of the chip. 3) In 'net' we had several probe error path bug fixes to the stmmac driver, meanwhile a lot of this code was cleaned up and reorganized in 'net-next'. 4) The cls_flower classifier obtained a helper function in 'net-next' called __fl_delete() and this overlapped with Daniel Borkamann's bug fix to use RCU for object destruction in 'net'. It also overlapped with Jiri's change to guard the rhashtable_remove_fast() call with a check against tc_skip_sw(). 5) In mlx4, a revert bug fix in 'net' overlapped with some unrelated changes in 'net-next'. 6) In geneve, a stale header pointer after pskb_expand_head() bug fix in 'net' overlapped with a large reorganization of the same code in 'net-next'. Since the 'net-next' code no longer had the bug in question, there was nothing to do other than to simply take the 'net-next' hunks. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/renesas/ravb_main.c')
-rw-r--r--drivers/net/ethernet/renesas/ravb_main.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
index 27cfec3154c8..92d7692c840d 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
@@ -1008,20 +1008,18 @@ static int ravb_phy_init(struct net_device *ndev)
1008 of_node_put(pn); 1008 of_node_put(pn);
1009 if (!phydev) { 1009 if (!phydev) {
1010 netdev_err(ndev, "failed to connect PHY\n"); 1010 netdev_err(ndev, "failed to connect PHY\n");
1011 return -ENOENT; 1011 err = -ENOENT;
1012 goto err_deregister_fixed_link;
1012 } 1013 }
1013 1014
1014 /* This driver only support 10/100Mbit speeds on Gen3 1015 /* This driver only support 10/100Mbit speeds on Gen3
1015 * at this time. 1016 * at this time.
1016 */ 1017 */
1017 if (priv->chip_id == RCAR_GEN3) { 1018 if (priv->chip_id == RCAR_GEN3) {
1018 int err;
1019
1020 err = phy_set_max_speed(phydev, SPEED_100); 1019 err = phy_set_max_speed(phydev, SPEED_100);
1021 if (err) { 1020 if (err) {
1022 netdev_err(ndev, "failed to limit PHY to 100Mbit/s\n"); 1021 netdev_err(ndev, "failed to limit PHY to 100Mbit/s\n");
1023 phy_disconnect(phydev); 1022 goto err_phy_disconnect;
1024 return err;
1025 } 1023 }
1026 1024
1027 netdev_info(ndev, "limited PHY to 100Mbit/s\n"); 1025 netdev_info(ndev, "limited PHY to 100Mbit/s\n");
@@ -1033,6 +1031,14 @@ static int ravb_phy_init(struct net_device *ndev)
1033 phy_attached_info(phydev); 1031 phy_attached_info(phydev);
1034 1032
1035 return 0; 1033 return 0;
1034
1035err_phy_disconnect:
1036 phy_disconnect(phydev);
1037err_deregister_fixed_link:
1038 if (of_phy_is_fixed_link(np))
1039 of_phy_deregister_fixed_link(np);
1040
1041 return err;
1036} 1042}
1037 1043
1038/* PHY control start function */ 1044/* PHY control start function */
@@ -1634,6 +1640,7 @@ static void ravb_set_rx_mode(struct net_device *ndev)
1634/* Device close function for Ethernet AVB */ 1640/* Device close function for Ethernet AVB */
1635static int ravb_close(struct net_device *ndev) 1641static int ravb_close(struct net_device *ndev)
1636{ 1642{
1643 struct device_node *np = ndev->dev.parent->of_node;
1637 struct ravb_private *priv = netdev_priv(ndev); 1644 struct ravb_private *priv = netdev_priv(ndev);
1638 struct ravb_tstamp_skb *ts_skb, *ts_skb2; 1645 struct ravb_tstamp_skb *ts_skb, *ts_skb2;
1639 1646
@@ -1663,6 +1670,8 @@ static int ravb_close(struct net_device *ndev)
1663 if (ndev->phydev) { 1670 if (ndev->phydev) {
1664 phy_stop(ndev->phydev); 1671 phy_stop(ndev->phydev);
1665 phy_disconnect(ndev->phydev); 1672 phy_disconnect(ndev->phydev);
1673 if (of_phy_is_fixed_link(np))
1674 of_phy_deregister_fixed_link(np);
1666 } 1675 }
1667 1676
1668 if (priv->chip_id != RCAR_GEN2) { 1677 if (priv->chip_id != RCAR_GEN2) {