From: Claudiu Manoil Date: Wed, 30 Apr 2014 11:27:21 +0000 (+0300) Subject: gianfar: Avoid unnecessary reg accesses in adjust_link() X-Git-Tag: omap-for-v3.16/fixes-against-rc1~214^2~16 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ce29b0e2a04ea85617cd21099af67449a76f589;p=pandora-kernel.git gianfar: Avoid unnecessary reg accesses in adjust_link() For phy devices that don't issue interrupts upon link state changes, phylib polls the link state resulting in repeated calls to adjust_link(), even if the link state didn't change. As a result, some mac registers are repeatedly read and written with the same values, which is not ok. To fix this, adjust_link() has been refactored to check first whether the link state has changed and to take action only if needed, updating mac registers and local state variables. The 'new_state' local flag, set if one of the link params changed (link, speed or duplex), has been rendered useless and removed by this refactoring. Signed-off-by: Claudiu Manoil Signed-off-by: David S. Miller --- Reading git-diff-tree failed