diff options
author | Alexander Shishkin <alexander.shishkin@linux.intel.com> | 2016-02-15 19:12:09 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-02-20 14:09:14 -0800 |
commit | cc8424074e51355e0c6ba717d8edc50d408f2802 (patch) | |
tree | 3bafbc3bec78e09b59d9715169dff975c991baeb /drivers/hwtracing/stm | |
parent | b4ca34aaf78ed0cdfc15956d377064104257a437 (diff) | |
download | op-kernel-dev-cc8424074e51355e0c6ba717d8edc50d408f2802.zip op-kernel-dev-cc8424074e51355e0c6ba717d8edc50d408f2802.tar.gz |
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.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/drivers/hwtracing/stm/core.c b/drivers/hwtracing/stm/core.c index 3018182..de80d45 100644 --- a/drivers/hwtracing/stm/core.c +++ b/drivers/hwtracing/stm/core.c @@ -376,14 +376,19 @@ err_free: static int stm_char_release(struct inode *inode, struct file *file) { struct stm_file *stmf = file->private_data; + struct stm_device *stm = stmf->stm; + + if (stm->data->unlink) + stm->data->unlink(stm->data, stmf->output.master, + stmf->output.channel); - stm_output_free(stmf->stm, &stmf->output); + stm_output_free(stm, &stmf->output); /* * matches the stm_char_open()'s * class_find_device() + try_module_get() */ - stm_put_device(stmf->stm); + stm_put_device(stm); kfree(stmf); return 0; @@ -865,8 +870,18 @@ unlock: spin_unlock(&src->link_lock); spin_unlock(&stm->link_lock); - if (!ret && src->data->unlink) - src->data->unlink(src->data); + /* + * Call the unlink callbacks for both source and stm, when we know + * that we have actually performed the unlinking. + */ + if (!ret) { + if (src->data->unlink) + src->data->unlink(src->data); + + if (stm->data->unlink) + stm->data->unlink(stm->data, src->output.master, + src->output.channel); + } return ret; } |