lynx = kzalloc(sizeof(*lynx), GFP_KERNEL);
if (!lynx)
- return NULL;
+ return ERR_PTR(-ENOMEM);
mdio_device_get(mdio);
lynx->mdio = mdio;
pcs = lynx_pcs_create(mdio);
- /* Convert failure to create the PCS to an error pointer, so this
- * function has a consistent return value strategy.
- */
- if (!pcs)
- pcs = ERR_PTR(-ENOMEM);
-
/* lynx_create() has taken a refcount on the mdiodev if it was
* successful. If lynx_create() fails, this will free the mdio
* device here. In any case, we don't need to hold our reference
pcs = lynx_pcs_create(mdio);
- /* Convert failure to create the PCS to an error pointer, so this
- * function has a consistent return value strategy.
- */
- if (!pcs)
- pcs = ERR_PTR(-ENOMEM);
-
/* lynx_create() has taken a refcount on the mdiodev if it was
* successful. If lynx_create() fails, this will free the mdio
* device here. In any case, we don't need to hold our reference