diff options
Diffstat (limited to 'drivers/usb/gadget/f_sdp.c')
-rw-r--r-- | drivers/usb/gadget/f_sdp.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/drivers/usb/gadget/f_sdp.c b/drivers/usb/gadget/f_sdp.c index dd7b9cddb1..43c5cfbb77 100644 --- a/drivers/usb/gadget/f_sdp.c +++ b/drivers/usb/gadget/f_sdp.c @@ -230,6 +230,11 @@ static struct usb_gadget_strings *sdp_generic_strings[] = { NULL, }; +static inline void *sdp_ptr(u32 val) +{ + return (void *)(uintptr_t)val; +} + static void sdp_rx_command_complete(struct usb_ep *ep, struct usb_request *req) { struct f_sdp *sdp = req->context; @@ -238,12 +243,12 @@ static void sdp_rx_command_complete(struct usb_ep *ep, struct usb_request *req) u8 report = data[0]; if (status != 0) { - pr_err("Status: %d", status); + pr_err("Status: %d\n", status); return; } if (report != 1) { - pr_err("Unexpected report %d", report); + pr_err("Unexpected report %d\n", report); return; } @@ -323,12 +328,12 @@ static void sdp_rx_data_complete(struct usb_ep *ep, struct usb_request *req) int datalen = req->length - 1; if (status != 0) { - pr_err("Status: %d", status); + pr_err("Status: %d\n", status); return; } if (report != 2) { - pr_err("Unexpected report %d", report); + pr_err("Unexpected report %d\n", report); return; } @@ -344,7 +349,7 @@ static void sdp_rx_data_complete(struct usb_ep *ep, struct usb_request *req) } if (sdp->state == SDP_STATE_RX_FILE_DATA) { - memcpy((void *)sdp->dnl_address, req->buf + 1, datalen); + memcpy(sdp_ptr(sdp->dnl_address), req->buf + 1, datalen); sdp->dnl_address += datalen; } @@ -361,7 +366,7 @@ static void sdp_rx_data_complete(struct usb_ep *ep, struct usb_request *req) sdp->state = SDP_STATE_TX_SEC_CONF; break; default: - pr_err("Invalid state: %d", sdp->state); + pr_err("Invalid state: %d\n", sdp->state); } } @@ -371,7 +376,7 @@ static void sdp_tx_complete(struct usb_ep *ep, struct usb_request *req) int status = req->status; if (status != 0) { - pr_err("Status: %d", status); + pr_err("Status: %d\n", status); return; } @@ -394,7 +399,7 @@ static void sdp_tx_complete(struct usb_ep *ep, struct usb_request *req) sdp->state = SDP_STATE_IDLE; break; default: - pr_err("Wrong State: %d", sdp->state); + pr_err("Wrong State: %d\n", sdp->state); sdp->state = SDP_STATE_IDLE; break; } @@ -622,7 +627,7 @@ static u32 sdp_jump_imxheader(void *address) } printf("Jumping to 0x%08x\n", headerv2->entry); - entry = (void *)headerv2->entry; + entry = sdp_ptr(headerv2->entry); entry(); /* The image probably never returns hence we won't reach that point */ @@ -665,7 +670,7 @@ static void sdp_handle_in_ep(void) if (datalen > 64) datalen = 64; - memcpy(&data[1], (void *)sdp_func->dnl_address, datalen); + memcpy(&data[1], sdp_ptr(sdp_func->dnl_address), datalen); sdp_func->in_req->length = 65; sdp_func->dnl_bytes_remaining -= datalen; @@ -676,7 +681,7 @@ static void sdp_handle_in_ep(void) break; case SDP_STATE_JUMP: printf("Jumping to header at 0x%08x\n", sdp_func->jmp_address); - status = sdp_jump_imxheader((void *)sdp_func->jmp_address); + status = sdp_jump_imxheader(sdp_ptr(sdp_func->jmp_address)); /* If imx header fails, try some U-Boot specific headers */ if (status) { |