mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	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 v2] USB: dwc3: Use syscon_regmap_lookup_by_phandle_args
Date: Thu, 13 Feb 2025 01:28:10 +0000	[thread overview]
Message-ID: <20250213012806.6gtbrnyyaesyfefa@synopsys.com> (raw)
In-Reply-To: <20250212202913.23443-1-krzysztof.kozlowski@linaro.org>

On Wed, Feb 12, 2025, Krzysztof Kozlowski wrote:
> Use syscon_regmap_lookup_by_phandle_args() which is a wrapper over
> syscon_regmap_lookup_by_phandle() combined with getting the syscon
> argument.  Except simpler code this annotates within one line that given
> phandle has arguments, so grepping for code would be easier.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> 
> ---
> 
> Changes in v2:
> 1. Rebase (drop of_node_put)
> ---
>  drivers/usb/dwc3/dwc3-am62.c | 12 ++----------
>  1 file changed, 2 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/usb/dwc3/dwc3-am62.c b/drivers/usb/dwc3/dwc3-am62.c
> index c158364bc03e..9db8f3ca493d 100644
> --- a/drivers/usb/dwc3/dwc3-am62.c
> +++ b/drivers/usb/dwc3/dwc3-am62.c
> @@ -153,11 +153,11 @@ static int phy_syscon_pll_refclk(struct dwc3_am62 *am62)
>  {
>  	struct device *dev = am62->dev;
>  	struct device_node *node = dev->of_node;
> -	struct of_phandle_args args;
>  	struct regmap *syscon;
>  	int ret;
>  
> -	syscon = syscon_regmap_lookup_by_phandle(node, "ti,syscon-phy-pll-refclk");
> +	syscon = syscon_regmap_lookup_by_phandle_args(node, "ti,syscon-phy-pll-refclk",
> +						      1, &am62->offset);
>  	if (IS_ERR(syscon)) {
>  		dev_err(dev, "unable to get ti,syscon-phy-pll-refclk regmap\n");
>  		return PTR_ERR(syscon);
> @@ -165,14 +165,6 @@ static int phy_syscon_pll_refclk(struct dwc3_am62 *am62)
>  
>  	am62->syscon = syscon;
>  
> -	ret = of_parse_phandle_with_fixed_args(node, "ti,syscon-phy-pll-refclk", 1,
> -					       0, &args);
> -	if (ret)
> -		return ret;
> -
> -	of_node_put(args.np);
> -	am62->offset = args.args[0];
> -
>  	/* Core voltage. PHY_CORE_VOLTAGE bit Recommended to be 0 always */
>  	ret = regmap_update_bits(am62->syscon, am62->offset, PHY_CORE_VOLTAGE_MASK, 0);
>  	if (ret) {
> -- 
> 2.43.0
> 

Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>

Thanks,
Thinh

      reply	other threads:[~2025-02-13  1:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-12 20:29 Krzysztof Kozlowski
2025-02-13  1:28 ` Thinh Nguyen [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=20250213012806.6gtbrnyyaesyfefa@synopsys.com \
    --to=thinh.nguyen@synopsys.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --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

all inboxes | Powered by JetHome®