From: Alexander Usyskin Date: Sun, 7 Feb 2016 21:35:32 +0000 (+0200) Subject: mei: bus: move driver api functions at the start of the file X-Git-Tag: v4.1.22~129 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=79b768dec5d354aeb143f51db11e0cbb758176fb;p=platform%2Fkernel%2Flinux-exynos.git mei: bus: move driver api functions at the start of the file [ Upstream commit 6238299774377b12c3e24507b100b2687eb5ea32 ] To make the file more organize move mei client driver api to the start of the file and add Kdoc. There are no functional changes in this patch. Signed-off-by: Tomas Winkler Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c index 4cf38c3..883ba74fb 100644 --- a/drivers/misc/mei/bus.c +++ b/drivers/misc/mei/bus.c @@ -238,6 +238,11 @@ static ssize_t ___mei_cl_send(struct mei_cl *cl, u8 *buf, size_t length, dev = cl->dev; mutex_lock(&dev->device_lock); + if (dev->dev_state != MEI_DEV_ENABLED) { + rets = -ENODEV; + goto out; + } + if (!mei_cl_is_connected(cl)) { rets = -ENODEV; goto out; @@ -287,6 +292,10 @@ ssize_t __mei_cl_recv(struct mei_cl *cl, u8 *buf, size_t length) dev = cl->dev; mutex_lock(&dev->device_lock); + if (dev->dev_state != MEI_DEV_ENABLED) { + rets = -ENODEV; + goto out; + } cb = mei_cl_read_cb(cl, NULL); if (cb)