[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191001113830.13028-19-mika.westerberg@linux.intel.com>
Date: Tue, 1 Oct 2019 14:38:26 +0300
From: Mika Westerberg <mika.westerberg@...ux.intel.com>
To: linux-usb@...r.kernel.org
Cc: Andreas Noever <andreas.noever@...il.com>,
Michael Jamet <michael.jamet@...el.com>,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
Yehezkel Bernat <YehezkelShB@...il.com>,
Rajmohan Mani <rajmohan.mani@...el.com>,
Nicholas Johnson <nicholas.johnson-opensource@...look.com.au>,
Lukas Wunner <lukas@...ner.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Alan Stern <stern@...land.harvard.edu>,
Mario.Limonciello@...l.com,
Anthony Wong <anthony.wong@...onical.com>,
linux-kernel@...r.kernel.org
Subject: [RFC PATCH 18/22] thunderbolt: Make tb_switch_find_cap() available to other files
From: Rajmohan Mani <rajmohan.mani@...el.com>
We need to find switch capabilities in order to implement TMU support so
make it available to other files as well.
Signed-off-by: Rajmohan Mani <rajmohan.mani@...el.com>
Signed-off-by: Mika Westerberg <mika.westerberg@...ux.intel.com>
---
drivers/thunderbolt/cap.c | 11 ++++++++++-
drivers/thunderbolt/tb.h | 1 +
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/thunderbolt/cap.c b/drivers/thunderbolt/cap.c
index 8bf8e031f0bc..568d878f19f7 100644
--- a/drivers/thunderbolt/cap.c
+++ b/drivers/thunderbolt/cap.c
@@ -113,7 +113,16 @@ int tb_port_find_cap(struct tb_port *port, enum tb_port_cap cap)
return ret;
}
-static int tb_switch_find_cap(struct tb_switch *sw, enum tb_switch_cap cap)
+/**
+ * tb_switch_find_cap() - Find switch capability
+ * @sw Switch to find the capability for
+ * @cap: Capability to look
+ *
+ * Returns offset to start of capability or %-ENOENT if no such
+ * capability was found. Negative errno is returned if there was an
+ * error.
+ */
+int tb_switch_find_cap(struct tb_switch *sw, enum tb_switch_cap cap)
{
int offset = sw->config.first_cap_offset;
diff --git a/drivers/thunderbolt/tb.h b/drivers/thunderbolt/tb.h
index 60f237020d1b..1488382066fd 100644
--- a/drivers/thunderbolt/tb.h
+++ b/drivers/thunderbolt/tb.h
@@ -709,6 +709,7 @@ struct tb_port *tb_next_port_on_path(struct tb_port *start, struct tb_port *end,
struct tb_port *prev);
int tb_switch_find_vse_cap(struct tb_switch *sw, enum tb_switch_vse_cap vsec);
+int tb_switch_find_cap(struct tb_switch *sw, enum tb_switch_cap cap);
int tb_port_find_cap(struct tb_port *port, enum tb_port_cap cap);
bool tb_port_is_enabled(struct tb_port *port);
--
2.23.0
Powered by blists - more mailing lists