ipq40xx: ar40xx: use FIELD_GET macro
This improves code readability. Signed-off-by: David Bauer <mail@david-bauer.net>
This commit is contained in:
parent
b9162a9c85
commit
685c790e9f
@ -13,6 +13,7 @@
|
|||||||
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <linux/bitfield.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/list.h>
|
#include <linux/list.h>
|
||||||
#include <linux/bitops.h>
|
#include <linux/bitops.h>
|
||||||
@ -1336,13 +1337,13 @@ ar40xx_sw_mac_polling_task(struct ar40xx_priv *priv)
|
|||||||
for (i = 1; i < AR40XX_NUM_PORTS; ++i) {
|
for (i = 1; i < AR40XX_NUM_PORTS; ++i) {
|
||||||
port_phy_status[i] =
|
port_phy_status[i] =
|
||||||
mdiobus_read(bus, i-1, AR40XX_PHY_SPEC_STATUS);
|
mdiobus_read(bus, i-1, AR40XX_PHY_SPEC_STATUS);
|
||||||
speed = link = duplex = port_phy_status[i];
|
|
||||||
speed &= AR40XX_PHY_SPEC_STATUS_SPEED;
|
speed = FIELD_GET(AR40XX_PHY_SPEC_STATUS_SPEED,
|
||||||
speed >>= 14;
|
port_phy_status[i]);
|
||||||
link &= AR40XX_PHY_SPEC_STATUS_LINK;
|
link = FIELD_GET(AR40XX_PHY_SPEC_STATUS_LINK,
|
||||||
link >>= 10;
|
port_phy_status[i]);
|
||||||
duplex &= AR40XX_PHY_SPEC_STATUS_DUPLEX;
|
duplex = FIELD_GET(AR40XX_PHY_SPEC_STATUS_DUPLEX,
|
||||||
duplex >>= 13;
|
port_phy_status[i]);
|
||||||
|
|
||||||
if (link != priv->ar40xx_port_old_link[i]) {
|
if (link != priv->ar40xx_port_old_link[i]) {
|
||||||
++link_cnt[i];
|
++link_cnt[i];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user