Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 50789845 authored by Lendacky, Thomas's avatar Lendacky, Thomas Committed by David S. Miller
Browse files

amd-xgbe: Remove the XGBE_LINK state bit



The XGBE_LINK bit is used just to determine whether to call the
netif_carrier_on/off functions. Rather than define and use this bit,
just call the functions. The netif_carrier_ok function can be used in
place of checking the XGBE_LINK bit in the future.

Signed-off-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent afb43e8a
Loading
Loading
Loading
Loading
+4 −12
Original line number Diff line number Diff line
@@ -1115,7 +1115,6 @@ static void xgbe_phy_status(struct xgbe_prv_data *pdata)
	unsigned int reg, link_aneg;

	if (test_bit(XGBE_LINK_ERR, &pdata->dev_state)) {
		if (test_and_clear_bit(XGBE_LINK, &pdata->dev_state))
		netif_carrier_off(pdata->netdev);

		pdata->phy.link = 0;
@@ -1142,10 +1141,7 @@ static void xgbe_phy_status(struct xgbe_prv_data *pdata)
		if (test_bit(XGBE_LINK_INIT, &pdata->dev_state))
			clear_bit(XGBE_LINK_INIT, &pdata->dev_state);

		if (!test_bit(XGBE_LINK, &pdata->dev_state)) {
			set_bit(XGBE_LINK, &pdata->dev_state);
		netif_carrier_on(pdata->netdev);
		}
	} else {
		if (test_bit(XGBE_LINK_INIT, &pdata->dev_state)) {
			xgbe_check_link_timeout(pdata);
@@ -1156,11 +1152,8 @@ static void xgbe_phy_status(struct xgbe_prv_data *pdata)

		xgbe_phy_status_aneg(pdata);

		if (test_bit(XGBE_LINK, &pdata->dev_state)) {
			clear_bit(XGBE_LINK, &pdata->dev_state);
		netif_carrier_off(pdata->netdev);
	}
	}

adjust_link:
	xgbe_phy_adjust_link(pdata);
@@ -1179,7 +1172,6 @@ static void xgbe_phy_stop(struct xgbe_prv_data *pdata)
	devm_free_irq(pdata->dev, pdata->an_irq, pdata);

	pdata->phy.link = 0;
	if (test_and_clear_bit(XGBE_LINK, &pdata->dev_state))
	netif_carrier_off(pdata->netdev);

	xgbe_phy_adjust_link(pdata);
+0 −1
Original line number Diff line number Diff line
@@ -459,7 +459,6 @@ struct xgbe_channel {

enum xgbe_state {
	XGBE_DOWN,
	XGBE_LINK,
	XGBE_LINK_INIT,
	XGBE_LINK_ERR,
};