diff options
| author | Rakesh Sankaranarayanan <[email protected]> | 2022-11-07 09:29:20 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2022-11-09 13:06:01 +0000 |
| commit | e06999c3dc62c79fa897eec1293faa3c2bd8892f (patch) | |
| tree | 959e422858f9975ccda124842f558eaca13ba6df /drivers/net/dsa/microchip/lan937x_main.c | |
| parent | net: dsa: microchip: add irq in i2c probe (diff) | |
| download | kernel-e06999c3dc62c79fa897eec1293faa3c2bd8892f.tar.gz kernel-e06999c3dc62c79fa897eec1293faa3c2bd8892f.zip | |
net: dsa: microchip: add error checking for ksz_pwrite
Add status validation for port register write inside
lan937x_change_mtu. ksz_pwrite and ksz_pread api's are
updated with return type int (Reference patch mentioned
below). Update lan937x_change_mtu with status validation
for ksz_pwrite16().
Link: https://patchwork.kernel.org/project/netdevbpf/patch/[email protected]/
Signed-off-by: Rakesh Sankaranarayanan <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'drivers/net/dsa/microchip/lan937x_main.c')
| -rw-r--r-- | drivers/net/dsa/microchip/lan937x_main.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/dsa/microchip/lan937x_main.c b/drivers/net/dsa/microchip/lan937x_main.c index 7e4f307a0387..06d3d0308cba 100644 --- a/drivers/net/dsa/microchip/lan937x_main.c +++ b/drivers/net/dsa/microchip/lan937x_main.c @@ -242,7 +242,11 @@ int lan937x_change_mtu(struct ksz_device *dev, int port, int new_mtu) } /* Write the frame size in PORT_MAX_FR_SIZE register */ - ksz_pwrite16(dev, port, PORT_MAX_FR_SIZE, new_mtu); + ret = ksz_pwrite16(dev, port, PORT_MAX_FR_SIZE, new_mtu); + if (ret) { + dev_err(ds->dev, "failed to update mtu for port %d\n", port); + return ret; + } return 0; } |
