public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
To: "Rob Herring (Arm)" <robh@kernel.org>
Cc: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] usb: dwc3: omap: Fix devm_regulator_get_optional() error handling
Date: Fri, 10 Jan 2025 02:37:58 +0000	[thread overview]
Message-ID: <20250110023756.shkrjhvoka5h2td3@synopsys.com> (raw)
In-Reply-To: <20250109170748.3852439-1-robh@kernel.org>

On Thu, Jan 09, 2025, Rob Herring (Arm) wrote:
> Commit 533561a8aad5 ("usb: dwc3: omap: Use
> devm_regulator_get_optional()") assumed NULL was returned, but
> devm_regulator_get_optional() returns -ENODEV rather than NULL like
> other *_get_optional() functions.
> 
> Fixes: 533561a8aad5 ("usb: dwc3: omap: Use devm_regulator_get_optional()")
> Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
> ---
>  drivers/usb/dwc3/dwc3-omap.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
> index 9b1d10ac33c1..fe74d11bb629 100644
> --- a/drivers/usb/dwc3/dwc3-omap.c
> +++ b/drivers/usb/dwc3/dwc3-omap.c
> @@ -484,8 +484,11 @@ static int dwc3_omap_probe(struct platform_device *pdev)
>  		return PTR_ERR(base);
>  
>  	vbus_reg = devm_regulator_get_optional(dev, "vbus");
> -	if (IS_ERR(vbus_reg))
> -		return dev_err_probe(dev, PTR_ERR(vbus_reg), "vbus init failed\n");
> +	if (IS_ERR(vbus_reg)) {
> +		if (PTR_ERR(vbus_reg) != -ENODEV)
> +			return dev_err_probe(dev, PTR_ERR(vbus_reg), "vbus init failed\n");
> +		vbus_reg = NULL;
> +	}
>  
>  	omap->dev	= dev;
>  	omap->irq	= irq;
> -- 
> 2.45.2
> 

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

Thanks,
Thinh

      reply	other threads:[~2025-01-10  2:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-09 17:07 [PATCH] usb: dwc3: omap: Fix devm_regulator_get_optional() error handling Rob Herring (Arm)
2025-01-10  2:37 ` 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=20250110023756.shkrjhvoka5h2td3@synopsys.com \
    --to=thinh.nguyen@synopsys.com \
    --cc=broonie@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=robh@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