On So, 2026-07-05 at 19:23 +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(-)
> 
> 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;
>               }
>  

Reviewed-by: Philipp Zabel <[email protected]>

regards
Philipp

Reply via email to