Re: [PATCH v3 07/18] phy: ti: phy-j721e-wiz: use dev_err_probe() instead of dev_err()

Andy Shevchenko
2024-02-15T15:33:42Z

On Thu, Feb 15, 2024 at 04:17:52PM +0100, Thomas Richard wrote:
> Use dev_err_probe() instead of dev_err() in wiz_clock_init() to simplify
> the code and standardize the error output.

...

> ret = wiz_clock_register(wiz);
> if (ret)
> - dev_err(dev, "Failed to register wiz clocks\n");
> + dev_err_probe(dev, ret, "Failed to register wiz clocks\n");
> return ret;

Maybe

if (ret)
return dev_err_probe(dev, ret, "Failed to register wiz clocks\n");

return 0;

?

...

> if (!clk_node) {
> - dev_err(dev, "Unable to get %s node\n", node_name);
> ret = -EINVAL;
> + dev_err_probe(dev, ret, "Unable to get %s node\n", node_name);
> goto err;

ret = dev_err_probe(..., -EINVAL, ...);

> }

--
With Best Regards,
Andy Shevchenko