hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/drivers/usb/gadget/udc/lpc32xx_udc.c
....@@ -24,6 +24,7 @@
2424 #include <linux/module.h>
2525 #include <linux/of.h>
2626 #include <linux/platform_device.h>
27
+#include <linux/prefetch.h>
2728 #include <linux/proc_fs.h>
2829 #include <linux/slab.h>
2930 #include <linux/usb/ch9.h>
....@@ -34,8 +35,6 @@
3435 #include <linux/debugfs.h>
3536 #include <linux/seq_file.h>
3637 #endif
37
-
38
-#include <mach/hardware.h>
3938
4039 /*
4140 * USB device configuration structure
....@@ -115,6 +114,11 @@
115114 bool wedge;
116115 };
117116
117
+enum atx_type {
118
+ ISP1301,
119
+ STOTG04,
120
+};
121
+
118122 /*
119123 * Common UDC structure
120124 */
....@@ -129,8 +133,6 @@
129133
130134 /* Board and device specific */
131135 struct lpc32xx_usbd_cfg *board;
132
- u32 io_p_start;
133
- u32 io_p_size;
134136 void __iomem *udp_baseaddr;
135137 int udp_irq[4];
136138 struct clk *usb_slv_clk;
....@@ -151,10 +153,10 @@
151153 u8 last_vbus;
152154 int pullup;
153155 int poweron;
156
+ enum atx_type atx;
154157
155158 /* Work queues related to I2C support */
156159 struct work_struct pullup_job;
157
- struct work_struct vbus_job;
158160 struct work_struct power_job;
159161
160162 /* USB device peripheral - various */
....@@ -493,7 +495,7 @@
493495 }
494496 }
495497
496
-static int proc_udc_show(struct seq_file *s, void *unused)
498
+static int udc_show(struct seq_file *s, void *unused)
497499 {
498500 struct lpc32xx_udc *udc = s->private;
499501 struct lpc32xx_ep *ep;
....@@ -522,22 +524,11 @@
522524 return 0;
523525 }
524526
525
-static int proc_udc_open(struct inode *inode, struct file *file)
526
-{
527
- return single_open(file, proc_udc_show, PDE_DATA(inode));
528
-}
529
-
530
-static const struct file_operations proc_ops = {
531
- .owner = THIS_MODULE,
532
- .open = proc_udc_open,
533
- .read = seq_read,
534
- .llseek = seq_lseek,
535
- .release = single_release,
536
-};
527
+DEFINE_SHOW_ATTRIBUTE(udc);
537528
538529 static void create_debug_file(struct lpc32xx_udc *udc)
539530 {
540
- udc->pde = debugfs_create_file(debug_filename, 0, NULL, udc, &proc_ops);
531
+ udc->pde = debugfs_create_file(debug_filename, 0, NULL, udc, &udc_fops);
541532 }
542533
543534 static void remove_debug_file(struct lpc32xx_udc *udc)
....@@ -553,6 +544,15 @@
553544 /* Primary initialization sequence for the ISP1301 transceiver */
554545 static void isp1301_udc_configure(struct lpc32xx_udc *udc)
555546 {
547
+ u8 value;
548
+ s32 vendor, product;
549
+
550
+ vendor = i2c_smbus_read_word_data(udc->isp1301_i2c_client, 0x00);
551
+ product = i2c_smbus_read_word_data(udc->isp1301_i2c_client, 0x02);
552
+
553
+ if (vendor == 0x0483 && product == 0xa0c4)
554
+ udc->atx = STOTG04;
555
+
556556 /* LPC32XX only supports DAT_SE0 USB mode */
557557 /* This sequence is important */
558558
....@@ -572,8 +572,12 @@
572572 */
573573 i2c_smbus_write_byte_data(udc->isp1301_i2c_client,
574574 (ISP1301_I2C_MODE_CONTROL_2 | ISP1301_I2C_REG_CLEAR_ADDR), ~0);
575
+
576
+ value = MC2_BI_DI;
577
+ if (udc->atx != STOTG04)
578
+ value |= MC2_SPD_SUSP_CTRL;
575579 i2c_smbus_write_byte_data(udc->isp1301_i2c_client,
576
- ISP1301_I2C_MODE_CONTROL_2, (MC2_BI_DI | MC2_SPD_SUSP_CTRL));
580
+ ISP1301_I2C_MODE_CONTROL_2, value);
577581
578582 /* Driver VBUS_DRV high or low depending on board setup */
579583 if (udc->board->vbus_drv_pol != 0)
....@@ -601,24 +605,19 @@
601605 (ISP1301_I2C_OTG_CONTROL_1 | ISP1301_I2C_REG_CLEAR_ADDR),
602606 OTG1_VBUS_DISCHRG);
603607
604
- /* Clear and enable VBUS high edge interrupt */
605608 i2c_smbus_write_byte_data(udc->isp1301_i2c_client,
606609 ISP1301_I2C_INTERRUPT_LATCH | ISP1301_I2C_REG_CLEAR_ADDR, ~0);
610
+
607611 i2c_smbus_write_byte_data(udc->isp1301_i2c_client,
608612 ISP1301_I2C_INTERRUPT_FALLING | ISP1301_I2C_REG_CLEAR_ADDR, ~0);
609613 i2c_smbus_write_byte_data(udc->isp1301_i2c_client,
610
- ISP1301_I2C_INTERRUPT_FALLING, INT_VBUS_VLD);
611
- i2c_smbus_write_byte_data(udc->isp1301_i2c_client,
612614 ISP1301_I2C_INTERRUPT_RISING | ISP1301_I2C_REG_CLEAR_ADDR, ~0);
613
- i2c_smbus_write_byte_data(udc->isp1301_i2c_client,
614
- ISP1301_I2C_INTERRUPT_RISING, INT_VBUS_VLD);
615615
616
- dev_info(udc->dev, "ISP1301 Vendor ID : 0x%04x\n",
617
- i2c_smbus_read_word_data(udc->isp1301_i2c_client, 0x00));
618
- dev_info(udc->dev, "ISP1301 Product ID : 0x%04x\n",
619
- i2c_smbus_read_word_data(udc->isp1301_i2c_client, 0x02));
616
+ dev_info(udc->dev, "ISP1301 Vendor ID : 0x%04x\n", vendor);
617
+ dev_info(udc->dev, "ISP1301 Product ID : 0x%04x\n", product);
620618 dev_info(udc->dev, "ISP1301 Version ID : 0x%04x\n",
621619 i2c_smbus_read_word_data(udc->isp1301_i2c_client, 0x14));
620
+
622621 }
623622
624623 /* Enables or disables the USB device pullup via the ISP1301 transceiver */
....@@ -661,6 +660,10 @@
661660 /* Powers up or down the ISP1301 transceiver */
662661 static void isp1301_set_powerstate(struct lpc32xx_udc *udc, int enable)
663662 {
663
+ /* There is no "global power down" register for stotg04 */
664
+ if (udc->atx == STOTG04)
665
+ return;
666
+
664667 if (enable != 0)
665668 /* Power up ISP1301 - this ISP1301 will automatically wakeup
666669 when VBUS is detected */
....@@ -727,7 +730,6 @@
727730 * response data */
728731 static u32 udc_protocol_cmd_r(struct lpc32xx_udc *udc, u32 cmd)
729732 {
730
- u32 tmp;
731733 int to = 1000;
732734
733735 /* Write a command and read data from the protocol engine */
....@@ -737,7 +739,6 @@
737739 /* Write command code */
738740 udc_protocol_cmd_w(udc, cmd);
739741
740
- tmp = readl(USBD_DEVINTST(udc->udp_baseaddr));
741742 while ((!(readl(USBD_DEVINTST(udc->udp_baseaddr)) & USBD_CDFULL))
742743 && (to > 0))
743744 to--;
....@@ -1139,7 +1140,7 @@
11391140 u32 *p32, tmp, cbytes;
11401141
11411142 /* Use optimal data transfer method based on source address and size */
1142
- switch (((u32) data) & 0x3) {
1143
+ switch (((uintptr_t) data) & 0x3) {
11431144 case 0: /* 32-bit aligned */
11441145 p32 = (u32 *) data;
11451146 cbytes = (bytes & ~0x3);
....@@ -1240,7 +1241,7 @@
12401241 u32 *p32, tmp, cbytes;
12411242
12421243 /* Use optimal data transfer method based on source address and size */
1243
- switch (((u32) data) & 0x3) {
1244
+ switch (((uintptr_t) data) & 0x3) {
12441245 case 0: /* 32-bit aligned */
12451246 p32 = (u32 *) data;
12461247 cbytes = (bytes & ~0x3);
....@@ -1914,7 +1915,7 @@
19141915 };
19151916
19161917 /* Send a ZLP on a non-0 IN EP */
1917
-void udc_send_in_zlp(struct lpc32xx_udc *udc, struct lpc32xx_ep *ep)
1918
+static void udc_send_in_zlp(struct lpc32xx_udc *udc, struct lpc32xx_ep *ep)
19181919 {
19191920 /* Clear EP status */
19201921 udc_clearep_getsts(udc, ep->hwep_num);
....@@ -1928,7 +1929,7 @@
19281929 * This function will only be called when a delayed ZLP needs to be sent out
19291930 * after a DMA transfer has filled both buffers.
19301931 */
1931
-void udc_handle_eps(struct lpc32xx_udc *udc, struct lpc32xx_ep *ep)
1932
+static void udc_handle_eps(struct lpc32xx_udc *udc, struct lpc32xx_ep *ep)
19321933 {
19331934 u32 epstatus;
19341935 struct lpc32xx_request *req;
....@@ -1978,7 +1979,7 @@
19781979 /* DMA end of transfer completion */
19791980 static void udc_handle_dma_ep(struct lpc32xx_udc *udc, struct lpc32xx_ep *ep)
19801981 {
1981
- u32 status, epstatus;
1982
+ u32 status;
19821983 struct lpc32xx_request *req;
19831984 struct lpc32xx_usbd_dd_gad *dd;
19841985
....@@ -2072,7 +2073,7 @@
20722073 if (udc_clearep_getsts(udc, ep->hwep_num) & EP_SEL_F) {
20732074 udc_clearep_getsts(udc, ep->hwep_num);
20742075 uda_enable_hwepint(udc, ep->hwep_num);
2075
- epstatus = udc_clearep_getsts(udc, ep->hwep_num);
2076
+ udc_clearep_getsts(udc, ep->hwep_num);
20762077
20772078 /* Let the EP interrupt handle the ZLP */
20782079 return;
....@@ -2184,7 +2185,7 @@
21842185 struct lpc32xx_ep *ep, *ep0 = &udc->ep[0];
21852186 struct usb_ctrlrequest ctrlpkt;
21862187 int i, bytes;
2187
- u16 wIndex, wValue, wLength, reqtype, req, tmp;
2188
+ u16 wIndex, wValue, reqtype, req, tmp;
21882189
21892190 /* Nuke previous transfers */
21902191 nuke(ep0, -EPROTO);
....@@ -2200,7 +2201,6 @@
22002201 /* Native endianness */
22012202 wIndex = le16_to_cpu(ctrlpkt.wIndex);
22022203 wValue = le16_to_cpu(ctrlpkt.wValue);
2203
- wLength = le16_to_cpu(ctrlpkt.wLength);
22042204 reqtype = le16_to_cpu(ctrlpkt.bRequestType);
22052205
22062206 /* Set direction of EP0 */
....@@ -2251,7 +2251,7 @@
22512251 default:
22522252 break;
22532253 }
2254
-
2254
+ break;
22552255
22562256 case USB_REQ_SET_ADDRESS:
22572257 if (reqtype == (USB_TYPE_STANDARD | USB_RECIP_DEVICE)) {
....@@ -2830,11 +2830,9 @@
28302830 * VBUS detection, pullup handler, and Gadget cable state notification
28312831 *
28322832 */
2833
-static void vbus_work(struct work_struct *work)
2833
+static void vbus_work(struct lpc32xx_udc *udc)
28342834 {
28352835 u8 value;
2836
- struct lpc32xx_udc *udc = container_of(work, struct lpc32xx_udc,
2837
- vbus_job);
28382836
28392837 if (udc->enabled != 0) {
28402838 /* Discharge VBUS real quick */
....@@ -2870,18 +2868,13 @@
28702868 lpc32xx_vbus_session(&udc->gadget, udc->vbus);
28712869 }
28722870 }
2873
-
2874
- /* Re-enable after completion */
2875
- enable_irq(udc->udp_irq[IRQ_USB_ATX]);
28762871 }
28772872
28782873 static irqreturn_t lpc32xx_usb_vbus_irq(int irq, void *_udc)
28792874 {
28802875 struct lpc32xx_udc *udc = _udc;
28812876
2882
- /* Defer handling of VBUS IRQ to work queue */
2883
- disable_irq_nosync(udc->udp_irq[IRQ_USB_ATX]);
2884
- schedule_work(&udc->vbus_job);
2877
+ vbus_work(udc);
28852878
28862879 return IRQ_HANDLED;
28872880 }
....@@ -2890,7 +2883,6 @@
28902883 struct usb_gadget_driver *driver)
28912884 {
28922885 struct lpc32xx_udc *udc = to_udc(gadget);
2893
- int i;
28942886
28952887 if (!driver || driver->max_speed < USB_SPEED_FULL || !driver->setup) {
28962888 dev_err(udc->dev, "bad parameter.\n");
....@@ -2910,22 +2902,25 @@
29102902
29112903 /* Force VBUS process once to check for cable insertion */
29122904 udc->last_vbus = udc->vbus = 0;
2913
- schedule_work(&udc->vbus_job);
2905
+ vbus_work(udc);
29142906
2915
- /* Do not re-enable ATX IRQ (3) */
2916
- for (i = IRQ_USB_LP; i < IRQ_USB_ATX; i++)
2917
- enable_irq(udc->udp_irq[i]);
2907
+ /* enable interrupts */
2908
+ i2c_smbus_write_byte_data(udc->isp1301_i2c_client,
2909
+ ISP1301_I2C_INTERRUPT_FALLING, INT_SESS_VLD | INT_VBUS_VLD);
2910
+ i2c_smbus_write_byte_data(udc->isp1301_i2c_client,
2911
+ ISP1301_I2C_INTERRUPT_RISING, INT_SESS_VLD | INT_VBUS_VLD);
29182912
29192913 return 0;
29202914 }
29212915
29222916 static int lpc32xx_stop(struct usb_gadget *gadget)
29232917 {
2924
- int i;
29252918 struct lpc32xx_udc *udc = to_udc(gadget);
29262919
2927
- for (i = IRQ_USB_LP; i <= IRQ_USB_ATX; i++)
2928
- disable_irq(udc->udp_irq[i]);
2920
+ i2c_smbus_write_byte_data(udc->isp1301_i2c_client,
2921
+ ISP1301_I2C_INTERRUPT_FALLING | ISP1301_I2C_REG_CLEAR_ADDR, ~0);
2922
+ i2c_smbus_write_byte_data(udc->isp1301_i2c_client,
2923
+ ISP1301_I2C_INTERRUPT_RISING | ISP1301_I2C_REG_CLEAR_ADDR, ~0);
29292924
29302925 if (udc->clocked) {
29312926 spin_lock(&udc->lock);
....@@ -2980,7 +2975,7 @@
29802975 /* Enable or disable USB remote wakeup */
29812976 }
29822977
2983
-struct lpc32xx_usbd_cfg lpc32xx_usbddata = {
2978
+static struct lpc32xx_usbd_cfg lpc32xx_usbddata = {
29842979 .vbus_drv_pol = 0,
29852980 .conn_chgb = &lpc32xx_usbd_conn_chg,
29862981 .susp_chgb = &lpc32xx_usbd_susp_chg,
....@@ -2995,11 +2990,10 @@
29952990 struct device *dev = &pdev->dev;
29962991 struct lpc32xx_udc *udc;
29972992 int retval, i;
2998
- struct resource *res;
29992993 dma_addr_t dma_handle;
30002994 struct device_node *isp1301_node;
30012995
3002
- udc = kmemdup(&controller_template, sizeof(*udc), GFP_KERNEL);
2996
+ udc = devm_kmemdup(dev, &controller_template, sizeof(*udc), GFP_KERNEL);
30032997 if (!udc)
30042998 return -ENOMEM;
30052999
....@@ -3021,9 +3015,9 @@
30213015 }
30223016
30233017 udc->isp1301_i2c_client = isp1301_get_client(isp1301_node);
3018
+ of_node_put(isp1301_node);
30243019 if (!udc->isp1301_i2c_client) {
3025
- retval = -EPROBE_DEFER;
3026
- goto phy_fail;
3020
+ return -EPROBE_DEFER;
30273021 }
30283022
30293023 dev_info(udc->dev, "ISP1301 I2C device at address 0x%x\n",
....@@ -3032,7 +3026,7 @@
30323026 pdev->dev.dma_mask = &lpc32xx_usbd_dmamask;
30333027 retval = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
30343028 if (retval)
3035
- goto resource_fail;
3029
+ return retval;
30363030
30373031 udc->board = &lpc32xx_usbddata;
30383032
....@@ -3044,59 +3038,39 @@
30443038 * IORESOURCE_IRQ, USB device interrupt number
30453039 * IORESOURCE_IRQ, USB transceiver interrupt number
30463040 */
3047
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
3048
- if (!res) {
3049
- retval = -ENXIO;
3050
- goto resource_fail;
3051
- }
30523041
30533042 spin_lock_init(&udc->lock);
30543043
30553044 /* Get IRQs */
30563045 for (i = 0; i < 4; i++) {
30573046 udc->udp_irq[i] = platform_get_irq(pdev, i);
3058
- if (udc->udp_irq[i] < 0) {
3059
- dev_err(udc->dev,
3060
- "irq resource %d not available!\n", i);
3061
- retval = udc->udp_irq[i];
3062
- goto irq_fail;
3063
- }
3047
+ if (udc->udp_irq[i] < 0)
3048
+ return udc->udp_irq[i];
30643049 }
30653050
3066
- udc->io_p_start = res->start;
3067
- udc->io_p_size = resource_size(res);
3068
- if (!request_mem_region(udc->io_p_start, udc->io_p_size, driver_name)) {
3069
- dev_err(udc->dev, "someone's using UDC memory\n");
3070
- retval = -EBUSY;
3071
- goto request_mem_region_fail;
3072
- }
3073
-
3074
- udc->udp_baseaddr = ioremap(udc->io_p_start, udc->io_p_size);
3075
- if (!udc->udp_baseaddr) {
3076
- retval = -ENOMEM;
3051
+ udc->udp_baseaddr = devm_platform_ioremap_resource(pdev, 0);
3052
+ if (IS_ERR(udc->udp_baseaddr)) {
30773053 dev_err(udc->dev, "IO map failure\n");
3078
- goto io_map_fail;
3054
+ return PTR_ERR(udc->udp_baseaddr);
30793055 }
30803056
30813057 /* Get USB device clock */
3082
- udc->usb_slv_clk = clk_get(&pdev->dev, NULL);
3058
+ udc->usb_slv_clk = devm_clk_get(&pdev->dev, NULL);
30833059 if (IS_ERR(udc->usb_slv_clk)) {
30843060 dev_err(udc->dev, "failed to acquire USB device clock\n");
3085
- retval = PTR_ERR(udc->usb_slv_clk);
3086
- goto usb_clk_get_fail;
3061
+ return PTR_ERR(udc->usb_slv_clk);
30873062 }
30883063
30893064 /* Enable USB device clock */
30903065 retval = clk_prepare_enable(udc->usb_slv_clk);
30913066 if (retval < 0) {
30923067 dev_err(udc->dev, "failed to start USB device clock\n");
3093
- goto usb_clk_enable_fail;
3068
+ return retval;
30943069 }
30953070
30963071 /* Setup deferred workqueue data */
30973072 udc->poweron = udc->pullup = 0;
30983073 INIT_WORK(&udc->pullup_job, pullup_work);
3099
- INIT_WORK(&udc->vbus_job, vbus_work);
31003074 #ifdef CONFIG_PM
31013075 INIT_WORK(&udc->power_job, power_work);
31023076 #endif
....@@ -3134,46 +3108,43 @@
31343108
31353109 /* Request IRQs - low and high priority USB device IRQs are routed to
31363110 * the same handler, while the DMA interrupt is routed elsewhere */
3137
- retval = request_irq(udc->udp_irq[IRQ_USB_LP], lpc32xx_usb_lp_irq,
3138
- 0, "udc_lp", udc);
3111
+ retval = devm_request_irq(dev, udc->udp_irq[IRQ_USB_LP],
3112
+ lpc32xx_usb_lp_irq, 0, "udc_lp", udc);
31393113 if (retval < 0) {
31403114 dev_err(udc->dev, "LP request irq %d failed\n",
31413115 udc->udp_irq[IRQ_USB_LP]);
3142
- goto irq_lp_fail;
3116
+ goto irq_req_fail;
31433117 }
3144
- retval = request_irq(udc->udp_irq[IRQ_USB_HP], lpc32xx_usb_hp_irq,
3145
- 0, "udc_hp", udc);
3118
+ retval = devm_request_irq(dev, udc->udp_irq[IRQ_USB_HP],
3119
+ lpc32xx_usb_hp_irq, 0, "udc_hp", udc);
31463120 if (retval < 0) {
31473121 dev_err(udc->dev, "HP request irq %d failed\n",
31483122 udc->udp_irq[IRQ_USB_HP]);
3149
- goto irq_hp_fail;
3123
+ goto irq_req_fail;
31503124 }
31513125
3152
- retval = request_irq(udc->udp_irq[IRQ_USB_DEVDMA],
3153
- lpc32xx_usb_devdma_irq, 0, "udc_dma", udc);
3126
+ retval = devm_request_irq(dev, udc->udp_irq[IRQ_USB_DEVDMA],
3127
+ lpc32xx_usb_devdma_irq, 0, "udc_dma", udc);
31543128 if (retval < 0) {
31553129 dev_err(udc->dev, "DEV request irq %d failed\n",
31563130 udc->udp_irq[IRQ_USB_DEVDMA]);
3157
- goto irq_dev_fail;
3131
+ goto irq_req_fail;
31583132 }
31593133
31603134 /* The transceiver interrupt is used for VBUS detection and will
31613135 kick off the VBUS handler function */
3162
- retval = request_irq(udc->udp_irq[IRQ_USB_ATX], lpc32xx_usb_vbus_irq,
3163
- 0, "udc_otg", udc);
3136
+ retval = devm_request_threaded_irq(dev, udc->udp_irq[IRQ_USB_ATX], NULL,
3137
+ lpc32xx_usb_vbus_irq, IRQF_ONESHOT,
3138
+ "udc_otg", udc);
31643139 if (retval < 0) {
31653140 dev_err(udc->dev, "VBUS request irq %d failed\n",
31663141 udc->udp_irq[IRQ_USB_ATX]);
3167
- goto irq_xcvr_fail;
3142
+ goto irq_req_fail;
31683143 }
31693144
31703145 /* Initialize wait queue */
31713146 init_waitqueue_head(&udc->ep_disable_wait_queue);
31723147 atomic_set(&udc->enabled_ep_cnt, 0);
3173
-
3174
- /* Keep all IRQs disabled until GadgetFS starts up */
3175
- for (i = IRQ_USB_LP; i <= IRQ_USB_ATX; i++)
3176
- disable_irq(udc->udp_irq[i]);
31773148
31783149 retval = usb_add_gadget_udc(dev, &udc->gadget);
31793150 if (retval < 0)
....@@ -3190,32 +3161,15 @@
31903161 return 0;
31913162
31923163 add_gadget_fail:
3193
- free_irq(udc->udp_irq[IRQ_USB_ATX], udc);
3194
-irq_xcvr_fail:
3195
- free_irq(udc->udp_irq[IRQ_USB_DEVDMA], udc);
3196
-irq_dev_fail:
3197
- free_irq(udc->udp_irq[IRQ_USB_HP], udc);
3198
-irq_hp_fail:
3199
- free_irq(udc->udp_irq[IRQ_USB_LP], udc);
3200
-irq_lp_fail:
3164
+irq_req_fail:
32013165 dma_pool_destroy(udc->dd_cache);
32023166 dma_alloc_fail:
32033167 dma_free_coherent(&pdev->dev, UDCA_BUFF_SIZE,
32043168 udc->udca_v_base, udc->udca_p_base);
32053169 i2c_fail:
32063170 clk_disable_unprepare(udc->usb_slv_clk);
3207
-usb_clk_enable_fail:
3208
- clk_put(udc->usb_slv_clk);
3209
-usb_clk_get_fail:
3210
- iounmap(udc->udp_baseaddr);
3211
-io_map_fail:
3212
- release_mem_region(udc->io_p_start, udc->io_p_size);
32133171 dev_err(udc->dev, "%s probe failed, %d\n", driver_name, retval);
3214
-request_mem_region_fail:
3215
-irq_fail:
3216
-resource_fail:
3217
-phy_fail:
3218
- kfree(udc);
3172
+
32193173 return retval;
32203174 }
32213175
....@@ -3231,24 +3185,14 @@
32313185 udc_disable(udc);
32323186 pullup(udc, 0);
32333187
3234
- free_irq(udc->udp_irq[IRQ_USB_ATX], udc);
3235
-
32363188 device_init_wakeup(&pdev->dev, 0);
32373189 remove_debug_file(udc);
32383190
32393191 dma_pool_destroy(udc->dd_cache);
32403192 dma_free_coherent(&pdev->dev, UDCA_BUFF_SIZE,
32413193 udc->udca_v_base, udc->udca_p_base);
3242
- free_irq(udc->udp_irq[IRQ_USB_DEVDMA], udc);
3243
- free_irq(udc->udp_irq[IRQ_USB_HP], udc);
3244
- free_irq(udc->udp_irq[IRQ_USB_LP], udc);
32453194
32463195 clk_disable_unprepare(udc->usb_slv_clk);
3247
- clk_put(udc->usb_slv_clk);
3248
-
3249
- iounmap(udc->udp_baseaddr);
3250
- release_mem_region(udc->io_p_start, udc->io_p_size);
3251
- kfree(udc);
32523196
32533197 return 0;
32543198 }
....@@ -3314,7 +3258,7 @@
33143258 .suspend = lpc32xx_udc_suspend,
33153259 .resume = lpc32xx_udc_resume,
33163260 .driver = {
3317
- .name = (char *) driver_name,
3261
+ .name = driver_name,
33183262 .of_match_table = of_match_ptr(lpc32xx_udc_of_match),
33193263 },
33203264 };