2017-06-30 05:59:52

by Gustavo A. R. Silva

[permalink] [raw]
Subject: [PATCH] crypto: ccp-platform: print error message on platform_get_irq failure

Print error message on platform_get_irq failure before return.

Signed-off-by: Gustavo A. R. Silva <[email protected]>
---
drivers/crypto/ccp/ccp-platform.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/crypto/ccp/ccp-platform.c b/drivers/crypto/ccp/ccp-platform.c
index e26969e..6020c4a 100644
--- a/drivers/crypto/ccp/ccp-platform.c
+++ b/drivers/crypto/ccp/ccp-platform.c
@@ -66,8 +66,10 @@ static int ccp_get_irq(struct ccp_device *ccp)
int ret;

ret = platform_get_irq(pdev, 0);
- if (ret < 0)
+ if (ret < 0) {
+ dev_notice(dev, "unable to get IRQ (%d)\n", ret);
return ret;
+ }

ccp->irq = ret;
ret = request_irq(ccp->irq, ccp->vdata->perform->irqhandler, 0,
--
2.5.0


2017-06-30 15:08:20

by Gary R Hook

[permalink] [raw]
Subject: Re: [PATCH] crypto: ccp-platform: print error message on platform_get_irq failure

On 06/30/2017 12:59 AM, Gustavo A. R. Silva wrote:
> Print error message on platform_get_irq failure before return.
>
> Signed-off-by: Gustavo A. R. Silva <[email protected]>
> ---
> drivers/crypto/ccp/ccp-platform.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/crypto/ccp/ccp-platform.c
> b/drivers/crypto/ccp/ccp-platform.c
> index e26969e..6020c4a 100644
> --- a/drivers/crypto/ccp/ccp-platform.c
> +++ b/drivers/crypto/ccp/ccp-platform.c
> @@ -66,8 +66,10 @@ static int ccp_get_irq(struct ccp_device *ccp)
> int ret;
>
> ret = platform_get_irq(pdev, 0);
> - if (ret < 0)
> + if (ret < 0) {
> + dev_notice(dev, "unable to get IRQ (%d)\n", ret);
> return ret;
> + }

Good find.

I'm all for better and more messages, but I'd like to see more detail
here, and in the
later dev_notice(). Can we have the messages better reflect the failure
points?

>
> ccp->irq = ret;
> ret = request_irq(ccp->irq, ccp->vdata->perform->irqhandler, 0,
> --
> 2.5.0
>

2017-07-18 10:36:19

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH] crypto: ccp-platform: print error message on platform_get_irq failure

On Fri, Jun 30, 2017 at 12:59:52AM -0500, Gustavo A. R. Silva wrote:
> Print error message on platform_get_irq failure before return.
>
> Signed-off-by: Gustavo A. R. Silva <[email protected]>

Patch applied. Thanks.
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt