Merge "USB: f_accessory: set manufacturer and model string to default value"
This commit is contained in:
commit
fd69ea1825
1 changed files with 6 additions and 3 deletions
|
@ -609,8 +609,7 @@ static ssize_t acc_read(struct file *fp, char __user *buf,
|
|||
{
|
||||
struct acc_dev *dev = fp->private_data;
|
||||
struct usb_request *req;
|
||||
ssize_t r = count;
|
||||
unsigned xfer;
|
||||
ssize_t r = count, xfer, len;
|
||||
int ret = 0;
|
||||
|
||||
pr_debug("acc_read(%zu)\n", count);
|
||||
|
@ -623,6 +622,8 @@ static ssize_t acc_read(struct file *fp, char __user *buf,
|
|||
if (count > BULK_BUFFER_SIZE)
|
||||
count = BULK_BUFFER_SIZE;
|
||||
|
||||
len = ALIGN(count, dev->ep_out->maxpacket);
|
||||
|
||||
/* we will block until we're online */
|
||||
pr_debug("acc_read: waiting for online\n");
|
||||
ret = wait_event_interruptible(dev->read_wq, dev->online);
|
||||
|
@ -640,7 +641,7 @@ static ssize_t acc_read(struct file *fp, char __user *buf,
|
|||
requeue_req:
|
||||
/* queue a request */
|
||||
req = dev->rx_req[0];
|
||||
req->length = count;
|
||||
req->length = len;
|
||||
dev->rx_done = 0;
|
||||
ret = usb_ep_queue(dev->ep_out, req, GFP_KERNEL);
|
||||
if (ret < 0) {
|
||||
|
@ -936,6 +937,8 @@ int acc_ctrlrequest(struct usb_composite_dev *cdev,
|
|||
memset(dev->serial, 0, sizeof(dev->serial));
|
||||
dev->start_requested = 0;
|
||||
dev->audio_mode = 0;
|
||||
strlcpy(dev->manufacturer, "Android", ACC_STRING_SIZE);
|
||||
strlcpy(dev->model, "Android", ACC_STRING_SIZE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue