mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 02:50:43 +00:00
greybus: interface: add active state flag
Add active state flag to avoid deactivating an interface which is already off. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
parent
36602a2981
commit
1e1565e5fe
2 changed files with 8 additions and 0 deletions
|
@ -409,6 +409,8 @@ int gb_interface_activate(struct gb_interface *intf)
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
intf->active = true;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -419,7 +421,12 @@ int gb_interface_activate(struct gb_interface *intf)
|
|||
*/
|
||||
void gb_interface_deactivate(struct gb_interface *intf)
|
||||
{
|
||||
if (!intf->active)
|
||||
return;
|
||||
|
||||
gb_interface_route_destroy(intf);
|
||||
|
||||
intf->active = false;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -43,6 +43,7 @@ struct gb_interface {
|
|||
|
||||
bool disconnected;
|
||||
bool ejected;
|
||||
bool active;
|
||||
bool enabled;
|
||||
};
|
||||
#define to_gb_interface(d) container_of(d, struct gb_interface, dev)
|
||||
|
|
Loading…
Reference in a new issue