diff options
author | Johan Hovold <johan@hovoldconsulting.com> | 2016-04-23 18:47:25 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2016-04-25 11:08:30 -0700 |
commit | 36602a2981c85de7b0b8600eb12cbad3d80eacd9 (patch) | |
tree | 36d7d940d5c75957e5e0bc7fcaa67e6c18b2a532 /drivers/staging/greybus/interface.h | |
parent | b15d97d77017dc168c74c5e9aacfe14ff74dcbe9 (diff) |
greybus: module: implement controlled module removal
Implement controlled module removal through a new module attribute
"eject".
When a non-zero argument is written to the attribute, all interfaces of
the module are disabled (e.g. bundles are deregistered) and deactivated
(e.g. powered off) before instructing the SVC to physically eject the
module.
Note that the module device is not deregistered until the SVC has
reported the physical removal of all of its interfaces.
A new interface mutex is added to enforce interface state-change
serialisation.
Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/interface.h')
-rw-r--r-- | drivers/staging/greybus/interface.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/staging/greybus/interface.h b/drivers/staging/greybus/interface.h index 9185c7f1bd32..61399e7ea102 100644 --- a/drivers/staging/greybus/interface.h +++ b/drivers/staging/greybus/interface.h @@ -39,7 +39,10 @@ struct gb_interface { unsigned long quirks; + struct mutex mutex; + bool disconnected; + bool ejected; bool enabled; }; #define to_gb_interface(d) container_of(d, struct gb_interface, dev) |