Skip to content

Commit ad6fb73

Browse files
jhovoldgregkh
authored andcommitted
usb: gadget: lpc32xx_udc: clean up probe error labels
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> Reviewed-by: Vladimir Zapolskiy <vz@mleia.com> Link: https://patch.msgid.link/20251218153519.19453-5-johan@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent b4c61e5 commit ad6fb73

1 file changed

Lines changed: 10 additions & 11 deletions

File tree

drivers/usb/gadget/udc/lpc32xx_udc.c

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3084,7 +3084,7 @@ static int lpc32xx_udc_probe(struct platform_device *pdev)
30843084
if (!udc->udca_v_base) {
30853085
dev_err(udc->dev, "error getting UDCA region\n");
30863086
retval = -ENOMEM;
3087-
goto i2c_fail;
3087+
goto err_disable_clk;
30883088
}
30893089
udc->udca_p_base = dma_handle;
30903090
dev_dbg(udc->dev, "DMA buffer(0x%x bytes), P:0x%08x, V:0x%p\n",
@@ -3097,7 +3097,7 @@ static int lpc32xx_udc_probe(struct platform_device *pdev)
30973097
if (!udc->dd_cache) {
30983098
dev_err(udc->dev, "error getting DD DMA region\n");
30993099
retval = -ENOMEM;
3100-
goto dma_alloc_fail;
3100+
goto err_free_dma;
31013101
}
31023102

31033103
/* Clear USB peripheral and initialize gadget endpoints */
@@ -3111,22 +3111,22 @@ static int lpc32xx_udc_probe(struct platform_device *pdev)
31113111
if (retval < 0) {
31123112
dev_err(udc->dev, "LP request irq %d failed\n",
31133113
udc->udp_irq[IRQ_USB_LP]);
3114-
goto irq_req_fail;
3114+
goto err_destroy_pool;
31153115
}
31163116
retval = devm_request_irq(dev, udc->udp_irq[IRQ_USB_HP],
31173117
lpc32xx_usb_hp_irq, 0, "udc_hp", udc);
31183118
if (retval < 0) {
31193119
dev_err(udc->dev, "HP request irq %d failed\n",
31203120
udc->udp_irq[IRQ_USB_HP]);
3121-
goto irq_req_fail;
3121+
goto err_destroy_pool;
31223122
}
31233123

31243124
retval = devm_request_irq(dev, udc->udp_irq[IRQ_USB_DEVDMA],
31253125
lpc32xx_usb_devdma_irq, 0, "udc_dma", udc);
31263126
if (retval < 0) {
31273127
dev_err(udc->dev, "DEV request irq %d failed\n",
31283128
udc->udp_irq[IRQ_USB_DEVDMA]);
3129-
goto irq_req_fail;
3129+
goto err_destroy_pool;
31303130
}
31313131

31323132
/* The transceiver interrupt is used for VBUS detection and will
@@ -3137,7 +3137,7 @@ static int lpc32xx_udc_probe(struct platform_device *pdev)
31373137
if (retval < 0) {
31383138
dev_err(udc->dev, "VBUS request irq %d failed\n",
31393139
udc->udp_irq[IRQ_USB_ATX]);
3140-
goto irq_req_fail;
3140+
goto err_destroy_pool;
31413141
}
31423142

31433143
/* Initialize wait queue */
@@ -3146,7 +3146,7 @@ static int lpc32xx_udc_probe(struct platform_device *pdev)
31463146

31473147
retval = usb_add_gadget_udc(dev, &udc->gadget);
31483148
if (retval < 0)
3149-
goto add_gadget_fail;
3149+
goto err_destroy_pool;
31503150

31513151
dev_set_drvdata(dev, udc);
31523152
device_init_wakeup(dev, 1);
@@ -3158,13 +3158,12 @@ static int lpc32xx_udc_probe(struct platform_device *pdev)
31583158
dev_info(udc->dev, "%s version %s\n", driver_name, DRIVER_VERSION);
31593159
return 0;
31603160

3161-
add_gadget_fail:
3162-
irq_req_fail:
3161+
err_destroy_pool:
31633162
dma_pool_destroy(udc->dd_cache);
3164-
dma_alloc_fail:
3163+
err_free_dma:
31653164
dma_free_coherent(&pdev->dev, UDCA_BUFF_SIZE,
31663165
udc->udca_v_base, udc->udca_p_base);
3167-
i2c_fail:
3166+
err_disable_clk:
31683167
clk_disable_unprepare(udc->usb_slv_clk);
31693168
err_put_client:
31703169
put_device(&udc->isp1301_i2c_client->dev);

0 commit comments

Comments
 (0)