aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/mei/init.c
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2013-09-16 16:44:47 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-03 19:01:16 -0400
commit22f96a0eb6c62b570621d77dacbf2589a6de2997 (patch)
treec81ff5bc3b2899721514fdbccc7d5c9bc22b504b /drivers/misc/mei/init.c
parente036cc5727eb6d471442d2a9218990aa11215400 (diff)
mei: revamp open handler counts
Make open counter to be incremented and decremented from mei_cl_link and mei_cl_unlik function respectively Nfc was assuming symmetric linking API and thus open handler count was never decreased. This patch fixes that. We need to add separate open hander count for amthif which is handled out of link/unlink functions and doesn't break the symmetric API. Last we do not waste clients slots if amthif or wd are not present in the device. we don't need to allocates slots ahead it is all covered by link/unlink before the devices is responding to user space connection and thus not racing on allocation Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei/init.c')
-rw-r--r--drivers/misc/mei/init.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/drivers/misc/mei/init.c b/drivers/misc/mei/init.c
index 6197018e2f16..a7d29a7dcab2 100644
--- a/drivers/misc/mei/init.c
+++ b/drivers/misc/mei/init.c
@@ -165,12 +165,7 @@ void mei_reset(struct mei_device *dev, int interrupts_enabled)
165 /* remove entry if already in list */ 165 /* remove entry if already in list */
166 dev_dbg(&dev->pdev->dev, "remove iamthif and wd from the file list.\n"); 166 dev_dbg(&dev->pdev->dev, "remove iamthif and wd from the file list.\n");
167 mei_cl_unlink(&dev->wd_cl); 167 mei_cl_unlink(&dev->wd_cl);
168 if (dev->open_handle_count > 0)
169 dev->open_handle_count--;
170 mei_cl_unlink(&dev->iamthif_cl); 168 mei_cl_unlink(&dev->iamthif_cl);
171 if (dev->open_handle_count > 0)
172 dev->open_handle_count--;
173
174 mei_amthif_reset_params(dev); 169 mei_amthif_reset_params(dev);
175 memset(&dev->wr_ext_msg, 0, sizeof(dev->wr_ext_msg)); 170 memset(&dev->wr_ext_msg, 0, sizeof(dev->wr_ext_msg));
176 } 171 }