Re: [PATCH] remoteproc: ti_k3_r5: Drop redundant NULL check on reset control get

Mathieu Poirier <[email protected]>
Newsgroups org.kernel.vger.linux-remoteproc,org.kernel.vger.linux-kernel
Message-ID <ak6AS7NmN8Lw0v3b@p14s>
On Sun, Jul 05, 2026 at 07:23:54PM +0200, Krzysztof Kozlowski wrote:
> devm_reset_control_get_exclusive() does not return NULL (only valid
> clock or ERR pointer in case for non-optional get), so simplify the code
> to drop redundant IS_ERR_OR_NULL().
> 
> Signed-off-by: Krzysztof Kozlowski <[email protected]>
> ---
>  drivers/remoteproc/ti_k3_r5_remoteproc.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
>

Applied.

Thanks,
Mathieu
 
> diff --git a/drivers/remoteproc/ti_k3_r5_remoteproc.c b/drivers/remoteproc/ti_k3_r5_remoteproc.c
> index 04f23295ffc1..b1d04d082e44 100644
> --- a/drivers/remoteproc/ti_k3_r5_remoteproc.c
> +++ b/drivers/remoteproc/ti_k3_r5_remoteproc.c
> @@ -1074,11 +1074,9 @@ static int k3_r5_cluster_rproc_init(struct platform_device *pdev)
>  		}
>  
>  		kproc->reset = devm_reset_control_get_exclusive(cdev, NULL);
> -		if (IS_ERR_OR_NULL(kproc->reset)) {
> -			ret = PTR_ERR_OR_ZERO(kproc->reset);
> -			if (!ret)
> -				ret = -ENODEV;
> -			dev_err_probe(cdev, ret, "failed to get reset handle\n");
> +		if (IS_ERR(kproc->reset)) {
> +			ret = dev_err_probe(cdev, PTR_ERR(kproc->reset),
> +					    "failed to get reset handle\n");
>  			goto out;
>  		}
>  
> -- 
> 2.53.0
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.