Commit 367576b8 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

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()
parents 16350a72 0607f862
...@@ -64,10 +64,12 @@ static struct resource usb_resources[] = { ...@@ -64,10 +64,12 @@ static struct resource usb_resources[] = {
{ {
.start = IRQ_USBINT, .start = IRQ_USBINT,
.flags = IORESOURCE_IRQ, .flags = IORESOURCE_IRQ,
.name = "mc"
}, },
{ {
/* placeholder for the dedicated CPPI IRQ */ /* placeholder for the dedicated CPPI IRQ */
.flags = IORESOURCE_IRQ, .flags = IORESOURCE_IRQ,
.name = "dma"
}, },
}; };
......
...@@ -40,10 +40,12 @@ static struct resource musb_resources[] = { ...@@ -40,10 +40,12 @@ static struct resource musb_resources[] = {
[1] = { /* general IRQ */ [1] = { /* general IRQ */
.start = INT_243X_HS_USB_MC, .start = INT_243X_HS_USB_MC,
.flags = IORESOURCE_IRQ, .flags = IORESOURCE_IRQ,
.name = "mc",
}, },
[2] = { /* DMA IRQ */ [2] = { /* DMA IRQ */
.start = INT_243X_HS_USB_DMA, .start = INT_243X_HS_USB_DMA,
.flags = IORESOURCE_IRQ, .flags = IORESOURCE_IRQ,
.name = "dma",
}, },
}; };
......
...@@ -82,11 +82,13 @@ static struct resource musb_resources[] = { ...@@ -82,11 +82,13 @@ static struct resource musb_resources[] = {
.start = IRQ_USB_INT0, .start = IRQ_USB_INT0,
.end = IRQ_USB_INT0, .end = IRQ_USB_INT0,
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
.name = "mc"
}, },
[2] = { /* DMA IRQ */ [2] = { /* DMA IRQ */
.start = IRQ_USB_DMA, .start = IRQ_USB_DMA,
.end = IRQ_USB_DMA, .end = IRQ_USB_DMA,
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
.name = "dma"
}, },
}; };
......
...@@ -46,11 +46,13 @@ static struct resource musb_resources[] = { ...@@ -46,11 +46,13 @@ static struct resource musb_resources[] = {
.start = IRQ_USB_INT0, .start = IRQ_USB_INT0,
.end = IRQ_USB_INT0, .end = IRQ_USB_INT0,
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
.name = "mc"
}, },
[2] = { /* DMA IRQ */ [2] = { /* DMA IRQ */
.start = IRQ_USB_DMA, .start = IRQ_USB_DMA,
.end = IRQ_USB_DMA, .end = IRQ_USB_DMA,
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
.name = "dma"
}, },
}; };
......
...@@ -86,11 +86,13 @@ static struct resource musb_resources[] = { ...@@ -86,11 +86,13 @@ static struct resource musb_resources[] = {
.start = IRQ_USB_INT0, .start = IRQ_USB_INT0,
.end = IRQ_USB_INT0, .end = IRQ_USB_INT0,
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
.name = "mc"
}, },
[2] = { /* DMA IRQ */ [2] = { /* DMA IRQ */
.start = IRQ_USB_DMA, .start = IRQ_USB_DMA,
.end = IRQ_USB_DMA, .end = IRQ_USB_DMA,
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
.name = "dma"
}, },
}; };
......
...@@ -482,11 +482,13 @@ static struct resource musb_resources[] = { ...@@ -482,11 +482,13 @@ static struct resource musb_resources[] = {
.start = IRQ_USB_INT0, .start = IRQ_USB_INT0,
.end = IRQ_USB_INT0, .end = IRQ_USB_INT0,
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
.name = "mc"
}, },
[2] = { /* DMA IRQ */ [2] = { /* DMA IRQ */
.start = IRQ_USB_DMA, .start = IRQ_USB_DMA,
.end = IRQ_USB_DMA, .end = IRQ_USB_DMA,
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
.name = "dma"
}, },
}; };
......
...@@ -587,11 +587,13 @@ static struct resource musb_resources[] = { ...@@ -587,11 +587,13 @@ static struct resource musb_resources[] = {
.start = IRQ_USB_INT0, .start = IRQ_USB_INT0,
.end = IRQ_USB_INT0, .end = IRQ_USB_INT0,
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
.name = "mc"
}, },
[2] = { /* DMA IRQ */ [2] = { /* DMA IRQ */
.start = IRQ_USB_DMA, .start = IRQ_USB_DMA,
.end = IRQ_USB_DMA, .end = IRQ_USB_DMA,
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
.name = "dma"
}, },
}; };
......
...@@ -323,7 +323,7 @@ int musb_platform_set_mode(struct musb *musb, u8 musb_mode) ...@@ -323,7 +323,7 @@ int musb_platform_set_mode(struct musb *musb, u8 musb_mode)
return -EIO; return -EIO;
} }
int __init musb_platform_init(struct musb *musb, void *board_data) int __init musb_platform_init(struct musb *musb)
{ {
/* /*
......
...@@ -1308,7 +1308,7 @@ dma_controller_create(struct musb *musb, void __iomem *mregs) ...@@ -1308,7 +1308,7 @@ dma_controller_create(struct musb *musb, void __iomem *mregs)
struct cppi *controller; struct cppi *controller;
struct device *dev = musb->controller; struct device *dev = musb->controller;
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
int irq = platform_get_irq(pdev, 1); int irq = platform_get_irq_byname(pdev, "dma");
controller = kzalloc(sizeof *controller, GFP_KERNEL); controller = kzalloc(sizeof *controller, GFP_KERNEL);
if (!controller) if (!controller)
......
...@@ -376,7 +376,7 @@ int musb_platform_set_mode(struct musb *musb, u8 mode) ...@@ -376,7 +376,7 @@ int musb_platform_set_mode(struct musb *musb, u8 mode)
return -EIO; return -EIO;
} }
int __init musb_platform_init(struct musb *musb, void *board_data) int __init musb_platform_init(struct musb *musb)
{ {
void __iomem *tibase = musb->ctrl_base; void __iomem *tibase = musb->ctrl_base;
u32 revision; u32 revision;
......
...@@ -2025,7 +2025,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) ...@@ -2025,7 +2025,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
* isp1504, non-OTG, etc) mostly hooking up through ULPI. * isp1504, non-OTG, etc) mostly hooking up through ULPI.
*/ */
musb->isr = generic_interrupt; musb->isr = generic_interrupt;
status = musb_platform_init(musb, plat->board_data); status = musb_platform_init(musb);
if (status < 0) if (status < 0)
goto fail2; goto fail2;
...@@ -2206,7 +2206,7 @@ static u64 *orig_dma_mask; ...@@ -2206,7 +2206,7 @@ static u64 *orig_dma_mask;
static int __init musb_probe(struct platform_device *pdev) static int __init musb_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
int irq = platform_get_irq(pdev, 0); int irq = platform_get_irq_byname(pdev, "mc");
int status; int status;
struct resource *iomem; struct resource *iomem;
void __iomem *base; void __iomem *base;
......
...@@ -614,7 +614,7 @@ extern int musb_platform_get_vbus_status(struct musb *musb); ...@@ -614,7 +614,7 @@ extern int musb_platform_get_vbus_status(struct musb *musb);
#define musb_platform_get_vbus_status(x) 0 #define musb_platform_get_vbus_status(x) 0
#endif #endif
extern int __init musb_platform_init(struct musb *musb, void *board_data); extern int __init musb_platform_init(struct musb *musb);
extern int musb_platform_exit(struct musb *musb); extern int musb_platform_exit(struct musb *musb);
#endif /* __MUSB_CORE_H__ */ #endif /* __MUSB_CORE_H__ */
...@@ -1072,12 +1072,15 @@ struct usb_request *musb_alloc_request(struct usb_ep *ep, gfp_t gfp_flags) ...@@ -1072,12 +1072,15 @@ struct usb_request *musb_alloc_request(struct usb_ep *ep, gfp_t gfp_flags)
struct musb_request *request = NULL; struct musb_request *request = NULL;
request = kzalloc(sizeof *request, gfp_flags); request = kzalloc(sizeof *request, gfp_flags);
if (request) { if (!request) {
DBG(4, "not enough memory\n");
return NULL;
}
INIT_LIST_HEAD(&request->request.list); INIT_LIST_HEAD(&request->request.list);
request->request.dma = DMA_ADDR_INVALID; request->request.dma = DMA_ADDR_INVALID;
request->epnum = musb_ep->current_epnum; request->epnum = musb_ep->current_epnum;
request->ep = musb_ep; request->ep = musb_ep;
}
return &request->request; return &request->request;
} }
......
...@@ -363,7 +363,7 @@ dma_controller_create(struct musb *musb, void __iomem *base) ...@@ -363,7 +363,7 @@ dma_controller_create(struct musb *musb, void __iomem *base)
struct musb_dma_controller *controller; struct musb_dma_controller *controller;
struct device *dev = musb->controller; struct device *dev = musb->controller;
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
int irq = platform_get_irq(pdev, 1); int irq = platform_get_irq_byname(pdev, "dma");
if (irq == 0) { if (irq == 0) {
dev_err(dev, "No DMA interrupt line!\n"); dev_err(dev, "No DMA interrupt line!\n");
......
...@@ -187,10 +187,12 @@ int musb_platform_set_mode(struct musb *musb, u8 musb_mode) ...@@ -187,10 +187,12 @@ int musb_platform_set_mode(struct musb *musb, u8 musb_mode)
return 0; return 0;
} }
int __init musb_platform_init(struct musb *musb, void *board_data) int __init musb_platform_init(struct musb *musb)
{ {
u32 l; u32 l;
struct omap_musb_board_data *data = board_data; struct device *dev = musb->controller;
struct musb_hdrc_platform_data *plat = dev->platform_data;
struct omap_musb_board_data *data = plat->board_data;
/* We require some kind of external transceiver, hooked /* We require some kind of external transceiver, hooked
* up through ULPI. TWL4030-family PMICs include one, * up through ULPI. TWL4030-family PMICs include one,
......
...@@ -1091,7 +1091,7 @@ static int __init tusb_start(struct musb *musb) ...@@ -1091,7 +1091,7 @@ static int __init tusb_start(struct musb *musb)
return -ENODEV; return -ENODEV;
} }
int __init musb_platform_init(struct musb *musb, void *board_data) int __init musb_platform_init(struct musb *musb)
{ {
struct platform_device *pdev; struct platform_device *pdev;
struct resource *mem; struct resource *mem;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment