net: dsa: b53: Fixup endianness warnings

leX_to_cpu() expects to be passed an __leX type.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Andrew Lunn 2020-07-05 22:36:23 +02:00 committed by David S. Miller
parent 6c67b03b85
commit 8caefe7e41
1 changed files with 18 additions and 8 deletions

View File

@ -145,42 +145,52 @@ static int b53_spi_read8(struct b53_device *dev, u8 page, u8 reg, u8 *val)
static int b53_spi_read16(struct b53_device *dev, u8 page, u8 reg, u16 *val)
{
int ret = b53_spi_read(dev, page, reg, (u8 *)val, 2);
__le16 value;
int ret;
ret = b53_spi_read(dev, page, reg, (u8 *)&value, 2);
if (!ret)
*val = le16_to_cpu(*val);
*val = le16_to_cpu(value);
return ret;
}
static int b53_spi_read32(struct b53_device *dev, u8 page, u8 reg, u32 *val)
{
int ret = b53_spi_read(dev, page, reg, (u8 *)val, 4);
__le32 value;
int ret;
ret = b53_spi_read(dev, page, reg, (u8 *)&value, 4);
if (!ret)
*val = le32_to_cpu(*val);
*val = le32_to_cpu(value);
return ret;
}
static int b53_spi_read48(struct b53_device *dev, u8 page, u8 reg, u64 *val)
{
__le64 value;
int ret;
*val = 0;
ret = b53_spi_read(dev, page, reg, (u8 *)val, 6);
ret = b53_spi_read(dev, page, reg, (u8 *)&value, 6);
if (!ret)
*val = le64_to_cpu(*val);
*val = le64_to_cpu(value);
return ret;
}
static int b53_spi_read64(struct b53_device *dev, u8 page, u8 reg, u64 *val)
{
int ret = b53_spi_read(dev, page, reg, (u8 *)val, 8);
__le64 value;
int ret;
ret = b53_spi_read(dev, page, reg, (u8 *)&value, 8);
if (!ret)
*val = le64_to_cpu(*val);
*val = le64_to_cpu(value);
return ret;
}