aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/dsa
diff options
context:
space:
mode:
authorVivien Didelot <vivien.didelot@gmail.com>2019-08-09 18:47:58 -0400
committerDavid S. Miller <davem@davemloft.net>2019-08-11 21:27:15 -0700
commit1c6463b6fc36f2261df1a68ee13a5ebd980914b1 (patch)
tree5c87b0cde12fa6a5989dfad735ac29f7226618ad /drivers/net/dsa
parentnet: dsa: mv88e6xxx: remove wait and update routines (diff)
downloadlinux-dev-1c6463b6fc36f2261df1a68ee13a5ebd980914b1.tar.xz
linux-dev-1c6463b6fc36f2261df1a68ee13a5ebd980914b1.zip
net: dsa: mv88e6xxx: fix SMI bit checking
The current mv88e6xxx_smi_direct_wait function is only used to check the 16th bit of the (16-bit) SMI Command register. But the bit shift operation is not enough if we eventually use this function to check other bits, thus replace it with a mask. Fixes: e7ba0fad9c53 ("net: dsa: mv88e6xxx: refine SMI support") Signed-off-by: Vivien Didelot <vivien.didelot@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa')
-rw-r--r--drivers/net/dsa/mv88e6xxx/smi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/dsa/mv88e6xxx/smi.c b/drivers/net/dsa/mv88e6xxx/smi.c
index 5fc78a063843..18e87a5a20a3 100644
--- a/drivers/net/dsa/mv88e6xxx/smi.c
+++ b/drivers/net/dsa/mv88e6xxx/smi.c
@@ -64,7 +64,7 @@ static int mv88e6xxx_smi_direct_wait(struct mv88e6xxx_chip *chip,
if (err)
return err;
- if (!!(data >> bit) == !!val)
+ if (!!(data & BIT(bit)) == !!val)
return 0;
}