public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Liviu Dudau <liviu.dudau@arm.com>
To: Chen Ni <nichen@iscas.ac.cn>
Cc: linusw@kernel.org, mturquette@baylibre.com, sboyd@kernel.org,
	sudeep.holla@kernel.org, lpieralisi@kernel.org, robh@kernel.org,
	arnd@arndb.de, linux-arm-kernel@lists.infradead.org,
	linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] clk: versatile: vexpress-osc: Check return value of devm_of_clk_add_hw_provider() in vexpress_osc_probe()
Date: Wed, 11 Feb 2026 12:35:19 +0000	[thread overview]
Message-ID: <aYx3hyPHD5GbClYD@e142607> (raw)
In-Reply-To: <20260204063332.1791986-1-nichen@iscas.ac.cn>

On Wed, Feb 04, 2026 at 02:33:32PM +0800, Chen Ni wrote:
> Return the value of devm_of_clk_add_hw_provider() in order to propagate
> the error properly, if it fails due to resource allocation failure or
> device tree clock provider registration failure.
> 
> This ensures that the probe function fails safely rather than proceeding
> with a potentially incomplete clock provider setup.
> 
> Fixes: 03cc105f2edf ("clk: vexpress-osc: Use the devres clock API variants")
> Signed-off-by: Chen Ni <nichen@iscas.ac.cn>

Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>

Best regards,
Liviu

> ---
>  drivers/clk/versatile/clk-vexpress-osc.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/versatile/clk-vexpress-osc.c b/drivers/clk/versatile/clk-vexpress-osc.c
> index 9adbf5c33bd1..2292fee4e423 100644
> --- a/drivers/clk/versatile/clk-vexpress-osc.c
> +++ b/drivers/clk/versatile/clk-vexpress-osc.c
> @@ -97,7 +97,10 @@ static int vexpress_osc_probe(struct platform_device *pdev)
>  	if (ret < 0)
>  		return ret;
>  
> -	devm_of_clk_add_hw_provider(&pdev->dev, of_clk_hw_simple_get, &osc->hw);
> +	ret = devm_of_clk_add_hw_provider(&pdev->dev, of_clk_hw_simple_get, &osc->hw);
> +	if (ret)
> +		return ret;
> +
>  	clk_hw_set_rate_range(&osc->hw, osc->rate_min, osc->rate_max);
>  
>  	dev_dbg(&pdev->dev, "Registered clock '%s'\n", init.name);
> -- 
> 2.25.1
> 

      reply	other threads:[~2026-02-11 12:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-04  6:33 [PATCH] clk: versatile: vexpress-osc: Check return value of devm_of_clk_add_hw_provider() in vexpress_osc_probe() Chen Ni
2026-02-11 12:35 ` Liviu Dudau [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aYx3hyPHD5GbClYD@e142607 \
    --to=liviu.dudau@arm.com \
    --cc=arnd@arndb.de \
    --cc=linusw@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=nichen@iscas.ac.cn \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=sudeep.holla@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox