]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
usb: typec: tipd: Separate file for tracepoint creation
authorHeikki Krogerus <heikki.krogerus@linux.intel.com>
Wed, 10 Mar 2021 10:46:30 +0000 (13:46 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 12 Mar 2021 14:32:20 +0000 (15:32 +0100)
Creating the tracepoints only when tracing is enabled.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20210310104630.77945-4-heikki.krogerus@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/tipd/Makefile
drivers/usb/typec/tipd/core.c [moved from drivers/usb/typec/tipd/tps6598x.c with 99% similarity]
drivers/usb/typec/tipd/trace.c [new file with mode: 0644]
drivers/usb/typec/tipd/trace.h [moved from drivers/usb/typec/tipd/tps6598x_trace.h with 99% similarity]

index 4c19eadb5f466c3c0dbcfeeb9512cb5c1015a533..aa439f80a889ecb6691e5aa27b416db5cb109ca7 100644 (file)
@@ -1,4 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
-CFLAGS_tps6598x.o              := -I$(src)
+CFLAGS_trace.o                 := -I$(src)
 
 obj-$(CONFIG_TYPEC_TPS6598X)   += tps6598x.o
+tps6598x-y                     := core.o
+tps6598x-$(CONFIG_TRACING)     += trace.o
similarity index 99%
rename from drivers/usb/typec/tipd/tps6598x.c
rename to drivers/usb/typec/tipd/core.c
index 2c4ab90e16e79f355dc323010d2093d013629f88..9e924db421794ed1949f86c138126d6a15562565 100644 (file)
@@ -6,8 +6,6 @@
  * Author: Heikki Krogerus <heikki.krogerus@linux.intel.com>
  */
 
-#include "tps6598x.h"
-
 #include <linux/i2c.h>
 #include <linux/acpi.h>
 #include <linux/module.h>
@@ -17,8 +15,8 @@
 #include <linux/usb/typec.h>
 #include <linux/usb/role.h>
 
-#define CREATE_TRACE_POINTS
-#include "tps6598x_trace.h"
+#include "tps6598x.h"
+#include "trace.h"
 
 /* Register offsets */
 #define TPS_REG_VID                    0x00
diff --git a/drivers/usb/typec/tipd/trace.c b/drivers/usb/typec/tipd/trace.c
new file mode 100644 (file)
index 0000000..016e680
--- /dev/null
@@ -0,0 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * TI TPS6598x USB Power Delivery Controller Trace Support
+ *
+ * Copyright (C) 2021, Intel Corporation
+ * Author: Heikki Krogerus <heikki.krogerus@linux.intel.com>
+ */
+#define CREATE_TRACE_POINTS
+#include "trace.h"
similarity index 99%
rename from drivers/usb/typec/tipd/tps6598x_trace.h
rename to drivers/usb/typec/tipd/trace.h
index 21917751d61ee23a527e0c772309c602f0d87b35..5d09d6f7893000d5f7b1670c7ef53112376b9111 100644 (file)
@@ -277,7 +277,7 @@ TRACE_EVENT(tps6598x_data_status,
 
 /* This part must be outside protection */
 #undef TRACE_INCLUDE_FILE
-#define TRACE_INCLUDE_FILE tps6598x_trace
+#define TRACE_INCLUDE_FILE trace
 #undef TRACE_INCLUDE_PATH
 #define TRACE_INCLUDE_PATH .
 #include <trace/define_trace.h>