From f3de9b635d93a3d268adda428e1df94091506a42 Mon Sep 17 00:00:00 2001 From: Tomas Winkler Date: Fri, 27 Mar 2015 00:27:58 +0200 Subject: mei: use mei_cl_is_connected consistently 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 Signed-off-by: Greg Kroah-Hartman --- drivers/misc/mei/bus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/misc/mei/bus.c') diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c index 45896f95fed1..b724a67696fc 100644 --- a/drivers/misc/mei/bus.c +++ b/drivers/misc/mei/bus.c @@ -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; -- cgit v1.2.3