diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2015-05-04 09:43:53 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-05-24 11:13:10 -0700 |
commit | 0c53357ca4b3a03aafc211de663e84dba7c628e2 (patch) | |
tree | c7b92825a458cacd641021e1118ea6a49b0610c6 /drivers/misc/mei/bus.c | |
parent | 3c66618295ca5fb0fde32e60e5f26557a5fcad5e (diff) | |
download | blackbird-op-linux-0c53357ca4b3a03aafc211de663e84dba7c628e2.tar.gz blackbird-op-linux-0c53357ca4b3a03aafc211de663e84dba7c628e2.zip |
mei: revamp client connection
Simplify connect state machine by changing the logic around
Connection request in progress - only check if we have a callback in
relevant queue.
Extract common code into mei_cl_send_connect() function
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei/bus.c')
-rw-r--r-- | drivers/misc/mei/bus.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c index 873c1b6e45e8..00b0cb2075fb 100644 --- a/drivers/misc/mei/bus.c +++ b/drivers/misc/mei/bus.c @@ -436,6 +436,12 @@ int mei_cl_enable_device(struct mei_cl_device *device) mutex_lock(&dev->device_lock); + if (mei_cl_is_connected(cl)) { + mutex_unlock(&dev->device_lock); + dev_warn(dev->dev, "Already connected"); + return -EBUSY; + } + err = mei_cl_connect(cl, NULL); if (err < 0) { mutex_unlock(&dev->device_lock); |