Re: [PATCH] staging: most: dim2: use dev_err_probe() for clock errors in rcar enable functions

From: Dan Carpenter

Date: Tue Jun 23 2026 - 14:35:58 EST


On Tue, Jun 23, 2026 at 10:41:56AM -0700, Batu Ada Tutkun wrote:
> Yes, this was drafted with AI assistance. Thank you for pointing it out.
>
> You are right that the error code was not broken here. rcar_gen2 and gen3 already return PTR_ERR(dev->clk), so unlike the fsl_mx6 case there is no -EFAULT bug to fix. This is just a consistency cleanup, plus devm_clk_get() can return -EPROBE_DEFER when the clock provider has not registered yet so dev_err_probe() suppresses the misleading "cannot get clock" message during a normal deferred probe.

I checked this and sure enough, clk_get() returns -EPROBE_DEFER. Please
specifically mention clk_get() in the commit message in case someone wants
to check the code...

Useless: grep "when the clock provider has not registered yet"
Useful: vim -t clk_get

>
> clk_prepare_enable() can't return -EPROBE_DEFER. By the time it is called the clock handle is already acquired and deferral only happens at acquisition. Because of that I deliberately left that path as dev_err().
>
> Compile tested only. I do not have R-Car hardware.

This is good information and it needs to be in the commit message under
the --- cut off line. Obviously, I know that changing dev_err() to
dev_err_probe() does not cause a problem, but I also want to know if this
is something which is already affecting users in real life or if it's
just a correctness thing.

So the patch is fine, but the commit message needs to be re-written.

regards,
dan carpenter