mei: use mei_cl_is_connected consistently
authorTomas Winkler <tomas.winkler@intel.com>
Thu, 26 Mar 2015 22:27:58 +0000 (00:27 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Apr 2015 14:18:56 +0000 (16:18 +0200)
Replace open coded check for cl->state !=/== MEI_FILE_CONNECTED
with mei_cl_is_connected function.

Note that cl->state != MEI_FILE_CONNECTED is not the same
as cl->state == MEI_FILE_DISCONNECTED

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/mei/bus.c
drivers/misc/mei/client.c
drivers/misc/mei/interrupt.c
drivers/misc/mei/main.c
drivers/misc/mei/wd.c

index 45896f9..b724a67 100644 (file)
@@ -238,7 +238,7 @@ static ssize_t ___mei_cl_send(struct mei_cl *cl, u8 *buf, size_t length,
        dev = cl->dev;
 
        mutex_lock(&dev->device_lock);
-       if (cl->state != MEI_FILE_CONNECTED) {
+       if (!mei_cl_is_connected(cl)) {
                rets = -ENODEV;
                goto out;
        }
@@ -474,7 +474,7 @@ int mei_cl_disable_device(struct mei_cl_device *device)
 
        mutex_lock(&dev->device_lock);
 
-       if (cl->state != MEI_FILE_CONNECTED) {
+       if (!mei_cl_is_connected(cl)) {
                dev_err(dev->dev, "Already disconnected");
                err = 0;
                goto out;
index e5aeb6f..1e99ef6 100644 (file)
@@ -876,7 +876,7 @@ int mei_cl_connect(struct mei_cl *cl, struct file *file)
                        mei_secs_to_jiffies(MEI_CL_CONNECT_TIMEOUT));
        mutex_lock(&dev->device_lock);
 
-       if (cl->state != MEI_FILE_CONNECTED) {
+       if (!mei_cl_is_connected(cl)) {
                cl->state = MEI_FILE_DISCONNECTED;
                /* something went really wrong */
                if (!cl->status)
Simple merge
Simple merge
Simple merge