There is some code repetition in patches 7, 8, and 9. I am thinking about perhaps creating a helper function generic_phy_begin() which would call generic_phy_init() generic_phy_set_mode() generic_phy_power_on() and generic_phy_end() generic_phy_power_off() generic_phy_exit()