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/nfc.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/nfc.c')
-rw-r--r-- | drivers/misc/mei/nfc.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/misc/mei/nfc.c b/drivers/misc/mei/nfc.c index 5ccc23bc7690..964b4c606646 100644 --- a/drivers/misc/mei/nfc.c +++ b/drivers/misc/mei/nfc.c @@ -480,7 +480,8 @@ int mei_nfc_host_init(struct mei_device *dev) { struct mei_nfc_dev *ndev = &nfc_dev; struct mei_cl *cl_info, *cl = NULL; - int i, ret; + struct mei_me_client *me_cl; + int ret; /* already initialized */ if (ndev->cl_info) @@ -498,14 +499,14 @@ int mei_nfc_host_init(struct mei_device *dev) } /* check for valid client id */ - i = mei_me_cl_by_uuid(dev, &mei_nfc_info_guid); - if (i < 0) { + me_cl = mei_me_cl_by_uuid(dev, &mei_nfc_info_guid); + if (!me_cl) { dev_info(&dev->pdev->dev, "nfc: failed to find the client\n"); ret = -ENOTTY; goto err; } - cl_info->me_client_id = dev->me_clients[i].client_id; + cl_info->me_client_id = me_cl->client_id; ret = mei_cl_link(cl_info, MEI_HOST_CLIENT_ID_ANY); if (ret) @@ -516,14 +517,14 @@ int mei_nfc_host_init(struct mei_device *dev) list_add_tail(&cl_info->device_link, &dev->device_list); /* check for valid client id */ - i = mei_me_cl_by_uuid(dev, &mei_nfc_guid); - if (i < 0) { + me_cl = mei_me_cl_by_uuid(dev, &mei_nfc_guid); + if (!me_cl) { dev_info(&dev->pdev->dev, "nfc: failed to find the client\n"); ret = -ENOTTY; goto err; } - cl->me_client_id = dev->me_clients[i].client_id; + cl->me_client_id = me_cl->client_id; ret = mei_cl_link(cl, MEI_HOST_CLIENT_ID_ANY); if (ret) |