mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vladimir Zapolskiy <vz@mleia.com>
To: Johan Hovold <johan@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Piotr Wojtaszczyk <piotr.wojtaszczyk@timesys.com>,
	Alan Stern <stern@rowland.harvard.edu>,
	Ma Ke <make24@iscas.ac.cn>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 5/5] usb: ohci-nxp: clean up probe error labels
Date: Fri, 19 Dec 2025 02:22:55 +0200	[thread overview]
Message-ID: <f9251c13-a4d7-4ccd-a0ea-abfaa02a8639@mleia.com> (raw)
In-Reply-To: <20251218153519.19453-6-johan@kernel.org>

On 12/18/25 17:35, Johan Hovold wrote:
> Error labels should be named after what they do rather than after from
> where they are jumped to.
> 
> Rename the probe error labels for consistency and to improve
> readability.
> 
> Signed-off-by: Johan Hovold <johan@kernel.org>
> ---
>   drivers/usb/host/ohci-nxp.c | 16 ++++++++--------
>   1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/usb/host/ohci-nxp.c b/drivers/usb/host/ohci-nxp.c
> index 509ca7d8d513..7663f2aa35e9 100644
> --- a/drivers/usb/host/ohci-nxp.c
> +++ b/drivers/usb/host/ohci-nxp.c
> @@ -169,13 +169,13 @@ static int ohci_hcd_nxp_probe(struct platform_device *pdev)
>   
>   	ret = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
>   	if (ret)
> -		goto fail_disable;
> +		goto err_put_client;
>   
>   	dev_dbg(&pdev->dev, "%s: " DRIVER_DESC " (nxp)\n", hcd_name);
>   	if (usb_disabled()) {
>   		dev_err(&pdev->dev, "USB is disabled\n");
>   		ret = -ENODEV;
> -		goto fail_disable;
> +		goto err_put_client;
>   	}
>   
>   	/* Enable USB host clock */
> @@ -183,7 +183,7 @@ static int ohci_hcd_nxp_probe(struct platform_device *pdev)
>   	if (IS_ERR(usb_host_clk)) {
>   		dev_err(&pdev->dev, "failed to acquire and start USB OHCI clock\n");
>   		ret = PTR_ERR(usb_host_clk);
> -		goto fail_disable;
> +		goto err_put_client;
>   	}
>   
>   	isp1301_configure();
> @@ -192,13 +192,13 @@ static int ohci_hcd_nxp_probe(struct platform_device *pdev)
>   	if (!hcd) {
>   		dev_err(&pdev->dev, "Failed to allocate HC buffer\n");
>   		ret = -ENOMEM;
> -		goto fail_disable;
> +		goto err_put_client;
>   	}
>   
>   	hcd->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
>   	if (IS_ERR(hcd->regs)) {
>   		ret = PTR_ERR(hcd->regs);
> -		goto fail_resource;
> +		goto err_put_hcd;
>   	}
>   	hcd->rsrc_start = res->start;
>   	hcd->rsrc_len = resource_size(res);
> @@ -206,7 +206,7 @@ static int ohci_hcd_nxp_probe(struct platform_device *pdev)
>   	irq = platform_get_irq(pdev, 0);
>   	if (irq < 0) {
>   		ret = -ENXIO;
> -		goto fail_resource;
> +		goto err_put_hcd;
>   	}
>   
>   	ohci_nxp_start_hc();
> @@ -220,9 +220,9 @@ static int ohci_hcd_nxp_probe(struct platform_device *pdev)
>   	}
>   
>   	ohci_nxp_stop_hc();
> -fail_resource:
> +err_put_hcd:
>   	usb_put_hcd(hcd);
> -fail_disable:
> +err_put_client:
>   	put_device(&isp1301_i2c_client->dev);
>   	isp1301_i2c_client = NULL;
>   	return ret;

Reviewed-by: Vladimir Zapolskiy <vz@mleia.com>

Thank you for the fixes!

-- 
Best wishes,
Vladimir

      reply	other threads:[~2025-12-19  0:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-18 15:35 [PATCH v2 0/5] USB: lpc32xx: fix error handling Johan Hovold
2025-12-18 15:35 ` [PATCH v2 1/5] usb: gadget: lpc32xx_udc: fix clock imbalance in error path Johan Hovold
2025-12-19  0:11   ` Vladimir Zapolskiy
2025-12-18 15:35 ` [PATCH v2 2/5] usb: phy: isp1301: fix non-OF device reference imbalance Johan Hovold
2025-12-19  0:15   ` Vladimir Zapolskiy
2025-12-19  6:20     ` Johan Hovold
2025-12-18 15:35 ` [PATCH v2 3/5] usb: ohci-nxp: fix device leak on probe failure Johan Hovold
2025-12-18 15:52   ` Alan Stern
2025-12-19  0:19   ` Vladimir Zapolskiy
2025-12-18 15:35 ` [PATCH v2 4/5] usb: gadget: lpc32xx_udc: clean up probe error labels Johan Hovold
2025-12-19  0:22   ` Vladimir Zapolskiy
2025-12-18 15:35 ` [PATCH v2 5/5] usb: ohci-nxp: " Johan Hovold
2025-12-19  0:22   ` Vladimir Zapolskiy [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=f9251c13-a4d7-4ccd-a0ea-abfaa02a8639@mleia.com \
    --to=vz@mleia.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=make24@iscas.ac.cn \
    --cc=piotr.wojtaszczyk@timesys.com \
    --cc=stern@rowland.harvard.edu \
    /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®