RE: [PATCH net-next v3 06/12] net: ethernet: oa_tc6: implement internal PHY initialization

From: Selvamani Rajagopal
Date: Thu Mar 21 2024 - 15:28:00 EST



> +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;
> +