Re: [PATCH 1/5] usb: dwc2: cleanup on error for deferred probing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Micheal,

I am testing your patches, but this one doesn't compile.

On Wed, Dec 16, 2020 at 09:45:30PM +0100, Michael Grzeschik wrote:
> The driver needs to cleanup the resources if an error occurred. Otherwise,
> on deferred probing, it will fail to take the resources for a second time.
> 
> Signed-off-by: Michael Grzeschik <m.grzeschik@xxxxxxxxxxxxxx>
> ---
>  drivers/usb/dwc2/dwc2.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/dwc2/dwc2.c b/drivers/usb/dwc2/dwc2.c
> index bd33334a83..87d0ec7a5a 100644
> --- a/drivers/usb/dwc2/dwc2.c
> +++ b/drivers/usb/dwc2/dwc2.c
> @@ -53,7 +53,7 @@ static int dwc2_probe(struct device_d *dev)
>  	dwc2->phy = phy_optional_get(dev, "usb2-phy");
>  	if (IS_ERR(dwc2->phy)) {
>  		ret = PTR_ERR(dwc2->phy);
> -		return ret;
> +		goto release_region;
>  	}
>  
>  	ret = phy_init(dwc2->phy);
> @@ -100,7 +100,8 @@ error:
>  	phy_power_off(dwc2->phy);
>  err_phy_power:
>  	phy_exit(dwc2->phy);
> -err_phy_init:
> +release_region:
> +	release_region(iores);
error: label ‘err_phy_init’ used but not defined
in drivers/usb/dwc2.c:61
        ret = phy_init(dwc2->phy);
        if (ret)
                goto err_phy_init;


Jules


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




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux