@@ -4200,7 +4200,7 @@ static int spi_acpi_controller_match(struct device *dev, const void *data)
return ACPI_COMPANION(dev->parent) == data;
}
-static struct spi_controller *acpi_spi_find_controller_by_adev(struct acpi_device *adev)
+struct spi_controller *acpi_spi_find_controller_by_adev(struct acpi_device *adev)
{
struct device *dev;
@@ -4214,6 +4214,7 @@ static struct spi_controller *acpi_spi_find_controller_by_adev(struct acpi_devic
return container_of(dev, struct spi_controller, dev);
}
+EXPORT_SYMBOL_GPL(acpi_spi_find_controller_by_adev);
static struct spi_device *acpi_spi_find_device_by_adev(struct acpi_device *adev)
{
@@ -17,6 +17,7 @@
#include <linux/ptp_clock_kernel.h>
#include <uapi/linux/spi/spi.h>
+#include <linux/acpi.h>
struct dma_chan;
struct software_node;
@@ -759,6 +760,15 @@ extern int devm_spi_register_controller(struct device *dev,
struct spi_controller *ctlr);
extern void spi_unregister_controller(struct spi_controller *ctlr);
+#if IS_ENABLED(CONFIG_ACPI)
+extern struct spi_controller *acpi_spi_find_controller_by_adev(struct acpi_device *adev);
+#else
+static inline struct spi_controller *acpi_spi_find_controller_by_adev(struct acpi_device *adev)
+{
+ return ERR_PTR(-EOPNOTSUPP);
+}
+#endif
+
/*
* SPI resource management while processing a SPI message
*/
This will be used by bus-multi-instantiate to support spi. Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com> --- drivers/spi/spi.c | 3 ++- include/linux/spi/spi.h | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-)