static int softupd_unbind(struct usb_composite_dev *cdev) { graw_cleanup(); gphonet_cleanup(); return 0; }
static int __exit nokia_unbind(struct usb_composite_dev *cdev) { gphonet_cleanup(); gserial_cleanup(); gether_cleanup(); return 0; }
static int __exit nokia_unbind(struct usb_composite_dev *cdev) { gphonet_cleanup(); gserial_cleanup(); gether_cleanup(); // usb_gadget_disconnect(cdev->gadget); // return 0; }
static int __init nokia_bind(struct usb_composite_dev *cdev) { int gcnum; struct usb_gadget *gadget = cdev->gadget; int status; status = gphonet_setup(cdev->gadget); if (status < 0) goto err_phonet; status = gserial_setup(cdev->gadget, 3); if (status < 0) goto err_serial; status = gether_setup(cdev->gadget, hostaddr); if (status < 0) goto err_ether; status = usb_string_id(cdev); if (status < 0) goto err_usb; strings_dev[STRING_MANUFACTURER_IDX].id = status; device_desc.iManufacturer = status; status = usb_string_id(cdev); if (status < 0) goto err_usb; strings_dev[STRING_PRODUCT_IDX].id = status; device_desc.iProduct = status; /* config description */ status = usb_string_id(cdev); if (status < 0) goto err_usb; strings_dev[STRING_DESCRIPTION_IDX].id = status; nokia_config_500ma_driver.iConfiguration = status; nokia_config_100ma_driver.iConfiguration = status; /* set up other descriptors */ gcnum = usb_gadget_controller_number(gadget); if (gcnum >= 0) device_desc.bcdDevice = cpu_to_le16(NOKIA_VERSION_NUM); else { /* this should only work with hw that supports altsettings * and several endpoints, anything else, panic. */ pr_err("nokia_bind: controller '%s' not recognized\n", gadget->name); goto err_usb; } /* finaly register the configuration */ status = usb_add_config(cdev, &nokia_config_500ma_driver, nokia_bind_config); if (status < 0) goto err_usb; status = usb_add_config(cdev, &nokia_config_100ma_driver, nokia_bind_config); if (status < 0) goto err_usb; dev_info(&gadget->dev, "%s\n", NOKIA_LONG_NAME); return 0; err_usb: gether_cleanup(); err_ether: gserial_cleanup(); err_serial: gphonet_cleanup(); err_phonet: return status; }
static int __init softupd_bind(struct usb_composite_dev *cdev) { struct usb_gadget *gadget = cdev->gadget; int status; int gcnum; status = gphonet_setup(cdev->gadget); if (status < 0) goto err_phonet; status = graw_setup(cdev->gadget); if (status < 0) goto err_raw; status = usb_string_id(cdev); if (status < 0) goto err_usb; strings_dev[STRING_MANUFACTURER_IDX].id = status; device_desc.iManufacturer = status; status = usb_string_id(cdev); if (status < 0) goto err_usb; strings_dev[STRING_PRODUCT_IDX].id = status; device_desc.iProduct = status; status = usb_string_id(cdev); if (status < 0) goto err_usb; strings_dev[STRING_SERIAL_IDX].id = status; device_desc.iSerialNumber = status; /* config description */ status = usb_string_id(cdev); if (status < 0) goto err_usb; strings_dev[STRING_DESCRIPTION_IDX].id = status; softupd_config_driver.iConfiguration = status; /* set up other descriptors */ gcnum = usb_gadget_controller_number(gadget); if (gcnum >= 0) device_desc.bcdDevice = cpu_to_le16(NOKIA_VERSION_NUM); else { /* this should only work with hw that supports altsettings * and several endpoints, anything else, panic. */ pr_err("%s: controller '%s' not recognized\n", __func__, gadget->name); goto err_usb; } /* finaly register the configuration */ status = usb_add_config(cdev, &softupd_config_driver); if (status < 0) goto err_usb; INFO(cdev, "%s\n", product_nokia); return 0; err_usb: graw_cleanup(); err_raw: gphonet_cleanup(); err_phonet: return status; }