]> Pileus Git - ~andy/linux/commitdiff
sfc: Merge efx_fc_resolve() into efx_mdio_get_pause()
authorBen Hutchings <bhutchings@solarflare.com>
Fri, 23 Oct 2009 08:33:17 +0000 (08:33 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 24 Oct 2009 11:27:25 +0000 (04:27 -0700)
efx_fc_resolve() is specific to MDIO and is not used by any other
function.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/sfc/mdio_10g.c
drivers/net/sfc/net_driver.h

index b355872de6c20723b43a76a28af077a1163f3143..25fb20adf4b7c6cf58d7e44e409649d5c986640a 100644 (file)
@@ -341,10 +341,14 @@ int efx_mdio_set_settings(struct efx_nic *efx, struct ethtool_cmd *ecmd)
 
 enum efx_fc_type efx_mdio_get_pause(struct efx_nic *efx)
 {
-       int lpa;
+       BUILD_BUG_ON(EFX_FC_AUTO & (EFX_FC_RX | EFX_FC_TX));
 
-       if (!(efx->phy_op->mmds & MDIO_DEVS_AN))
+       if (!(efx->wanted_fc & EFX_FC_AUTO))
                return efx->wanted_fc;
-       lpa = efx_mdio_read(efx, MDIO_MMD_AN, MDIO_AN_LPA);
-       return efx_fc_resolve(efx->wanted_fc, lpa);
+
+       WARN_ON(!(efx->mdio.mmds & MDIO_DEVS_AN));
+
+       return mii_resolve_flowctrl_fdx(
+               mii_advertise_flowctrl(efx->wanted_fc),
+               efx_mdio_read(efx, MDIO_MMD_AN, MDIO_AN_LPA));
 }
index 13bc1b496da88120fea7537547f1f1c2155ee2ae..bb3d258bd5e8be18dc13d88b03759f0d6eb423a0 100644 (file)
@@ -497,17 +497,6 @@ enum efx_mac_type {
        EFX_XMAC = 2,
 };
 
-static inline enum efx_fc_type efx_fc_resolve(enum efx_fc_type wanted_fc,
-                                             unsigned int lpa)
-{
-       BUILD_BUG_ON(EFX_FC_AUTO & (EFX_FC_RX | EFX_FC_TX));
-
-       if (!(wanted_fc & EFX_FC_AUTO))
-               return wanted_fc;
-
-       return mii_resolve_flowctrl_fdx(mii_advertise_flowctrl(wanted_fc), lpa);
-}
-
 /**
  * struct efx_mac_operations - Efx MAC operations table
  * @reconfigure: Reconfigure MAC. Serialised by the mac_lock