linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Pramod Gurav <pramod.gurav@smartplayin.com>
Cc: linux-kernel@vger.kernel.org,
	Michael Hennerich <michael.hennerich@analog.com>,
	linux-input@vger.kernel.org
Subject: Re: [PATCH] Input: adp5588-keys: cancel workqueue in failure path
Date: Tue, 7 Oct 2014 09:38:56 -0700	[thread overview]
Message-ID: <20141007163856.GE16469@dtor-ws> (raw)
In-Reply-To: <1412667049-6128-1-git-send-email-pramod.gurav@smartplayin.com>

On Tue, Oct 07, 2014 at 01:00:49PM +0530, Pramod Gurav wrote:
> This change introduces a label to call cancel_delayed_work_sync in
> failure path.
> 
> Cc: Michael Hennerich <michael.hennerich@analog.com>
> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> Cc: linux-input@vger.kernel.org
> Signed-off-by: Pramod Gurav <pramod.gurav@smartplayin.com>
> ---
>  drivers/input/keyboard/adp5588-keys.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/input/keyboard/adp5588-keys.c b/drivers/input/keyboard/adp5588-keys.c
> index 5ef7fcf..b494062 100644
> --- a/drivers/input/keyboard/adp5588-keys.c
> +++ b/drivers/input/keyboard/adp5588-keys.c
> @@ -559,7 +559,7 @@ static int adp5588_probe(struct i2c_client *client,
>  	error = input_register_device(input);
>  	if (error) {
>  		dev_err(&client->dev, "unable to register input device\n");
> -		goto err_free_mem;
> +		goto err_delayed_work;
>  	}
>  
>  	error = request_irq(client->irq, adp5588_irq,
> @@ -592,6 +592,8 @@ static int adp5588_probe(struct i2c_client *client,
>   err_unreg_dev:
>  	input_unregister_device(input);
>  	input = NULL;
> + err_delayed_work:
> +	cancel_delayed_work_sync(&kpad->work);

We do not need to have a separate label, just need to cancel workqueue
after freeing interrupt. I adjusted the patch and applied.

Thanks.

-- 
Dmitry

  parent reply	other threads:[~2014-10-07 16:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-07  7:30 [PATCH] Input: adp5588-keys: cancel workqueue in failure path Pramod Gurav
2014-10-07 12:42 ` Michael Hennerich
2014-10-07 16:38 ` Dmitry Torokhov [this message]
2014-10-08 10:18   ` Pramod Gurav
2014-10-08 10:25     ` Pramod Gurav

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=20141007163856.GE16469@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.hennerich@analog.com \
    --cc=pramod.gurav@smartplayin.com \
    /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 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).