diff mbox

mfd: twl4030-irq: log an error in twl4030_sih_setup if the module cannot be found

Message ID 20170525202621.20169-1-u.kleine-koenig@pengutronix.de (mailing list archive)
State New, archived
Headers show

Commit Message

Uwe Kleine-König May 25, 2017, 8:26 p.m. UTC
As silently failing isn't that nice, emit an error message at a place
that was silent on failure up to now.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
Hello,

If the module cannot be found, twl4030_sih_setup returns -EINVAL. I
wonder if -ENODEV would be more appropriate.

Best regards
Uwe
---
 drivers/mfd/twl4030-irq.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Lee Jones May 30, 2017, 8:06 a.m. UTC | #1
On Thu, 25 May 2017, Uwe Kleine-König wrote:

> As silently failing isn't that nice, emit an error message at a place
> that was silent on failure up to now.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> Hello,
> 
> If the module cannot be found, twl4030_sih_setup returns -EINVAL. I
> wonder if -ENODEV would be more appropriate.
> 
> Best regards
> Uwe
> ---
>  drivers/mfd/twl4030-irq.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Applied, thanks.

> diff --git a/drivers/mfd/twl4030-irq.c b/drivers/mfd/twl4030-irq.c
> index b46c0cfc27d9..378c02d43bf7 100644
> --- a/drivers/mfd/twl4030-irq.c
> +++ b/drivers/mfd/twl4030-irq.c
> @@ -638,8 +638,10 @@ int twl4030_sih_setup(struct device *dev, int module, int irq_base)
>  		}
>  	}
>  
> -	if (status < 0)
> +	if (status < 0) {
> +		dev_err(dev, "module to setup SIH for not found\n");
>  		return status;
> +	}
>  
>  	agent = kzalloc(sizeof(*agent), GFP_KERNEL);
>  	if (!agent)
diff mbox

Patch

diff --git a/drivers/mfd/twl4030-irq.c b/drivers/mfd/twl4030-irq.c
index b46c0cfc27d9..378c02d43bf7 100644
--- a/drivers/mfd/twl4030-irq.c
+++ b/drivers/mfd/twl4030-irq.c
@@ -638,8 +638,10 @@  int twl4030_sih_setup(struct device *dev, int module, int irq_base)
 		}
 	}
 
-	if (status < 0)
+	if (status < 0) {
+		dev_err(dev, "module to setup SIH for not found\n");
 		return status;
+	}
 
 	agent = kzalloc(sizeof(*agent), GFP_KERNEL);
 	if (!agent)