diff options
Diffstat (limited to 'drivers/usb/host/xhci-mem.c')
-rw-r--r-- | drivers/usb/host/xhci-mem.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index 5711048708d7..4df752cb0f78 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c | |||
@@ -41,13 +41,13 @@ static struct xhci_segment *xhci_segment_alloc(struct xhci_hcd *xhci, gfp_t flag | |||
41 | 41 | ||
42 | seg = kzalloc(sizeof *seg, flags); | 42 | seg = kzalloc(sizeof *seg, flags); |
43 | if (!seg) | 43 | if (!seg) |
44 | return 0; | 44 | return NULL; |
45 | xhci_dbg(xhci, "Allocating priv segment structure at %p\n", seg); | 45 | xhci_dbg(xhci, "Allocating priv segment structure at %p\n", seg); |
46 | 46 | ||
47 | seg->trbs = dma_pool_alloc(xhci->segment_pool, flags, &dma); | 47 | seg->trbs = dma_pool_alloc(xhci->segment_pool, flags, &dma); |
48 | if (!seg->trbs) { | 48 | if (!seg->trbs) { |
49 | kfree(seg); | 49 | kfree(seg); |
50 | return 0; | 50 | return NULL; |
51 | } | 51 | } |
52 | xhci_dbg(xhci, "// Allocating segment at %p (virtual) 0x%llx (DMA)\n", | 52 | xhci_dbg(xhci, "// Allocating segment at %p (virtual) 0x%llx (DMA)\n", |
53 | seg->trbs, (unsigned long long)dma); | 53 | seg->trbs, (unsigned long long)dma); |
@@ -159,7 +159,7 @@ static struct xhci_ring *xhci_ring_alloc(struct xhci_hcd *xhci, | |||
159 | ring = kzalloc(sizeof *(ring), flags); | 159 | ring = kzalloc(sizeof *(ring), flags); |
160 | xhci_dbg(xhci, "Allocating ring at %p\n", ring); | 160 | xhci_dbg(xhci, "Allocating ring at %p\n", ring); |
161 | if (!ring) | 161 | if (!ring) |
162 | return 0; | 162 | return NULL; |
163 | 163 | ||
164 | INIT_LIST_HEAD(&ring->td_list); | 164 | INIT_LIST_HEAD(&ring->td_list); |
165 | if (num_segs == 0) | 165 | if (num_segs == 0) |
@@ -196,7 +196,7 @@ static struct xhci_ring *xhci_ring_alloc(struct xhci_hcd *xhci, | |||
196 | 196 | ||
197 | fail: | 197 | fail: |
198 | xhci_ring_free(xhci, ring); | 198 | xhci_ring_free(xhci, ring); |
199 | return 0; | 199 | return NULL; |
200 | } | 200 | } |
201 | 201 | ||
202 | void xhci_free_or_cache_endpoint_ring(struct xhci_hcd *xhci, | 202 | void xhci_free_or_cache_endpoint_ring(struct xhci_hcd *xhci, |
@@ -247,7 +247,7 @@ static void xhci_reinit_cached_ring(struct xhci_hcd *xhci, | |||
247 | 247 | ||
248 | #define CTX_SIZE(_hcc) (HCC_64BYTE_CONTEXT(_hcc) ? 64 : 32) | 248 | #define CTX_SIZE(_hcc) (HCC_64BYTE_CONTEXT(_hcc) ? 64 : 32) |
249 | 249 | ||
250 | struct xhci_container_ctx *xhci_alloc_container_ctx(struct xhci_hcd *xhci, | 250 | static struct xhci_container_ctx *xhci_alloc_container_ctx(struct xhci_hcd *xhci, |
251 | int type, gfp_t flags) | 251 | int type, gfp_t flags) |
252 | { | 252 | { |
253 | struct xhci_container_ctx *ctx = kzalloc(sizeof(*ctx), flags); | 253 | struct xhci_container_ctx *ctx = kzalloc(sizeof(*ctx), flags); |
@@ -265,7 +265,7 @@ struct xhci_container_ctx *xhci_alloc_container_ctx(struct xhci_hcd *xhci, | |||
265 | return ctx; | 265 | return ctx; |
266 | } | 266 | } |
267 | 267 | ||
268 | void xhci_free_container_ctx(struct xhci_hcd *xhci, | 268 | static void xhci_free_container_ctx(struct xhci_hcd *xhci, |
269 | struct xhci_container_ctx *ctx) | 269 | struct xhci_container_ctx *ctx) |
270 | { | 270 | { |
271 | if (!ctx) | 271 | if (!ctx) |
@@ -764,7 +764,7 @@ void xhci_free_virt_device(struct xhci_hcd *xhci, int slot_id) | |||
764 | xhci_free_container_ctx(xhci, dev->out_ctx); | 764 | xhci_free_container_ctx(xhci, dev->out_ctx); |
765 | 765 | ||
766 | kfree(xhci->devs[slot_id]); | 766 | kfree(xhci->devs[slot_id]); |
767 | xhci->devs[slot_id] = 0; | 767 | xhci->devs[slot_id] = NULL; |
768 | } | 768 | } |
769 | 769 | ||
770 | int xhci_alloc_virt_device(struct xhci_hcd *xhci, int slot_id, | 770 | int xhci_alloc_virt_device(struct xhci_hcd *xhci, int slot_id, |
@@ -1779,7 +1779,7 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) | |||
1779 | */ | 1779 | */ |
1780 | init_completion(&xhci->addr_dev); | 1780 | init_completion(&xhci->addr_dev); |
1781 | for (i = 0; i < MAX_HC_SLOTS; ++i) | 1781 | for (i = 0; i < MAX_HC_SLOTS; ++i) |
1782 | xhci->devs[i] = 0; | 1782 | xhci->devs[i] = NULL; |
1783 | 1783 | ||
1784 | if (scratchpad_alloc(xhci, flags)) | 1784 | if (scratchpad_alloc(xhci, flags)) |
1785 | goto fail; | 1785 | goto fail; |