| .. | .. |
|---|
| 326 | 326 | static void fotg210_start_dma(struct fotg210_ep *ep, |
|---|
| 327 | 327 | struct fotg210_request *req) |
|---|
| 328 | 328 | { |
|---|
| 329 | + struct device *dev = &ep->fotg210->gadget.dev; |
|---|
| 329 | 330 | dma_addr_t d; |
|---|
| 330 | 331 | u8 *buffer; |
|---|
| 331 | 332 | u32 length; |
|---|
| .. | .. |
|---|
| 349 | 350 | length = req->req.length - req->req.actual; |
|---|
| 350 | 351 | } |
|---|
| 351 | 352 | |
|---|
| 352 | | - d = dma_map_single(NULL, buffer, length, |
|---|
| 353 | + d = dma_map_single(dev, buffer, length, |
|---|
| 353 | 354 | ep->dir_in ? DMA_TO_DEVICE : DMA_FROM_DEVICE); |
|---|
| 354 | 355 | |
|---|
| 355 | | - if (dma_mapping_error(NULL, d)) { |
|---|
| 356 | + if (dma_mapping_error(dev, d)) { |
|---|
| 356 | 357 | pr_err("dma_mapping_error\n"); |
|---|
| 357 | 358 | return; |
|---|
| 358 | 359 | } |
|---|
| 359 | | - |
|---|
| 360 | | - dma_sync_single_for_device(NULL, d, length, |
|---|
| 361 | | - ep->dir_in ? DMA_TO_DEVICE : |
|---|
| 362 | | - DMA_FROM_DEVICE); |
|---|
| 363 | 360 | |
|---|
| 364 | 361 | fotg210_enable_dma(ep, d, length); |
|---|
| 365 | 362 | |
|---|
| .. | .. |
|---|
| 371 | 368 | /* update actual transfer length */ |
|---|
| 372 | 369 | req->req.actual += length; |
|---|
| 373 | 370 | |
|---|
| 374 | | - dma_unmap_single(NULL, d, length, DMA_TO_DEVICE); |
|---|
| 371 | + dma_unmap_single(dev, d, length, DMA_TO_DEVICE); |
|---|
| 375 | 372 | } |
|---|
| 376 | 373 | |
|---|
| 377 | 374 | static void fotg210_ep0_queue(struct fotg210_ep *ep, |
|---|
| .. | .. |
|---|
| 484 | 481 | struct fotg210_ep *ep; |
|---|
| 485 | 482 | struct fotg210_udc *fotg210; |
|---|
| 486 | 483 | unsigned long flags; |
|---|
| 487 | | - int ret = 0; |
|---|
| 488 | 484 | |
|---|
| 489 | 485 | ep = container_of(_ep, struct fotg210_ep, ep); |
|---|
| 490 | 486 | |
|---|
| .. | .. |
|---|
| 507 | 503 | } |
|---|
| 508 | 504 | |
|---|
| 509 | 505 | spin_unlock_irqrestore(&ep->fotg210->lock, flags); |
|---|
| 510 | | - return ret; |
|---|
| 506 | + return 0; |
|---|
| 511 | 507 | } |
|---|
| 512 | 508 | |
|---|
| 513 | 509 | static int fotg210_ep_set_halt(struct usb_ep *_ep, int value) |
|---|
| .. | .. |
|---|
| 633 | 629 | static void fotg210_set_address(struct fotg210_udc *fotg210, |
|---|
| 634 | 630 | struct usb_ctrlrequest *ctrl) |
|---|
| 635 | 631 | { |
|---|
| 636 | | - if (ctrl->wValue >= 0x0100) { |
|---|
| 632 | + if (le16_to_cpu(ctrl->wValue) >= 0x0100) { |
|---|
| 637 | 633 | fotg210_request_error(fotg210); |
|---|
| 638 | 634 | } else { |
|---|
| 639 | | - fotg210_set_dev_addr(fotg210, ctrl->wValue); |
|---|
| 635 | + fotg210_set_dev_addr(fotg210, le16_to_cpu(ctrl->wValue)); |
|---|
| 640 | 636 | fotg210_set_cxdone(fotg210); |
|---|
| 641 | 637 | } |
|---|
| 642 | 638 | } |
|---|
| .. | .. |
|---|
| 717 | 713 | |
|---|
| 718 | 714 | switch (ctrl->bRequestType & USB_RECIP_MASK) { |
|---|
| 719 | 715 | case USB_RECIP_DEVICE: |
|---|
| 720 | | - fotg210->ep0_data = 1 << USB_DEVICE_SELF_POWERED; |
|---|
| 716 | + fotg210->ep0_data = cpu_to_le16(1 << USB_DEVICE_SELF_POWERED); |
|---|
| 721 | 717 | break; |
|---|
| 722 | 718 | case USB_RECIP_INTERFACE: |
|---|
| 723 | | - fotg210->ep0_data = 0; |
|---|
| 719 | + fotg210->ep0_data = cpu_to_le16(0); |
|---|
| 724 | 720 | break; |
|---|
| 725 | 721 | case USB_RECIP_ENDPOINT: |
|---|
| 726 | 722 | epnum = ctrl->wIndex & USB_ENDPOINT_NUMBER_MASK; |
|---|
| 727 | 723 | if (epnum) |
|---|
| 728 | 724 | fotg210->ep0_data = |
|---|
| 729 | | - fotg210_is_epnstall(fotg210->ep[epnum]) |
|---|
| 730 | | - << USB_ENDPOINT_HALT; |
|---|
| 725 | + cpu_to_le16(fotg210_is_epnstall(fotg210->ep[epnum]) |
|---|
| 726 | + << USB_ENDPOINT_HALT); |
|---|
| 731 | 727 | else |
|---|
| 732 | 728 | fotg210_request_error(fotg210); |
|---|
| 733 | 729 | break; |
|---|
| .. | .. |
|---|
| 1213 | 1209 | |
|---|
| 1214 | 1210 | static struct platform_driver fotg210_driver = { |
|---|
| 1215 | 1211 | .driver = { |
|---|
| 1216 | | - .name = (char *)udc_name, |
|---|
| 1212 | + .name = udc_name, |
|---|
| 1217 | 1213 | }, |
|---|
| 1218 | 1214 | .probe = fotg210_udc_probe, |
|---|
| 1219 | 1215 | .remove = fotg210_udc_remove, |
|---|