mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: "barebox@lists.infradead.org" <barebox@lists.infradead.org>,
	Michael Grzeschik <mgr@pengutronix.de>
Subject: Re: [PATCH 1/2] phy: stm32-usphyc: release resources to properly support EPROBE_DEFER
Date: Mon, 14 Dec 2020 18:53:08 +0100	[thread overview]
Message-ID: <6f18c5e7-4826-276e-6860-9bd06bbbd908@pengutronix.de> (raw)
In-Reply-To: <20200722080956.17454-1-a.fatoum@pengutronix.de>

Hello Sascha,

On 22.07.20 10:09, Ahmad Fatoum wrote:
> Driver failed to release resources on failed probe so far, leading to
> deferred probe failing with -EBUSY. Fix this.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>

As we still have EPROBE_DEFER, it would be nice if this could
be merged.

Cheers,
Ahmad

> ---
>  drivers/phy/phy-stm32-usbphyc.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/phy/phy-stm32-usbphyc.c b/drivers/phy/phy-stm32-usbphyc.c
> index 093842fe1460..d9eaa8a7544a 100644
> --- a/drivers/phy/phy-stm32-usbphyc.c
> +++ b/drivers/phy/phy-stm32-usbphyc.c
> @@ -328,13 +328,13 @@ static int stm32_usbphyc_probe(struct device_d *dev)
>  	if (IS_ERR(usbphyc->clk)) {
>  		ret = PTR_ERR(usbphyc->clk);
>  		dev_err(dev, "clk get failed: %d\n", ret);
> -		return ret;
> +		goto release_region;
>  	}
>  
>  	ret = clk_enable(usbphyc->clk);
>  	if (ret) {
>  		dev_err(dev, "clk enable failed: %d\n", ret);
> -		return ret;
> +		goto release_region;
>  	}
>  
>  	device_reset_us(dev, 2);
> @@ -405,6 +405,11 @@ static int stm32_usbphyc_probe(struct device_d *dev)
>  
>  clk_disable:
>  	clk_disable(usbphyc->clk);
> +release_region:
> +	release_region(iores);
> +
> +	free(usbphyc->phys);
> +	free(usbphyc);
>  
>  	return ret;
>  }
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2020-12-14 17:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-22  8:09 Ahmad Fatoum
2020-07-22  8:09 ` [PATCH 2/2] regulator: stm32-pwr: " Ahmad Fatoum
2020-12-14 17:53 ` Ahmad Fatoum [this message]
2020-12-16  8:28   ` [PATCH 1/2] phy: stm32-usphyc: " Sascha Hauer

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=6f18c5e7-4826-276e-6860-9bd06bbbd908@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=mgr@pengutronix.de \
    --cc=s.hauer@pengutronix.de \
    /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