Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Johan Hovold and committed by
Greg Kroah-Hartman
ad6fb736 b4c61e54

+10 -11
+10 -11
drivers/usb/gadget/udc/lpc32xx_udc.c
··· 3084 3084 if (!udc->udca_v_base) { 3085 3085 dev_err(udc->dev, "error getting UDCA region\n"); 3086 3086 retval = -ENOMEM; 3087 - goto i2c_fail; 3087 + goto err_disable_clk; 3088 3088 } 3089 3089 udc->udca_p_base = dma_handle; 3090 3090 dev_dbg(udc->dev, "DMA buffer(0x%x bytes), P:0x%08x, V:0x%p\n", ··· 3097 3097 if (!udc->dd_cache) { 3098 3098 dev_err(udc->dev, "error getting DD DMA region\n"); 3099 3099 retval = -ENOMEM; 3100 - goto dma_alloc_fail; 3100 + goto err_free_dma; 3101 3101 } 3102 3102 3103 3103 /* Clear USB peripheral and initialize gadget endpoints */ ··· 3111 3111 if (retval < 0) { 3112 3112 dev_err(udc->dev, "LP request irq %d failed\n", 3113 3113 udc->udp_irq[IRQ_USB_LP]); 3114 - goto irq_req_fail; 3114 + goto err_destroy_pool; 3115 3115 } 3116 3116 retval = devm_request_irq(dev, udc->udp_irq[IRQ_USB_HP], 3117 3117 lpc32xx_usb_hp_irq, 0, "udc_hp", udc); 3118 3118 if (retval < 0) { 3119 3119 dev_err(udc->dev, "HP request irq %d failed\n", 3120 3120 udc->udp_irq[IRQ_USB_HP]); 3121 - goto irq_req_fail; 3121 + goto err_destroy_pool; 3122 3122 } 3123 3123 3124 3124 retval = devm_request_irq(dev, udc->udp_irq[IRQ_USB_DEVDMA], ··· 3126 3126 if (retval < 0) { 3127 3127 dev_err(udc->dev, "DEV request irq %d failed\n", 3128 3128 udc->udp_irq[IRQ_USB_DEVDMA]); 3129 - goto irq_req_fail; 3129 + goto err_destroy_pool; 3130 3130 } 3131 3131 3132 3132 /* The transceiver interrupt is used for VBUS detection and will ··· 3137 3137 if (retval < 0) { 3138 3138 dev_err(udc->dev, "VBUS request irq %d failed\n", 3139 3139 udc->udp_irq[IRQ_USB_ATX]); 3140 - goto irq_req_fail; 3140 + goto err_destroy_pool; 3141 3141 } 3142 3142 3143 3143 /* Initialize wait queue */ ··· 3146 3146 3147 3147 retval = usb_add_gadget_udc(dev, &udc->gadget); 3148 3148 if (retval < 0) 3149 - goto add_gadget_fail; 3149 + goto err_destroy_pool; 3150 3150 3151 3151 dev_set_drvdata(dev, udc); 3152 3152 device_init_wakeup(dev, 1); ··· 3158 3158 dev_info(udc->dev, "%s version %s\n", driver_name, DRIVER_VERSION); 3159 3159 return 0; 3160 3160 3161 - add_gadget_fail: 3162 - irq_req_fail: 3161 + err_destroy_pool: 3163 3162 dma_pool_destroy(udc->dd_cache); 3164 - dma_alloc_fail: 3163 + err_free_dma: 3165 3164 dma_free_coherent(&pdev->dev, UDCA_BUFF_SIZE, 3166 3165 udc->udca_v_base, udc->udca_p_base); 3167 - i2c_fail: 3166 + err_disable_clk: 3168 3167 clk_disable_unprepare(udc->usb_slv_clk); 3169 3168 err_put_client: 3170 3169 put_device(&udc->isp1301_i2c_client->dev);