diff options
author | Felipe Balbi <felipe.balbi@linux.intel.com> | 2017-06-02 13:20:25 +0300 |
---|---|---|
committer | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2017-12-04 07:14:30 -0500 |
commit | a773d419275bf54854ca6cfda8f2594ed2790faa (patch) | |
tree | 49d4dbdcc1a3ccc4263dd61a297a66dbad0b69e4 /drivers | |
parent | c4bfd39d7fa5203d4b387c283d360e9a108e85b3 (diff) | |
download | linux-stable-a773d419275bf54854ca6cfda8f2594ed2790faa.tar.gz linux-stable-a773d419275bf54854ca6cfda8f2594ed2790faa.tar.bz2 linux-stable-a773d419275bf54854ca6cfda8f2594ed2790faa.zip |
tracing: Pass export pointer as argument to ->write()
By passing an export descriptor to the write function, users don't need to
keep a global static pointer and can rely on container_of() to fetch their
own structure.
Link: http://lkml.kernel.org/r/20170602102025.5140-1-felipe.balbi@linux.intel.com
Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Reviewed-by: Chunyan Zhang <zhang.chunyan@linaro.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/hwtracing/stm/ftrace.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/hwtracing/stm/ftrace.c b/drivers/hwtracing/stm/ftrace.c index bd126a7c6da2..7da75644c750 100644 --- a/drivers/hwtracing/stm/ftrace.c +++ b/drivers/hwtracing/stm/ftrace.c @@ -42,9 +42,11 @@ static struct stm_ftrace { * @len: length of the data packet */ static void notrace -stm_ftrace_write(const void *buf, unsigned int len) +stm_ftrace_write(struct trace_export *export, const void *buf, unsigned int len) { - stm_source_write(&stm_ftrace.data, STM_FTRACE_CHAN, buf, len); + struct stm_ftrace *stm = container_of(export, struct stm_ftrace, ftrace); + + stm_source_write(&stm->data, STM_FTRACE_CHAN, buf, len); } static int stm_ftrace_link(struct stm_source_data *data) |