[PATCH RFC] clk: versaclock7: propagate all xin lookup failures

Slavin Liu posted 1 patch 2 weeks ago
drivers/clk/clk-versaclock7.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH RFC] clk: versaclock7: propagate all xin lookup failures
Posted by Slavin Liu 2 weeks ago
The xin clock is used to obtain the APLL reference rate. Handle all
lookup errors, not only probe deferral, before clk_get_rate() can see
an error pointer.

Detected by static analysis and reviewed with AI-assisted source auditing.

Fixes: 48c5e98fedd9 ("clk: Renesas versaclock7 ccf device driver")
Assisted-by: LLM
Signed-off-by: Slavin Liu <bolin.liu@seu.edu.cn>
---
 drivers/clk/clk-versaclock7.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/clk-versaclock7.c b/drivers/clk/clk-versaclock7.c
index 1340d2f512be..5f32d3fb807a 100644
--- a/drivers/clk/clk-versaclock7.c
+++ b/drivers/clk/clk-versaclock7.c
@@ -1117,8 +1117,8 @@ static int vc7_probe(struct i2c_client *client)
 	vc7->chip_info = i2c_get_match_data(client);
 
 	vc7->pin_xin = devm_clk_get(&client->dev, "xin");
-	if (PTR_ERR(vc7->pin_xin) == -EPROBE_DEFER) {
-		return dev_err_probe(&client->dev, -EPROBE_DEFER,
+	if (IS_ERR(vc7->pin_xin)) {
+		return dev_err_probe(&client->dev, PTR_ERR(vc7->pin_xin),
 				     "xin not specified\n");
 	}
Re: [PATCH RFC] clk: versaclock7: propagate all xin lookup failures
Posted by Brian Masney 6 days, 15 hours ago
Hi Slavin,

On Fri, Sep 11, 2026 at 02:09:18PM +0800, Slavin Liu wrote:
> The xin clock is used to obtain the APLL reference rate. Handle all
> lookup errors, not only probe deferral, before clk_get_rate() can see
> an error pointer.
> 
> Detected by static analysis and reviewed with AI-assisted source auditing.
> 
> Fixes: 48c5e98fedd9 ("clk: Renesas versaclock7 ccf device driver")
> Assisted-by: LLM
> Signed-off-by: Slavin Liu <bolin.liu@seu.edu.cn>
> ---
>  drivers/clk/clk-versaclock7.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/clk/clk-versaclock7.c b/drivers/clk/clk-versaclock7.c
> index 1340d2f512be..5f32d3fb807a 100644
> --- a/drivers/clk/clk-versaclock7.c
> +++ b/drivers/clk/clk-versaclock7.c
> @@ -1117,8 +1117,8 @@ static int vc7_probe(struct i2c_client *client)
>  	vc7->chip_info = i2c_get_match_data(client);
>  
>  	vc7->pin_xin = devm_clk_get(&client->dev, "xin");
> -	if (PTR_ERR(vc7->pin_xin) == -EPROBE_DEFER) {
> -		return dev_err_probe(&client->dev, -EPROBE_DEFER,
> +	if (IS_ERR(vc7->pin_xin)) {
> +		return dev_err_probe(&client->dev, PTR_ERR(vc7->pin_xin),
>  				     "xin not specified\n");

Could you clarify the error message as well? Perhaps 'devm_clk_get failed for
xin' ?

You can drop the PATCH RFC on the next version.

Brian