All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: jzp0409 <jzp0409@163.com>
Cc: linux-input@vger.kernel.org, jiangzhipeng <jiangzhipeng@yulong.com>
Subject: Re: [PATCH] input: adp5589-keys: Add err log
Date: Sat, 20 Feb 2021 14:21:53 -0800	[thread overview]
Message-ID: <YDGLgYMBX5LxtUsz@google.com> (raw)
In-Reply-To: <20210220172040.1559-1-jzp0409@163.com>

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

      reply	other threads:[~2021-02-20 22:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-20 17:20 [PATCH] input: adp5589-keys: Add err log jzp0409
2021-02-20 22:21 ` Dmitry Torokhov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YDGLgYMBX5LxtUsz@google.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=jiangzhipeng@yulong.com \
    --cc=jzp0409@163.com \
    --cc=linux-input@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.