Skip to content

Commit a8ecbc5

Browse files
jwrdegoedebroonie
authored andcommitted
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: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20231014205314.59333-2-hdegoede@redhat.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent f6d7f05 commit a8ecbc5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

drivers/spi/spi.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2523,8 +2523,6 @@ static void acpi_spi_parse_apple_properties(struct acpi_device *dev,
25232523
lookup->mode |= SPI_CPHA;
25242524
}
25252525

2526-
static struct spi_controller *acpi_spi_find_controller_by_adev(struct acpi_device *adev);
2527-
25282526
static int acpi_spi_add_resource(struct acpi_resource *ares, void *data)
25292527
{
25302528
struct acpi_spi_lookup *lookup = data;
@@ -4519,7 +4517,7 @@ static int spi_acpi_controller_match(struct device *dev, const void *data)
45194517
return ACPI_COMPANION(dev->parent) == data;
45204518
}
45214519

4522-
static struct spi_controller *acpi_spi_find_controller_by_adev(struct acpi_device *adev)
4520+
struct spi_controller *acpi_spi_find_controller_by_adev(struct acpi_device *adev)
45234521
{
45244522
struct device *dev;
45254523

@@ -4533,6 +4531,7 @@ static struct spi_controller *acpi_spi_find_controller_by_adev(struct acpi_devic
45334531

45344532
return container_of(dev, struct spi_controller, dev);
45354533
}
4534+
EXPORT_SYMBOL_GPL(acpi_spi_find_controller_by_adev);
45364535

45374536
static struct spi_device *acpi_spi_find_device_by_adev(struct acpi_device *adev)
45384537
{

include/linux/spi/spi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,7 @@ extern int devm_spi_register_controller(struct device *dev,
867867
extern void spi_unregister_controller(struct spi_controller *ctlr);
868868

869869
#if IS_ENABLED(CONFIG_ACPI)
870+
extern struct spi_controller *acpi_spi_find_controller_by_adev(struct acpi_device *adev);
870871
extern struct spi_device *acpi_spi_device_alloc(struct spi_controller *ctlr,
871872
struct acpi_device *adev,
872873
int index);

0 commit comments

Comments
 (0)