lkml.org 
[lkml]   [2022]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH net-next v1 04/10] net: dsa: microchip: ksz9477: add error handling to ksz9477_r/w_phy
On Fri, Jul 29, 2022 at 03:03:40PM +0200, Oleksij Rempel wrote:
> } else {
> - ksz_pread16(dev, addr, 0x100 + (reg << 1), &val);
> + ret = ksz_pread16(dev, addr, 0x100 + (reg << 1), &val);
> + if (ret)
> + return ret;
> +
> ksz9477_r_phy_quirks(dev, addr, reg, &val);
> }
>
> @@ -340,11 +344,9 @@ int ksz9477_w_phy(struct ksz_device *dev, u16 addr, u16 reg, u16 val)
>
> /* No gigabit support. Do not write to this register. */
> if (!(dev->features & GBIT_SUPPORT) && reg == MII_CTRL1000)
> - return 0;
> + return -ENOTSUPP;

I wonder if ENOTSUPP is the most appropriate error code, given that I
see it defined under a comment "Defined for the NFSv3 protocol".
How about -ENXIO?

>
> - ksz_pwrite16(dev, addr, 0x100 + (reg << 1), val);
> -
> - return 0;
> + return ksz_pwrite16(dev, addr, 0x100 + (reg << 1), val);
> }
>
> void ksz9477_cfg_port_member(struct ksz_device *dev, int port, u8 member)
> --
> 2.30.2
>

\
 
 \ /
  Last update: 2022-08-02 13:25    [W:0.154 / U:0.792 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site