mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-28 03:40:04 +00:00
net: dsa: microchip: Fix ksz_read64()
[ Upstream commitc34f674c88
] ksz_read64() currently does some dubious byte-swapping on the two halves of a 64-bit register, and then only returns the high bits. Replace this with a straightforward expression. Fixes:e66f840c08
("net: dsa: ksz: Add Microchip KSZ8795 DSA driver") Signed-off-by: Ben Hutchings <ben.hutchings@mind.be> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
991117eeee
commit
13a381b8bc
1 changed files with 2 additions and 6 deletions
|
@ -215,12 +215,8 @@ static inline int ksz_read64(struct ksz_device *dev, u32 reg, u64 *val)
|
|||
int ret;
|
||||
|
||||
ret = regmap_bulk_read(dev->regmap[2], reg, value, 2);
|
||||
if (!ret) {
|
||||
/* Ick! ToDo: Add 64bit R/W to regmap on 32bit systems */
|
||||
value[0] = swab32(value[0]);
|
||||
value[1] = swab32(value[1]);
|
||||
*val = swab64((u64)*value);
|
||||
}
|
||||
if (!ret)
|
||||
*val = (u64)value[0] << 32 | value[1];
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue