Messages in this thread | | | Date | Thu, 22 Aug 2019 11:52:43 -0700 (PDT) | Subject | Re: [PATCH net-next] r8152: saving the settings of EEE | From | David Miller <> |
| |
From: Hayes Wang <hayeswang@realtek.com> Date: Thu, 22 Aug 2019 16:07:18 +0800
> + if (tp->eee_en) { > + r8152_eee_en(tp, true); > + r8152_mmd_write(tp, MDIO_MMD_AN, MDIO_AN_EEE_ADV, tp->eee_adv); > + } else { > + r8152_eee_en(tp, false); > + r8152_mmd_write(tp, MDIO_MMD_AN, MDIO_AN_EEE_ADV, 0); > + }
I see this same exact code sequence at least 4 times in your patch, please make a helper function.
| |