Re: [PATCH net-next v8 4/4] net: dsa: add basic initial driver for MxL862xx switches

From: Andrew Lunn

Date: Tue Jan 27 2026 - 10:18:23 EST


> > int mxl862xx_to_zephyr_errno(u16 reg)
> so that would then just be
> return (s16)reg;
> right?

Yes.

>
> Or did you think to include the handling of the error __mdiodev_c45_read()
> would return, ie.
> int mxl862xx_to_zephyr_errno(int reg)
> {
> if (reg < 0)
> return reg;

No, that mixes up real linux error codes and Zephyr OS error codes.

If the MDIO operation fails, you have a real error code you can
return. If the firmware fails, you will want to netdev_err() the
Zephyr error code to aid debug, and then return -EIO.

> Or actually translating the actual errno to a Linux error code?

Is it worth the effort? How many times have you seen the firmware
fail? During debugging, it might be useful, but in production?

Andrew