linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Chen <peter.chen@nxp.com>
To: Chuhong Yuan <hslester96@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] usb: chipidea: msm: Use device-managed registration API
Date: Wed, 28 Aug 2019 03:24:00 +0000	[thread overview]
Message-ID: <20190828032118.GA2966@b29397-desktop> (raw)
In-Reply-To: <20190723030206.2919-1-hslester96@gmail.com>

On 19-07-23 11:02:07, Chuhong Yuan wrote:
> Use devm_reset_controller_register to get rid
> of manual unregistration.
> 
> Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
> ---
>  drivers/usb/chipidea/ci_hdrc_msm.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/chipidea/ci_hdrc_msm.c b/drivers/usb/chipidea/ci_hdrc_msm.c
> index bb4645a8ca46..067542e84aea 100644
> --- a/drivers/usb/chipidea/ci_hdrc_msm.c
> +++ b/drivers/usb/chipidea/ci_hdrc_msm.c
> @@ -216,7 +216,7 @@ static int ci_hdrc_msm_probe(struct platform_device *pdev)
>  	ci->rcdev.ops = &ci_hdrc_msm_reset_ops;
>  	ci->rcdev.of_node = pdev->dev.of_node;
>  	ci->rcdev.nr_resets = 2;
> -	ret = reset_controller_register(&ci->rcdev);
> +	ret = devm_reset_controller_register(&pdev->dev, &ci->rcdev);
>  	if (ret)
>  		return ret;
>  
> @@ -272,7 +272,6 @@ static int ci_hdrc_msm_probe(struct platform_device *pdev)
>  err_iface:
>  	clk_disable_unprepare(ci->core_clk);
>  err_fs:
> -	reset_controller_unregister(&ci->rcdev);

It is devm API, why the unregister needs to be called at
fail path?

Peter

>  	return ret;
>  }
>  
> @@ -284,7 +283,6 @@ static int ci_hdrc_msm_remove(struct platform_device *pdev)
>  	ci_hdrc_remove_device(ci->ci);
>  	clk_disable_unprepare(ci->iface_clk);
>  	clk_disable_unprepare(ci->core_clk);
> -	reset_controller_unregister(&ci->rcdev);
>  
>  	return 0;
>  }
> -- 
> 2.20.1
> 

  reply	other threads:[~2019-08-28  3:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-23  3:02 [PATCH] usb: chipidea: msm: Use device-managed registration API Chuhong Yuan
2019-08-28  3:24 ` Peter Chen [this message]
2019-08-28 11:42   ` Chuhong Yuan
2019-08-29  3:39     ` Peter Chen

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=20190828032118.GA2966@b29397-desktop \
    --to=peter.chen@nxp.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hslester96@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@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 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).