diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2014-08-24 12:08:55 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-09-23 22:57:47 -0700 |
commit | d320832f64666089a06778782e42fac29abd7bf7 (patch) | |
tree | 19fd44ea6cd1b93a178763345a736f193284132f /drivers/misc/mei/bus.c | |
parent | 68d1aa65978b86b2ca5bdf7211b27cfd32c3212d (diff) |
mei: me_client lookup function to return me_client object
For support of dynamic addition and removal of me clients
it is more convenient to use a list instead of static array
as is use now.
As the first step of the transition to the new data structure
we change the lookup function so it returns me client address
instead of an index.
Signed-off-by: Tomas Winkler <tomas.winkler@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 | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c index 0e993ef28b9..c829676c471 100644 --- a/drivers/misc/mei/bus.c +++ b/drivers/misc/mei/bus.c @@ -229,8 +229,8 @@ static int ___mei_cl_send(struct mei_cl *cl, u8 *buf, size_t length, bool blocking) { struct mei_device *dev; + struct mei_me_client *me_cl; struct mei_cl_cb *cb; - int id; int rets; if (WARN_ON(!cl || !cl->dev)) @@ -242,11 +242,11 @@ static int ___mei_cl_send(struct mei_cl *cl, u8 *buf, size_t length, return -ENODEV; /* Check if we have an ME client device */ - id = mei_me_cl_by_id(dev, cl->me_client_id); - if (id < 0) - return id; + me_cl = mei_me_cl_by_id(dev, cl->me_client_id); + if (!me_cl) + return -ENOTTY; - if (length > dev->me_clients[id].props.max_msg_length) + if (length > me_cl->props.max_msg_length) return -EFBIG; cb = mei_io_cb_init(cl, NULL); |