Commit a8ecbc54 authored by Hans de Goede's avatar Hans de Goede Committed by Mark Brown

spi: Export acpi_spi_find_controller_by_adev()

Export acpi_spi_find_controller_by_adev() so that ACPI glue code which
wants to dynamically create a spi_device using acpi_spi_device_alloc() or
spi_new_device() on a controller, to which the code does not already have
a reference, can find the controller.
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20231014205314.59333-2-hdegoede@redhat.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent f6d7f050
...@@ -2523,8 +2523,6 @@ static void acpi_spi_parse_apple_properties(struct acpi_device *dev, ...@@ -2523,8 +2523,6 @@ static void acpi_spi_parse_apple_properties(struct acpi_device *dev,
lookup->mode |= SPI_CPHA; lookup->mode |= SPI_CPHA;
} }
static struct spi_controller *acpi_spi_find_controller_by_adev(struct acpi_device *adev);
static int acpi_spi_add_resource(struct acpi_resource *ares, void *data) static int acpi_spi_add_resource(struct acpi_resource *ares, void *data)
{ {
struct acpi_spi_lookup *lookup = data; struct acpi_spi_lookup *lookup = data;
...@@ -4519,7 +4517,7 @@ static int spi_acpi_controller_match(struct device *dev, const void *data) ...@@ -4519,7 +4517,7 @@ static int spi_acpi_controller_match(struct device *dev, const void *data)
return ACPI_COMPANION(dev->parent) == 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; struct device *dev;
...@@ -4533,6 +4531,7 @@ static struct spi_controller *acpi_spi_find_controller_by_adev(struct acpi_devic ...@@ -4533,6 +4531,7 @@ static struct spi_controller *acpi_spi_find_controller_by_adev(struct acpi_devic
return container_of(dev, struct spi_controller, dev); 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) static struct spi_device *acpi_spi_find_device_by_adev(struct acpi_device *adev)
{ {
......
...@@ -867,6 +867,7 @@ extern int devm_spi_register_controller(struct device *dev, ...@@ -867,6 +867,7 @@ extern int devm_spi_register_controller(struct device *dev,
extern void spi_unregister_controller(struct spi_controller *ctlr); extern void spi_unregister_controller(struct spi_controller *ctlr);
#if IS_ENABLED(CONFIG_ACPI) #if IS_ENABLED(CONFIG_ACPI)
extern struct spi_controller *acpi_spi_find_controller_by_adev(struct acpi_device *adev);
extern struct spi_device *acpi_spi_device_alloc(struct spi_controller *ctlr, extern struct spi_device *acpi_spi_device_alloc(struct spi_controller *ctlr,
struct acpi_device *adev, struct acpi_device *adev,
int index); int index);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment