aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndy Shevchenko2022-10-20 22:54:21 +0300
committerGreg Kroah-Hartman2024-01-05 15:18:37 +0100
commit027eaeaf3294607104e90e84cec3f55e792cab22 (patch)
tree518a8f79767136de6a356271747ac458c6f7c3b7 /include
parent457a219c845318045e3f4de9d9581bbea7180441 (diff)
spi: Introduce spi_get_device_match_data() helper
[ Upstream commit aea672d054a21782ed8450c75febb6ba3c208ca4 ] The proposed spi_get_device_match_data() helper is for retrieving a driver data associated with the ID in an ID table. First, it tries to get driver data of the device enumerated by firmware interface (usually Device Tree or ACPI). If none is found it falls back to the SPI ID table matching. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20221020195421.10482-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org> Stable-dep-of: ee4d79055aee ("iio: imu: adis16475: add spi_device_id table") Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/spi/spi.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index 877395e075af..635a05c30283 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -1515,6 +1515,9 @@ extern void spi_unregister_device(struct spi_device *spi);
extern const struct spi_device_id *
spi_get_device_id(const struct spi_device *sdev);
+extern const void *
+spi_get_device_match_data(const struct spi_device *sdev);
+
static inline bool
spi_transfer_is_last(struct spi_controller *ctlr, struct spi_transfer *xfer)
{