mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
usb: gadget: configfs: make sure to reactivate function on unbind
If a configs function sets bind_deactivated flag, upon removal it will be left with an unbalanced deactivation. Let's make sure that we conditionally call usb_function_activate() from purge_configs_funcs() and make sure purge_configs_funcs() is called from configfs_composite_unbind(). Change-Id: Ibe91837fdb7754f8af343a18138556901a0e089f Signed-off-by: William Wu <william.wu@rock-chips.com>
This commit is contained in:
@@ -1254,6 +1254,9 @@ static void purge_configs_funcs(struct gadget_info *gi)
|
||||
f->name, f);
|
||||
f->unbind(c, f);
|
||||
}
|
||||
|
||||
if (f->bind_deactivated)
|
||||
usb_function_activate(f);
|
||||
}
|
||||
c->next_interface_id = 0;
|
||||
memset(c->interface, 0, sizeof(c->interface));
|
||||
|
||||
Reference in New Issue
Block a user