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

Commit eda40b8c authored by Heiner Kallweit's avatar Heiner Kallweit Committed by David S. Miller
Browse files

r8169: drop rtl_generic_op



Only two places are left where rtl_generic_op() is used, so we can
inline it and simplify the code a little.
This change also avoids the overhead of unlocking/locking in case
the respective operation isn't set.

Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b2d43e6e
Loading
Loading
Loading
Loading
+10 −13
Original line number Diff line number Diff line
@@ -4764,13 +4764,6 @@ static void r8168_pll_power_up(struct rtl8169_private *tp)
	r8168_phy_power_up(tp);
}

static void rtl_generic_op(struct rtl8169_private *tp,
			   void (*op)(struct rtl8169_private *))
{
	if (op)
		op(tp);
}

static void rtl_pll_power_down(struct rtl8169_private *tp)
{
	switch (tp->mac_version) {
@@ -4821,17 +4814,21 @@ static void rtl8169_init_ring_indexes(struct rtl8169_private *tp)

static void rtl_hw_jumbo_enable(struct rtl8169_private *tp)
{
	if (tp->jumbo_ops.enable) {
		RTL_W8(tp, Cfg9346, Cfg9346_Unlock);
	rtl_generic_op(tp, tp->jumbo_ops.enable);
		tp->jumbo_ops.enable(tp);
		RTL_W8(tp, Cfg9346, Cfg9346_Lock);
	}
}

static void rtl_hw_jumbo_disable(struct rtl8169_private *tp)
{
	if (tp->jumbo_ops.disable) {
		RTL_W8(tp, Cfg9346, Cfg9346_Unlock);
	rtl_generic_op(tp, tp->jumbo_ops.disable);
		tp->jumbo_ops.disable(tp);
		RTL_W8(tp, Cfg9346, Cfg9346_Lock);
	}
}

static void r8168c_hw_jumbo_enable(struct rtl8169_private *tp)
{