return req;
}
+static void acc_set_disconnected(struct acc_dev *dev)
+{
+ dev->online = 0;
+ dev->disconnected = 1;
+
+ /* clear all accessory strings */
+ memset(dev->manufacturer, 0, sizeof(dev->manufacturer));
+ memset(dev->model, 0, sizeof(dev->model));
+ memset(dev->description, 0, sizeof(dev->description));
+ memset(dev->version, 0, sizeof(dev->version));
+ memset(dev->uri, 0, sizeof(dev->uri));
+}
+
static void acc_complete_in(struct usb_ep *ep, struct usb_request *req)
{
struct acc_dev *dev = _acc_dev;
- if (req->status != 0) {
- dev->online = 0;
- dev->disconnected = 1;
- }
+ if (req->status != 0)
+ acc_set_disconnected(dev);
req_put(dev, &dev->tx_idle, req);
struct acc_dev *dev = _acc_dev;
dev->rx_done = 1;
- if (req->status != 0) {
- dev->online = 0;
- dev->disconnected = 1;
- }
+ if (req->status != 0)
+ acc_set_disconnected(dev);
wake_up(&dev->read_wq);
}
struct usb_composite_dev *cdev = dev->cdev;
DBG(cdev, "acc_function_disable\n");
- dev->online = 0;
+ acc_set_disconnected(dev);
usb_ep_disable(dev->ep_in);
usb_ep_disable(dev->ep_out);