lkml.org 
[lkml]   [2024]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH net-next v3 06/12] net: ethernet: oa_tc6: implement internal PHY initialization
Date

> +static int oa_tc6_mdiobus_register(struct oa_tc6 *tc6) {
> + int ret;
> +
> + tc6->mdiobus = mdiobus_alloc();
> + if (!tc6->mdiobus) {
> + netdev_err(tc6->netdev, "MDIO bus alloc failed\n");
> + return -ENODEV;
> + }

Shouldn't it be appropriate to return -ENOMEM here?

> +
> + tc6->mdiobus->priv = tc6;
> + tc6->mdiobus->read = oa_tc6_mdiobus_direct_read;
> + tc6->mdiobus->write = oa_tc6_mdiobus_direct_write;
> + tc6->mdiobus->name = "oa-tc6-mdiobus";
> + tc6->mdiobus->parent = tc6->dev;
> +

\
 
 \ /
  Last update: 2024-05-27 15:58    [W:0.350 / U:23.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site