Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1406147 > unrolled thread

[char-misc-next 6/7] mei: amthif: use mei_cl_alloc_cb for allocating cbs

Started byTomas Winkler <tomas.winkler@intel.com>
First post2016-05-24 15:10 +0200
Last post2016-05-24 15:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [char-misc-next 6/7] mei: amthif: use mei_cl_alloc_cb for allocating cbs Tomas Winkler <tomas.winkler@intel.com> - 2016-05-24 15:10 +0200

#1406147 — [char-misc-next 6/7] mei: amthif: use mei_cl_alloc_cb for allocating cbs

FromTomas Winkler <tomas.winkler@intel.com>
Date2016-05-24 15:10 +0200
Subject[char-misc-next 6/7] mei: amthif: use mei_cl_alloc_cb for allocating cbs
Message-ID<rCkfU-3Ft-39@gated-at.bofh.it>
From: Alexander Usyskin <alexander.usyskin@intel.com>

Use mei_cl_alloc_cb wrapper instead of open code steps

Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
---
 drivers/misc/mei/amthif.c | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)

diff --git a/drivers/misc/mei/amthif.c b/drivers/misc/mei/amthif.c
index 9885fa40a120..14b454143c81 100644
--- a/drivers/misc/mei/amthif.c
+++ b/drivers/misc/mei/amthif.c
@@ -196,17 +196,10 @@ static int mei_amthif_read_start(struct mei_cl *cl, const struct file *file)
 {
 	struct mei_device *dev = cl->dev;
 	struct mei_cl_cb *cb;
-	int rets;
-
-	cb = mei_io_cb_init(cl, MEI_FOP_READ, file);
-	if (!cb) {
-		rets = -ENOMEM;
-		goto err;
-	}
 
-	rets = mei_io_cb_alloc_buf(cb, mei_cl_mtu(cl));
-	if (rets)
-		goto err;
+	cb = mei_cl_alloc_cb(cl, mei_cl_mtu(cl), MEI_FOP_READ, file);
+	if (!cb)
+		return -ENOMEM;
 
 	list_add_tail(&cb->list, &dev->ctrl_wr_list.list);
 
@@ -214,9 +207,6 @@ static int mei_amthif_read_start(struct mei_cl *cl, const struct file *file)
 	dev->iamthif_fp = cb->fp;
 
 	return 0;
-err:
-	mei_io_cb_free(cb);
-	return rets;
 }
 
 /**
-- 
2.5.5

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web