linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] input: adp5589-keys: Add err log
@ 2021-02-20 17:20 jzp0409
  2021-02-20 22:21 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: jzp0409 @ 2021-02-20 17:20 UTC (permalink / raw)
  To: dmitry.torokhov; +Cc: linux-input, jiangzhipeng

From: jiangzhipeng <jiangzhipeng@yulong.com>

When devm_gpiochip_add_data() failed ,print err log

Signed-off-by: jiangzhipeng <jiangzhipeng@yulong.com>
---
 drivers/input/keyboard/adp5589-keys.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/input/keyboard/adp5589-keys.c b/drivers/input/keyboard/adp5589-keys.c
index 654e047..e99c0bd 100644
--- a/drivers/input/keyboard/adp5589-keys.c
+++ b/drivers/input/keyboard/adp5589-keys.c
@@ -526,8 +526,10 @@ static int adp5589_gpio_add(struct adp5589_kpad *kpad)
 	mutex_init(&kpad->gpio_lock);
 
 	error = devm_gpiochip_add_data(dev, &kpad->gc, kpad);
-	if (error)
+	if (error) {
+		dev_err(dev, "devm_gpiochip_add_data() failed, err: %d\n", error);
 		return error;
+	}
 
 	for (i = 0; i <= kpad->var->bank(kpad->var->maxgpio); i++) {
 		kpad->dat_out[i] = adp5589_read(kpad->client, kpad->var->reg(
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] input: adp5589-keys: Add err log
  2021-02-20 17:20 [PATCH] input: adp5589-keys: Add err log jzp0409
@ 2021-02-20 22:21 ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2021-02-20 22:21 UTC (permalink / raw)
  To: jzp0409; +Cc: linux-input, jiangzhipeng

Hi,

On Sun, Feb 21, 2021 at 01:20:40AM +0800, jzp0409 wrote:
> From: jiangzhipeng <jiangzhipeng@yulong.com>
> 
> When devm_gpiochip_add_data() failed ,print err log
> 
> Signed-off-by: jiangzhipeng <jiangzhipeng@yulong.com>
> ---
>  drivers/input/keyboard/adp5589-keys.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/input/keyboard/adp5589-keys.c b/drivers/input/keyboard/adp5589-keys.c
> index 654e047..e99c0bd 100644
> --- a/drivers/input/keyboard/adp5589-keys.c
> +++ b/drivers/input/keyboard/adp5589-keys.c
> @@ -526,8 +526,10 @@ static int adp5589_gpio_add(struct adp5589_kpad *kpad)
>  	mutex_init(&kpad->gpio_lock);
>  
>  	error = devm_gpiochip_add_data(dev, &kpad->gc, kpad);
> -	if (error)
> +	if (error) {
> +		dev_err(dev, "devm_gpiochip_add_data() failed, err: %d\n", error);
>  		return error;
> +	}

I believe devm_gpiochip_add_data() already provides enough diagnostic
when it fails, there is no need for additional diagnostic here.

>  
>  	for (i = 0; i <= kpad->var->bank(kpad->var->maxgpio); i++) {
>  		kpad->dat_out[i] = adp5589_read(kpad->client, kpad->var->reg(
> -- 
> 1.9.1
> 
> 

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-02-20 22:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-20 17:20 [PATCH] input: adp5589-keys: Add err log jzp0409
2021-02-20 22:21 ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).