From: Rakesh Sankaranarayanan <rakesh.sankaranarayanan@microchip.com>
To: <linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>
Cc: <woojung.huh@microchip.com>, <UNGLinuxDriver@microchip.com>,
<andrew@lunn.ch>, <vivien.didelot@gmail.com>,
<f.fainelli@gmail.com>, <olteanv@gmail.com>,
<davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
<pabeni@redhat.com>
Subject: [PATCH net-next v2 3/5] net: dsa: microchip: add error checking for ksz_pwrite
Date: Mon, 7 Nov 2022 14:59:20 +0530 [thread overview]
Message-ID: <20221107092922.5926-4-rakesh.sankaranarayanan@microchip.com> (raw)
In-Reply-To: <20221107092922.5926-1-rakesh.sankaranarayanan@microchip.com>
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/20220826105634.3855578-6-o.rempel@pengutronix.de/
Signed-off-by: Rakesh Sankaranarayanan <rakesh.sankaranarayanan@microchip.com>
---
drivers/net/dsa/microchip/lan937x_main.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
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;
}
--
2.34.1
next prev parent reply other threads:[~2022-11-07 3:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-07 9:29 [PATCH net-next v2 0/5] net: dsa: microchip: ksz_pwrite status check for lan937x and irq and error checking updates for ksz series Rakesh Sankaranarayanan
2022-11-07 9:29 ` [PATCH net-next v2 1/5] net: dsa: microchip: add ksz9563 in ksz_switch_ops and select based on compatible string Rakesh Sankaranarayanan
2022-11-07 9:29 ` [PATCH net-next v2 2/5] net: dsa: microchip: add irq in i2c probe Rakesh Sankaranarayanan
2022-11-07 9:29 ` Rakesh Sankaranarayanan [this message]
2022-11-07 9:29 ` [PATCH net-next v2 4/5] net: dsa: microchip: ksz8563: Add number of port irq Rakesh Sankaranarayanan
2022-11-07 9:29 ` [PATCH net-next v2 5/5] net: dsa: microchip: add dev_err_probe in probe functions Rakesh Sankaranarayanan
2022-11-09 13:10 ` [PATCH net-next v2 0/5] net: dsa: microchip: ksz_pwrite status check for lan937x and irq and error checking updates for ksz series patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221107092922.5926-4-rakesh.sankaranarayanan@microchip.com \
--to=rakesh.sankaranarayanan@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=vivien.didelot@gmail.com \
--cc=woojung.huh@microchip.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®