diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2010-12-03 15:10:06 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-12-03 15:10:29 -0500 |
commit | 367576b813ed66a000e66ec18f7082bbc84c05d7 (patch) | |
tree | cfc804c46533855492d0f2fcd3580db308b739d2 | |
parent | 16350a7258a3158807f3fafe33f1bb22b8ddd127 (diff) | |
parent | 0607f8622953541e95030ab011258d9f1f381357 (diff) |
Merge branch 'for-next' of git://gitorious.org/usb/usb into usb-next
* 'for-next' of git://gitorious.org/usb/usb:
usb: musb: gadget: prevent a NULL pointer dereference
usb: musb: add names for IRQs in structure resource
usb: musb: remove board_data parameter from musb_platform_init()
-rw-r--r-- | arch/arm/mach-davinci/usb.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-omap2/usb-musb.c | 2 | ||||
-rw-r--r-- | arch/blackfin/mach-bf527/boards/cm_bf527.c | 2 | ||||
-rw-r--r-- | arch/blackfin/mach-bf527/boards/ezbrd.c | 2 | ||||
-rw-r--r-- | arch/blackfin/mach-bf527/boards/ezkit.c | 2 | ||||
-rw-r--r-- | arch/blackfin/mach-bf548/boards/cm_bf548.c | 2 | ||||
-rw-r--r-- | arch/blackfin/mach-bf548/boards/ezkit.c | 2 | ||||
-rw-r--r-- | drivers/usb/musb/blackfin.c | 2 | ||||
-rw-r--r-- | drivers/usb/musb/cppi_dma.c | 2 | ||||
-rw-r--r-- | drivers/usb/musb/davinci.c | 2 | ||||
-rw-r--r-- | drivers/usb/musb/musb_core.c | 4 | ||||
-rw-r--r-- | drivers/usb/musb/musb_core.h | 2 | ||||
-rw-r--r-- | drivers/usb/musb/musb_gadget.c | 13 | ||||
-rw-r--r-- | drivers/usb/musb/musbhsdma.c | 2 | ||||
-rw-r--r-- | drivers/usb/musb/omap2430.c | 6 | ||||
-rw-r--r-- | drivers/usb/musb/tusb6010.c | 2 |
16 files changed, 34 insertions, 15 deletions
diff --git a/arch/arm/mach-davinci/usb.c b/arch/arm/mach-davinci/usb.c index 31f0cbea0caa..b0d6b07431c0 100644 --- a/arch/arm/mach-davinci/usb.c +++ b/arch/arm/mach-davinci/usb.c | |||
@@ -64,10 +64,12 @@ static struct resource usb_resources[] = { | |||
64 | { | 64 | { |
65 | .start = IRQ_USBINT, | 65 | .start = IRQ_USBINT, |
66 | .flags = IORESOURCE_IRQ, | 66 | .flags = IORESOURCE_IRQ, |
67 | .name = "mc" | ||
67 | }, | 68 | }, |
68 | { | 69 | { |
69 | /* placeholder for the dedicated CPPI IRQ */ | 70 | /* placeholder for the dedicated CPPI IRQ */ |
70 | .flags = IORESOURCE_IRQ, | 71 | .flags = IORESOURCE_IRQ, |
72 | .name = "dma" | ||
71 | }, | 73 | }, |
72 | }; | 74 | }; |
73 | 75 | ||
diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c index 72605584bfff..8dae0fa5905e 100644 --- a/arch/arm/mach-omap2/usb-musb.c +++ b/arch/arm/mach-omap2/usb-musb.c | |||
@@ -40,10 +40,12 @@ static struct resource musb_resources[] = { | |||
40 | [1] = { /* general IRQ */ | 40 | [1] = { /* general IRQ */ |
41 | .start = INT_243X_HS_USB_MC, | 41 | .start = INT_243X_HS_USB_MC, |
42 | .flags = IORESOURCE_IRQ, | 42 | .flags = IORESOURCE_IRQ, |
43 | .name = "mc", | ||
43 | }, | 44 | }, |
44 | [2] = { /* DMA IRQ */ | 45 | [2] = { /* DMA IRQ */ |
45 | .start = INT_243X_HS_USB_DMA, | 46 | .start = INT_243X_HS_USB_DMA, |
46 | .flags = IORESOURCE_IRQ, | 47 | .flags = IORESOURCE_IRQ, |
48 | .name = "dma", | ||
47 | }, | 49 | }, |
48 | }; | 50 | }; |
49 | 51 | ||
diff --git a/arch/blackfin/mach-bf527/boards/cm_bf527.c b/arch/blackfin/mach-bf527/boards/cm_bf527.c index 2c31af7a320a..f714d7be35b9 100644 --- a/arch/blackfin/mach-bf527/boards/cm_bf527.c +++ b/arch/blackfin/mach-bf527/boards/cm_bf527.c | |||
@@ -82,11 +82,13 @@ static struct resource musb_resources[] = { | |||
82 | .start = IRQ_USB_INT0, | 82 | .start = IRQ_USB_INT0, |
83 | .end = IRQ_USB_INT0, | 83 | .end = IRQ_USB_INT0, |
84 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | 84 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
85 | .name = "mc" | ||
85 | }, | 86 | }, |
86 | [2] = { /* DMA IRQ */ | 87 | [2] = { /* DMA IRQ */ |
87 | .start = IRQ_USB_DMA, | 88 | .start = IRQ_USB_DMA, |
88 | .end = IRQ_USB_DMA, | 89 | .end = IRQ_USB_DMA, |
89 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | 90 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
91 | .name = "dma" | ||
90 | }, | 92 | }, |
91 | }; | 93 | }; |
92 | 94 | ||
diff --git a/arch/blackfin/mach-bf527/boards/ezbrd.c b/arch/blackfin/mach-bf527/boards/ezbrd.c index 9a736a850c5c..315eec930604 100644 --- a/arch/blackfin/mach-bf527/boards/ezbrd.c +++ b/arch/blackfin/mach-bf527/boards/ezbrd.c | |||
@@ -46,11 +46,13 @@ static struct resource musb_resources[] = { | |||
46 | .start = IRQ_USB_INT0, | 46 | .start = IRQ_USB_INT0, |
47 | .end = IRQ_USB_INT0, | 47 | .end = IRQ_USB_INT0, |
48 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | 48 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
49 | .name = "mc" | ||
49 | }, | 50 | }, |
50 | [2] = { /* DMA IRQ */ | 51 | [2] = { /* DMA IRQ */ |
51 | .start = IRQ_USB_DMA, | 52 | .start = IRQ_USB_DMA, |
52 | .end = IRQ_USB_DMA, | 53 | .end = IRQ_USB_DMA, |
53 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | 54 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
55 | .name = "dma" | ||
54 | }, | 56 | }, |
55 | }; | 57 | }; |
56 | 58 | ||
diff --git a/arch/blackfin/mach-bf527/boards/ezkit.c b/arch/blackfin/mach-bf527/boards/ezkit.c index 9222bc00bbd3..273731279740 100644 --- a/arch/blackfin/mach-bf527/boards/ezkit.c +++ b/arch/blackfin/mach-bf527/boards/ezkit.c | |||
@@ -86,11 +86,13 @@ static struct resource musb_resources[] = { | |||
86 | .start = IRQ_USB_INT0, | 86 | .start = IRQ_USB_INT0, |
87 | .end = IRQ_USB_INT0, | 87 | .end = IRQ_USB_INT0, |
88 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | 88 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
89 | .name = "mc" | ||
89 | }, | 90 | }, |
90 | [2] = { /* DMA IRQ */ | 91 | [2] = { /* DMA IRQ */ |
91 | .start = IRQ_USB_DMA, | 92 | .start = IRQ_USB_DMA, |
92 | .end = IRQ_USB_DMA, | 93 | .end = IRQ_USB_DMA, |
93 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | 94 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
95 | .name = "dma" | ||
94 | }, | 96 | }, |
95 | }; | 97 | }; |
96 | 98 | ||
diff --git a/arch/blackfin/mach-bf548/boards/cm_bf548.c b/arch/blackfin/mach-bf548/boards/cm_bf548.c index f0c0eef95ba8..3e3dfb23f94e 100644 --- a/arch/blackfin/mach-bf548/boards/cm_bf548.c +++ b/arch/blackfin/mach-bf548/boards/cm_bf548.c | |||
@@ -482,11 +482,13 @@ static struct resource musb_resources[] = { | |||
482 | .start = IRQ_USB_INT0, | 482 | .start = IRQ_USB_INT0, |
483 | .end = IRQ_USB_INT0, | 483 | .end = IRQ_USB_INT0, |
484 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | 484 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
485 | .name = "mc" | ||
485 | }, | 486 | }, |
486 | [2] = { /* DMA IRQ */ | 487 | [2] = { /* DMA IRQ */ |
487 | .start = IRQ_USB_DMA, | 488 | .start = IRQ_USB_DMA, |
488 | .end = IRQ_USB_DMA, | 489 | .end = IRQ_USB_DMA, |
489 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | 490 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
491 | .name = "dma" | ||
490 | }, | 492 | }, |
491 | }; | 493 | }; |
492 | 494 | ||
diff --git a/arch/blackfin/mach-bf548/boards/ezkit.c b/arch/blackfin/mach-bf548/boards/ezkit.c index 216e26999af9..9ff166d6f00d 100644 --- a/arch/blackfin/mach-bf548/boards/ezkit.c +++ b/arch/blackfin/mach-bf548/boards/ezkit.c | |||
@@ -587,11 +587,13 @@ static struct resource musb_resources[] = { | |||
587 | .start = IRQ_USB_INT0, | 587 | .start = IRQ_USB_INT0, |
588 | .end = IRQ_USB_INT0, | 588 | .end = IRQ_USB_INT0, |
589 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | 589 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
590 | .name = "mc" | ||
590 | }, | 591 | }, |
591 | [2] = { /* DMA IRQ */ | 592 | [2] = { /* DMA IRQ */ |
592 | .start = IRQ_USB_DMA, | 593 | .start = IRQ_USB_DMA, |
593 | .end = IRQ_USB_DMA, | 594 | .end = IRQ_USB_DMA, |
594 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, | 595 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, |
596 | .name = "dma" | ||
595 | }, | 597 | }, |
596 | }; | 598 | }; |
597 | 599 | ||
diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c index 611a9d274363..e8cbcc59c419 100644 --- a/drivers/usb/musb/blackfin.c +++ b/drivers/usb/musb/blackfin.c | |||
@@ -323,7 +323,7 @@ int musb_platform_set_mode(struct musb *musb, u8 musb_mode) | |||
323 | return -EIO; | 323 | return -EIO; |
324 | } | 324 | } |
325 | 325 | ||
326 | int __init musb_platform_init(struct musb *musb, void *board_data) | 326 | int __init musb_platform_init(struct musb *musb) |
327 | { | 327 | { |
328 | 328 | ||
329 | /* | 329 | /* |
diff --git a/drivers/usb/musb/cppi_dma.c b/drivers/usb/musb/cppi_dma.c index f5a65ff0ac2b..de55a3c3259a 100644 --- a/drivers/usb/musb/cppi_dma.c +++ b/drivers/usb/musb/cppi_dma.c | |||
@@ -1308,7 +1308,7 @@ dma_controller_create(struct musb *musb, void __iomem *mregs) | |||
1308 | struct cppi *controller; | 1308 | struct cppi *controller; |
1309 | struct device *dev = musb->controller; | 1309 | struct device *dev = musb->controller; |
1310 | struct platform_device *pdev = to_platform_device(dev); | 1310 | struct platform_device *pdev = to_platform_device(dev); |
1311 | int irq = platform_get_irq(pdev, 1); | 1311 | int irq = platform_get_irq_byname(pdev, "dma"); |
1312 | 1312 | ||
1313 | controller = kzalloc(sizeof *controller, GFP_KERNEL); | 1313 | controller = kzalloc(sizeof *controller, GFP_KERNEL); |
1314 | if (!controller) | 1314 | if (!controller) |
diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c index 6e67629f50cc..051e2bf1897a 100644 --- a/drivers/usb/musb/davinci.c +++ b/drivers/usb/musb/davinci.c | |||
@@ -376,7 +376,7 @@ int musb_platform_set_mode(struct musb *musb, u8 mode) | |||
376 | return -EIO; | 376 | return -EIO; |
377 | } | 377 | } |
378 | 378 | ||
379 | int __init musb_platform_init(struct musb *musb, void *board_data) | 379 | int __init musb_platform_init(struct musb *musb) |
380 | { | 380 | { |
381 | void __iomem *tibase = musb->ctrl_base; | 381 | void __iomem *tibase = musb->ctrl_base; |
382 | u32 revision; | 382 | u32 revision; |
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index c9f9024c5515..a5ceddfe57d6 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c | |||
@@ -2025,7 +2025,7 @@ bad_config: | |||
2025 | * isp1504, non-OTG, etc) mostly hooking up through ULPI. | 2025 | * isp1504, non-OTG, etc) mostly hooking up through ULPI. |
2026 | */ | 2026 | */ |
2027 | musb->isr = generic_interrupt; | 2027 | musb->isr = generic_interrupt; |
2028 | status = musb_platform_init(musb, plat->board_data); | 2028 | status = musb_platform_init(musb); |
2029 | if (status < 0) | 2029 | if (status < 0) |
2030 | goto fail2; | 2030 | goto fail2; |
2031 | 2031 | ||
@@ -2206,7 +2206,7 @@ static u64 *orig_dma_mask; | |||
2206 | static int __init musb_probe(struct platform_device *pdev) | 2206 | static int __init musb_probe(struct platform_device *pdev) |
2207 | { | 2207 | { |
2208 | struct device *dev = &pdev->dev; | 2208 | struct device *dev = &pdev->dev; |
2209 | int irq = platform_get_irq(pdev, 0); | 2209 | int irq = platform_get_irq_byname(pdev, "mc"); |
2210 | int status; | 2210 | int status; |
2211 | struct resource *iomem; | 2211 | struct resource *iomem; |
2212 | void __iomem *base; | 2212 | void __iomem *base; |
diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h index 69797e5b46a7..6ad72f395e28 100644 --- a/drivers/usb/musb/musb_core.h +++ b/drivers/usb/musb/musb_core.h | |||
@@ -614,7 +614,7 @@ extern int musb_platform_get_vbus_status(struct musb *musb); | |||
614 | #define musb_platform_get_vbus_status(x) 0 | 614 | #define musb_platform_get_vbus_status(x) 0 |
615 | #endif | 615 | #endif |
616 | 616 | ||
617 | extern int __init musb_platform_init(struct musb *musb, void *board_data); | 617 | extern int __init musb_platform_init(struct musb *musb); |
618 | extern int musb_platform_exit(struct musb *musb); | 618 | extern int musb_platform_exit(struct musb *musb); |
619 | 619 | ||
620 | #endif /* __MUSB_CORE_H__ */ | 620 | #endif /* __MUSB_CORE_H__ */ |
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index 5d815049cbaa..edff014edd3a 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c | |||
@@ -1072,13 +1072,16 @@ struct usb_request *musb_alloc_request(struct usb_ep *ep, gfp_t gfp_flags) | |||
1072 | struct musb_request *request = NULL; | 1072 | struct musb_request *request = NULL; |
1073 | 1073 | ||
1074 | request = kzalloc(sizeof *request, gfp_flags); | 1074 | request = kzalloc(sizeof *request, gfp_flags); |
1075 | if (request) { | 1075 | if (!request) { |
1076 | INIT_LIST_HEAD(&request->request.list); | 1076 | DBG(4, "not enough memory\n"); |
1077 | request->request.dma = DMA_ADDR_INVALID; | 1077 | return NULL; |
1078 | request->epnum = musb_ep->current_epnum; | ||
1079 | request->ep = musb_ep; | ||
1080 | } | 1078 | } |
1081 | 1079 | ||
1080 | INIT_LIST_HEAD(&request->request.list); | ||
1081 | request->request.dma = DMA_ADDR_INVALID; | ||
1082 | request->epnum = musb_ep->current_epnum; | ||
1083 | request->ep = musb_ep; | ||
1084 | |||
1082 | return &request->request; | 1085 | return &request->request; |
1083 | } | 1086 | } |
1084 | 1087 | ||
diff --git a/drivers/usb/musb/musbhsdma.c b/drivers/usb/musb/musbhsdma.c index 6f771af5cbdb..4e8183589624 100644 --- a/drivers/usb/musb/musbhsdma.c +++ b/drivers/usb/musb/musbhsdma.c | |||
@@ -363,7 +363,7 @@ dma_controller_create(struct musb *musb, void __iomem *base) | |||
363 | struct musb_dma_controller *controller; | 363 | struct musb_dma_controller *controller; |
364 | struct device *dev = musb->controller; | 364 | struct device *dev = musb->controller; |
365 | struct platform_device *pdev = to_platform_device(dev); | 365 | struct platform_device *pdev = to_platform_device(dev); |
366 | int irq = platform_get_irq(pdev, 1); | 366 | int irq = platform_get_irq_byname(pdev, "dma"); |
367 | 367 | ||
368 | if (irq == 0) { | 368 | if (irq == 0) { |
369 | dev_err(dev, "No DMA interrupt line!\n"); | 369 | dev_err(dev, "No DMA interrupt line!\n"); |
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index ed618bde1eec..27dabcf0a868 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c | |||
@@ -187,10 +187,12 @@ int musb_platform_set_mode(struct musb *musb, u8 musb_mode) | |||
187 | return 0; | 187 | return 0; |
188 | } | 188 | } |
189 | 189 | ||
190 | int __init musb_platform_init(struct musb *musb, void *board_data) | 190 | int __init musb_platform_init(struct musb *musb) |
191 | { | 191 | { |
192 | u32 l; | 192 | u32 l; |
193 | struct omap_musb_board_data *data = board_data; | 193 | struct device *dev = musb->controller; |
194 | struct musb_hdrc_platform_data *plat = dev->platform_data; | ||
195 | struct omap_musb_board_data *data = plat->board_data; | ||
194 | 196 | ||
195 | /* We require some kind of external transceiver, hooked | 197 | /* We require some kind of external transceiver, hooked |
196 | * up through ULPI. TWL4030-family PMICs include one, | 198 | * up through ULPI. TWL4030-family PMICs include one, |
diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c index bde40efc7046..41b04b906ce1 100644 --- a/drivers/usb/musb/tusb6010.c +++ b/drivers/usb/musb/tusb6010.c | |||
@@ -1091,7 +1091,7 @@ err: | |||
1091 | return -ENODEV; | 1091 | return -ENODEV; |
1092 | } | 1092 | } |
1093 | 1093 | ||
1094 | int __init musb_platform_init(struct musb *musb, void *board_data) | 1094 | int __init musb_platform_init(struct musb *musb) |
1095 | { | 1095 | { |
1096 | struct platform_device *pdev; | 1096 | struct platform_device *pdev; |
1097 | struct resource *mem; | 1097 | struct resource *mem; |