alloc class name after the necessary commands are completed
This commit is contained in:
@@ -72,6 +72,10 @@ static int usbh_mtp_connect(struct usbh_hubport *hport, uint8_t intf)
|
||||
}
|
||||
}
|
||||
|
||||
strncpy(hport->config.intf[intf].devname, DEV_FORMAT, CONFIG_USBHOST_DEV_NAMELEN);
|
||||
|
||||
USB_LOG_INFO("Register MTP Class:%s\r\n", hport->config.intf[intf].devname);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -98,9 +102,10 @@ static int usbh_mtp_disconnect(struct usbh_hubport *hport, uint8_t intf)
|
||||
|
||||
usb_free(mtp_class);
|
||||
|
||||
USB_LOG_INFO("Unregister MTP Class:%s\r\n", hport->config.intf[intf].devname);
|
||||
memset(hport->config.intf[intf].devname, 0, CONFIG_USBHOST_DEV_NAMELEN);
|
||||
if (hport->config.intf[intf].devname[0] != '\0')
|
||||
USB_LOG_INFO("Unregister MTP Class:%s\r\n", hport->config.intf[intf].devname);
|
||||
|
||||
memset(hport->config.intf[intf].devname, 0, CONFIG_USBHOST_DEV_NAMELEN);
|
||||
hport->config.intf[intf].priv = NULL;
|
||||
hport->config.intf[intf + 1].priv = NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user