summaryrefslogtreecommitdiff
path: root/target/linux/ramips
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/ramips')
-rw-r--r--target/linux/ramips/files/drivers/net/ethernet/ramips/ramips_esw.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ramips/ramips_esw.c b/target/linux/ramips/files/drivers/net/ethernet/ramips/ramips_esw.c
index f01baa1709..798eb749bb 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ramips/ramips_esw.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ramips/ramips_esw.c
@@ -750,11 +750,13 @@ rt305x_esw_get_port_recv_badgood(struct switch_dev *dev,
struct rt305x_esw *esw = container_of(dev, struct rt305x_esw, swdev);
int idx = val->port_vlan;
int shift = attr->id == RT305X_ESW_ATTR_PORT_RECV_GOOD ? 0 : 16;
+ u32 reg;
if (idx < 0 || idx >= RT305X_ESW_NUM_LANWAN)
return -EINVAL;
- val->value.i = rt305x_esw_rr(esw, RT305X_ESW_REG_P0PC + 4*idx) >> shift;
+ reg = rt305x_esw_rr(esw, RT305X_ESW_REG_P0PC + 4*idx);
+ val->value.i = (reg >> shift) & 0xffff;
return 0;
}