Commit d38bc3b4 authored by Oleksij Rempel's avatar Oleksij Rempel Committed by David S. Miller

net: dsa: microchip: forward error value on all ksz_pread/ksz_pwrite functions

ksz_read*/ksz_write* are able to return errors, so forward it.
Signed-off-by: default avatarOleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: default avatarVladimir Oltean <olteanv@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8f420456
...@@ -394,40 +394,42 @@ static inline int ksz_write64(struct ksz_device *dev, u32 reg, u64 value) ...@@ -394,40 +394,42 @@ static inline int ksz_write64(struct ksz_device *dev, u32 reg, u64 value)
return regmap_bulk_write(dev->regmap[2], reg, val, 2); return regmap_bulk_write(dev->regmap[2], reg, val, 2);
} }
static inline void ksz_pread8(struct ksz_device *dev, int port, int offset, static inline int ksz_pread8(struct ksz_device *dev, int port, int offset,
u8 *data) u8 *data)
{ {
ksz_read8(dev, dev->dev_ops->get_port_addr(port, offset), data); return ksz_read8(dev, dev->dev_ops->get_port_addr(port, offset), data);
} }
static inline void ksz_pread16(struct ksz_device *dev, int port, int offset, static inline int ksz_pread16(struct ksz_device *dev, int port, int offset,
u16 *data) u16 *data)
{ {
ksz_read16(dev, dev->dev_ops->get_port_addr(port, offset), data); return ksz_read16(dev, dev->dev_ops->get_port_addr(port, offset), data);
} }
static inline void ksz_pread32(struct ksz_device *dev, int port, int offset, static inline int ksz_pread32(struct ksz_device *dev, int port, int offset,
u32 *data) u32 *data)
{ {
ksz_read32(dev, dev->dev_ops->get_port_addr(port, offset), data); return ksz_read32(dev, dev->dev_ops->get_port_addr(port, offset), data);
} }
static inline void ksz_pwrite8(struct ksz_device *dev, int port, int offset, static inline int ksz_pwrite8(struct ksz_device *dev, int port, int offset,
u8 data) u8 data)
{ {
ksz_write8(dev, dev->dev_ops->get_port_addr(port, offset), data); return ksz_write8(dev, dev->dev_ops->get_port_addr(port, offset), data);
} }
static inline void ksz_pwrite16(struct ksz_device *dev, int port, int offset, static inline int ksz_pwrite16(struct ksz_device *dev, int port, int offset,
u16 data) u16 data)
{ {
ksz_write16(dev, dev->dev_ops->get_port_addr(port, offset), data); return ksz_write16(dev, dev->dev_ops->get_port_addr(port, offset),
data);
} }
static inline void ksz_pwrite32(struct ksz_device *dev, int port, int offset, static inline int ksz_pwrite32(struct ksz_device *dev, int port, int offset,
u32 data) u32 data)
{ {
ksz_write32(dev, dev->dev_ops->get_port_addr(port, offset), data); return ksz_write32(dev, dev->dev_ops->get_port_addr(port, offset),
data);
} }
static inline void ksz_prmw8(struct ksz_device *dev, int port, int offset, static inline void ksz_prmw8(struct ksz_device *dev, int port, int offset,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment