public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chanwoo Choi <cwchoi00@gmail.com>
To: Li Jun <jun.li@nxp.com>,
	myungjoo.ham@samsung.com, cw00.choi@samsung.com, krzk@kernel.org
Cc: linux-kernel@vger.kernel.org, frank.li@nxp.com, xu.yang_2@nxp.com
Subject: Re: [PATCH v3 1/2] extcon: ptn5150: add queue work sync before driver release
Date: Tue, 26 Apr 2022 09:04:19 +0900	[thread overview]
Message-ID: <974e0c5e-7929-80fa-e3b5-e9394a5e55b0@gmail.com> (raw)
In-Reply-To: <1650372249-10787-1-git-send-email-jun.li@nxp.com>

On 22. 4. 19. 21:44, Li Jun wrote:
> Add device managed action to sync pending queue work, otherwise
> the queued work may run after the work is destroyed.
> 
> Fixes: 4ed754de2d66 ("extcon: Add support for ptn5150 extcon driver")
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Signed-off-by: Li Jun <jun.li@nxp.com>
> ---
> change for v3:
> - Add Fixes and R-b tag.
> 
>   drivers/extcon/extcon-ptn5150.c | 11 +++++++++++
>   1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/extcon/extcon-ptn5150.c b/drivers/extcon/extcon-ptn5150.c
> index 5b9a3cf8df26..2a7874108df8 100644
> --- a/drivers/extcon/extcon-ptn5150.c
> +++ b/drivers/extcon/extcon-ptn5150.c
> @@ -194,6 +194,13 @@ static int ptn5150_init_dev_type(struct ptn5150_info *info)
>   	return 0;
>   }
>   
> +static void ptn5150_work_sync_and_put(void *data)
> +{
> +	struct ptn5150_info *info = data;
> +
> +	cancel_work_sync(&info->irq_work);
> +}
> +
>   static int ptn5150_i2c_probe(struct i2c_client *i2c)
>   {
>   	struct device *dev = &i2c->dev;
> @@ -284,6 +291,10 @@ static int ptn5150_i2c_probe(struct i2c_client *i2c)
>   	if (ret)
>   		return -EINVAL;
>   
> +	ret = devm_add_action_or_reset(dev, ptn5150_work_sync_and_put, info);
> +	if (ret)
> +		return ret;
> +
>   	/*
>   	 * Update current extcon state if for example OTG connection was there
>   	 * before the probe

Applied them. Thanks.

-- 
Best Regards,
Samsung Electronics
Chanwoo Choi

      parent reply	other threads:[~2022-04-26  0:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-19 12:44 [PATCH v3 1/2] extcon: ptn5150: add queue work sync before driver release Li Jun
2022-04-19 12:44 ` [PATCH v3 2/2] extcon: ptn5150: Add usb role class support Li Jun
2022-04-19 13:08   ` Krzysztof Kozlowski
2022-04-26  0:04 ` Chanwoo Choi [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=974e0c5e-7929-80fa-e3b5-e9394a5e55b0@gmail.com \
    --to=cwchoi00@gmail.com \
    --cc=cw00.choi@samsung.com \
    --cc=frank.li@nxp.com \
    --cc=jun.li@nxp.com \
    --cc=krzk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    --cc=xu.yang_2@nxp.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