mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
boards/boardctl: Uninitialize cdcacm by instance number, not direct pointer
When uninitializing cdcacm via a boardctl ioctl, use the instance number instead of direct pointer to the driver. The reason for this is, that in CONFIG_BUILD_KERNEL the applications sercon and serdis can't store the pointer; they are separate processes which get killed. The cdcacm driver will search up the driver from the file system when the direct pointer is not given. Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
This commit is contained in:
parent
2435caa925
commit
f66d4a001c
1 changed files with 1 additions and 3 deletions
|
|
@ -133,7 +133,6 @@ static inline int
|
|||
case BOARDIOC_USBDEV_CONNECT: /* Connect the CDC/ACM device */
|
||||
#ifndef CONFIG_CDCACM_COMPOSITE
|
||||
{
|
||||
DEBUGASSERT(ctrl->handle != NULL);
|
||||
ret = cdcacm_initialize(ctrl->instance, ctrl->handle);
|
||||
}
|
||||
#endif
|
||||
|
|
@ -141,8 +140,7 @@ static inline int
|
|||
|
||||
case BOARDIOC_USBDEV_DISCONNECT: /* Disconnect the CDC/ACM device */
|
||||
{
|
||||
DEBUGASSERT(ctrl->handle != NULL && *ctrl->handle != NULL);
|
||||
cdcacm_uninitialize(*ctrl->handle);
|
||||
ret = cdcacm_uninitialize_instance(ctrl->instance, NULL);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue