diff options
| author | Alexander Usyskin <alexander.usyskin@intel.com> | 2016-06-16 17:58:57 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-08-30 14:36:39 +0200 |
| commit | 97d549b4d5fca22ebde0798cb8c16c19b4ae837a (patch) | |
| tree | 33cd7b6b480b3362eea22dc1e84e7caf6fe77ea6 /drivers/misc/mei/amthif.c | |
| parent | a03c608f25fbe2eb5f2862a4dab1791948496215 (diff) | |
| download | linux-97d549b4d5fca22ebde0798cb8c16c19b4ae837a.tar.gz linux-97d549b4d5fca22ebde0798cb8c16c19b4ae837a.tar.bz2 linux-97d549b4d5fca22ebde0798cb8c16c19b4ae837a.zip | |
mei: add file pointer to the host client structure
Store the file associated with a client in the host client structure,
this enables dropping the special amthif client file pointer from struct
mei_device, and this is also a preparation for changing the way rx
packet allocation for fixed_address clients
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei/amthif.c')
| -rw-r--r-- | drivers/misc/mei/amthif.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/misc/mei/amthif.c b/drivers/misc/mei/amthif.c index 3cf54ca051ea..e346af17d9f4 100644 --- a/drivers/misc/mei/amthif.c +++ b/drivers/misc/mei/amthif.c @@ -204,7 +204,7 @@ static int mei_amthif_read_start(struct mei_cl *cl, const struct file *file) list_add_tail(&cb->list, &dev->ctrl_wr_list.list); dev->iamthif_state = MEI_IAMTHIF_READING; - dev->iamthif_fp = cb->fp; + cl->fp = cb->fp; return 0; } @@ -230,13 +230,13 @@ int mei_amthif_run_next_cmd(struct mei_device *dev) typeof(*cb), list); if (!cb) { dev->iamthif_state = MEI_IAMTHIF_IDLE; - dev->iamthif_fp = NULL; + cl->fp = NULL; return 0; } list_del_init(&cb->list); dev->iamthif_state = MEI_IAMTHIF_WRITING; - dev->iamthif_fp = cb->fp; + cl->fp = cb->fp; ret = mei_cl_write(cl, cb, false); if (ret < 0) @@ -375,7 +375,7 @@ void mei_amthif_complete(struct mei_cl *cl, struct mei_cl_cb *cb) return; } dev->iamthif_state = MEI_IAMTHIF_IDLE; - dev->iamthif_fp = NULL; + cl->fp = NULL; if (!dev->iamthif_canceled) { /* * in case of error enqueue the write cb to complete @@ -453,11 +453,12 @@ static void mei_clear_lists(struct mei_device *dev, const struct file *file) */ int mei_amthif_release(struct mei_device *dev, struct file *file) { + struct mei_cl *cl = file->private_data; + if (dev->iamthif_open_count > 0) dev->iamthif_open_count--; - if (dev->iamthif_fp == file && - dev->iamthif_state != MEI_IAMTHIF_IDLE) { + if (cl->fp == file && dev->iamthif_state != MEI_IAMTHIF_IDLE) { dev_dbg(dev->dev, "amthif canceled iamthif state %d\n", dev->iamthif_state); |
