aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwtracing/stm
diff options
context:
space:
mode:
authorAlexander Shishkin <alexander.shishkin@linux.intel.com>2016-02-15 12:12:09 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-20 17:09:14 -0500
commitcc8424074e51355e0c6ba717d8edc50d408f2802 (patch)
tree3bafbc3bec78e09b59d9715169dff975c991baeb /drivers/hwtracing/stm
parentb4ca34aaf78ed0cdfc15956d377064104257a437 (diff)
stm class: Plug stm device's unlink callback
STM device's unlink callback is never actually called from anywhere in the stm class code. This patch adds calls to stm driver's unlink method after the unlinking has succeeded. Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hwtracing/stm')
-rw-r--r--drivers/hwtracing/stm/core.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/drivers/hwtracing/stm/core.c b/drivers/hwtracing/stm/core.c
index 30181821d909..de80d45d8df9 100644
--- a/drivers/hwtracing/stm/core.c
+++ b/drivers/hwtracing/stm/core.c
@@ -376,14 +376,19 @@ err_free:
376static int stm_char_release(struct inode *inode, struct file *file) 376static int stm_char_release(struct inode *inode, struct file *file)
377{ 377{
378 struct stm_file *stmf = file->private_data; 378 struct stm_file *stmf = file->private_data;
379 struct stm_device *stm = stmf->stm;
380
381 if (stm->data->unlink)
382 stm->data->unlink(stm->data, stmf->output.master,
383 stmf->output.channel);
379 384
380 stm_output_free(stmf->stm, &stmf->output); 385 stm_output_free(stm, &stmf->output);
381 386
382 /* 387 /*
383 * matches the stm_char_open()'s 388 * matches the stm_char_open()'s
384 * class_find_device() + try_module_get() 389 * class_find_device() + try_module_get()
385 */ 390 */
386 stm_put_device(stmf->stm); 391 stm_put_device(stm);
387 kfree(stmf); 392 kfree(stmf);
388 393
389 return 0; 394 return 0;
@@ -865,8 +870,18 @@ unlock:
865 spin_unlock(&src->link_lock); 870 spin_unlock(&src->link_lock);
866 spin_unlock(&stm->link_lock); 871 spin_unlock(&stm->link_lock);
867 872
868 if (!ret && src->data->unlink) 873 /*
869 src->data->unlink(src->data); 874 * Call the unlink callbacks for both source and stm, when we know
875 * that we have actually performed the unlinking.
876 */
877 if (!ret) {
878 if (src->data->unlink)
879 src->data->unlink(src->data);
880
881 if (stm->data->unlink)
882 stm->data->unlink(stm->data, src->output.master,
883 src->output.channel);
884 }
870 885
871 return ret; 886 return ret;
872} 887}