Re: [PATCH] hwrng: imx-rngc - platform_get_irq() already prints an error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thus wrote Nigel Christian (nigel.l.christian@xxxxxxxxx):

> There is no need to call the dev_err() function directly to print
> a custom message when handling an error from platform_get_irq()
> as it prints the appropriate message in the event of a failure.
> Change suggested via coccicheck report.

> Signed-off-by: Nigel Christian <nigel.l.christian@xxxxxxxxx>
> ---
>  drivers/char/hw_random/imx-rngc.c | 1 -
>  1 file changed, 1 deletion(-)

> diff --git a/drivers/char/hw_random/imx-rngc.c b/drivers/char/hw_random/imx-rngc.c
> index 61c844baf26e..69f13ff1bbec 100644
> --- a/drivers/char/hw_random/imx-rngc.c
> +++ b/drivers/char/hw_random/imx-rngc.c
> @@ -253,7 +253,6 @@ static int imx_rngc_probe(struct platform_device *pdev)

>  	irq = platform_get_irq(pdev, 0);
>  	if (irq <= 0) {
> -		dev_err(&pdev->dev, "Couldn't get irq %d\n", irq);
>  		return irq;
>  	}

Looks good to me. This suppresses the error message if platform_get_irq
returns -EPROBE_DEFER, which makes more sense than the current code.

Reviewed-by: Martin Kaiser <martin@xxxxxxxxx>



[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux