From: Chris Packham <chris.packham@alliedtelesis.co.nz>
To: broonie@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com
Cc: Hamish Martin <hamish.martin@alliedtelesis.co.nz>,
linux-spi@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
Chris Packham <chris.packham@alliedtelesis.co.nz>
Subject: [PATCH 2/3] spi: Make of_find_spi_controller_by_node visible
Date: Fri, 12 Apr 2019 17:02:12 +1200 [thread overview]
Message-ID: <20190412050213.17698-3-chris.packham@alliedtelesis.co.nz> (raw)
In-Reply-To: <20190412050213.17698-1-chris.packham@alliedtelesis.co.nz>
Drop the static and add of_find_spi_controller_by_node() to spi.h. Also
move it outside of the CONFIG_OF_DYNAMIC so it is available with just
CONFIG_OF.
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
---
drivers/spi/spi.c | 7 ++++---
include/linux/spi/spi.h | 7 +++++++
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 93986f879b09..19929163a45b 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -3531,16 +3531,14 @@ struct spi_device *of_find_spi_device_by_node(struct device_node *node)
return dev ? to_spi_device(dev) : NULL;
}
EXPORT_SYMBOL_GPL(of_find_spi_device_by_node);
-#endif /* IS_ENABLED(CONFIG_OF) */
-#if IS_ENABLED(CONFIG_OF_DYNAMIC)
static int __spi_of_controller_match(struct device *dev, const void *data)
{
return dev->of_node == data;
}
/* the spi controllers are not using spi_bus, so we find it with another way */
-static struct spi_controller *of_find_spi_controller_by_node(struct device_node *node)
+struct spi_controller *of_find_spi_controller_by_node(struct device_node *node)
{
struct device *dev;
@@ -3555,7 +3553,10 @@ static struct spi_controller *of_find_spi_controller_by_node(struct device_node
/* reference got in class_find_device */
return container_of(dev, struct spi_controller, dev);
}
+EXPORT_SYMBOL_GPL(of_find_spi_controller_by_node);
+#endif /* IS_ENABLED(CONFIG_OF) */
+#if IS_ENABLED(CONFIG_OF_DYNAMIC)
static int of_spi_notify(struct notifier_block *nb, unsigned long action,
void *arg)
{
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index 662b336aa2e4..e763290767ea 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -1334,6 +1334,8 @@ spi_transfer_is_last(struct spi_controller *ctlr, struct spi_transfer *xfer)
extern struct spi_device *
of_find_spi_device_by_node(struct device_node *node);
+extern struct spi_controller *
+of_find_spi_controller_by_node(struct device_node *node);
#else
static inline struct spi_device *
@@ -1342,6 +1344,11 @@ of_find_spi_device_by_node(struct device_node *node)
return NULL;
}
+static inline struct spi_controller *
+of_find_spi_controller_by_node(struct device_node *node)
+{
+ return NULL;
+}
#endif /* IS_ENABLED(CONFIG_OF) */
/* Compatibility layer */
--
2.21.0
next prev parent reply other threads:[~2019-04-12 5:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-12 5:02 [PATCH 0/3] spi: SPI bus multiplexer Chris Packham
2019-04-12 5:02 ` [PATCH 1/3] dt-bindings: spi: Add spi-mux-gpio Chris Packham
2019-04-29 21:37 ` Rob Herring
2020-01-13 3:43 ` Chris Packham
2019-04-12 5:02 ` Chris Packham [this message]
2019-04-12 5:02 ` [PATCH 3/3] spi: Add SPI bus gpio multiplexer Chris Packham
2019-04-12 8:29 ` [PATCH 0/3] spi: SPI bus multiplexer Mark Brown
2019-04-28 22:28 ` Chris Packham
2019-05-02 2:45 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190412050213.17698-3-chris.packham@alliedtelesis.co.nz \
--to=chris.packham@alliedtelesis.co.nz \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=hamish.martin@alliedtelesis.co.nz \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=robh+dt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).