summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSu Hui <suhui@nfschina.com>2023-10-20 12:00:04 +0300
committerDavid S. Miller <davem@davemloft.net>2023-10-21 13:50:45 +0300
commita792197f50705a5855b592fde3312e1e373862e5 (patch)
tree6f0ca22d1ec56bc2ca0f48e5931af42dacd4a343 /drivers
parentee3d12285471f17239af467eab11f9cb08c18dc4 (diff)
downloadlinux-a792197f50705a5855b592fde3312e1e373862e5.tar.xz
net: dsa: mv88e6xxx: add an error code check in mv88e6352_tai_event_work
mv88e6xxx_tai_write() can return error code (-EOPNOTSUPP ...) if failed. So check the value of 'ret' after calling mv88e6xxx_tai_write(). Signed-off-by: Su Hui <suhui@nfschina.com> Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/dsa/mv88e6xxx/ptp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/dsa/mv88e6xxx/ptp.c b/drivers/net/dsa/mv88e6xxx/ptp.c
index ea17231dc34e..56391e09b325 100644
--- a/drivers/net/dsa/mv88e6xxx/ptp.c
+++ b/drivers/net/dsa/mv88e6xxx/ptp.c
@@ -182,6 +182,10 @@ static void mv88e6352_tai_event_work(struct work_struct *ugly)
mv88e6xxx_reg_lock(chip);
err = mv88e6xxx_tai_write(chip, MV88E6XXX_TAI_EVENT_STATUS, status[0]);
mv88e6xxx_reg_unlock(chip);
+ if (err) {
+ dev_err(chip->dev, "failed to write TAI status register\n");
+ return;
+ }
/* This is an external timestamp */
ev.type = PTP_CLOCK_EXTTS;