diff options
| author | thorpej <thorpej@NetBSD.org> | 2022-01-19 13:33:11 +0000 |
|---|---|---|
| committer | thorpej <thorpej@NetBSD.org> | 2022-01-19 13:33:11 +0000 |
| commit | 942204b39263ec491f6f0f4a42ebdc50c2678b60 (patch) | |
| tree | beec50582c99c81469818dbe84c0882b36c1a81a /sys/dev | |
| parent | 4bd1e887af3c3c55353a68386227c465e9e3ca90 (diff) | |
Provide a spi_compatible_lookup() function to go along with
spi_compatible_match().
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/spi/spi.c | 12 | ||||
| -rw-r--r-- | sys/dev/spi/spivar.h | 5 |
2 files changed, 14 insertions, 3 deletions
diff --git a/sys/dev/spi/spi.c b/sys/dev/spi/spi.c index 9aa5e307f21..3e8a6a115f7 100644 --- a/sys/dev/spi/spi.c +++ b/sys/dev/spi/spi.c @@ -1,4 +1,4 @@ -/* $NetBSD: spi.c,v 1.22 2022/01/19 12:58:06 thorpej Exp $ */ +/* $NetBSD: spi.c,v 1.23 2022/01/19 13:33:11 thorpej Exp $ */ /*- * Copyright (c) 2006 Urbana-Champaign Independent Media Center. @@ -42,7 +42,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: spi.c,v 1.22 2022/01/19 12:58:06 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: spi.c,v 1.23 2022/01/19 13:33:11 thorpej Exp $"); #include "locators.h" @@ -272,6 +272,14 @@ spi_compatible_match(const struct spi_attach_args *sa, const cfdata_t cf, return 1; } +const struct device_compatible_entry * +spi_compatible_lookup(const struct spi_attach_args *sa, + const struct device_compatible_entry *compats) +{ + return device_compatible_lookup(sa->sa_compat, sa->sa_ncompat, + compats); +} + /* * API for device drivers. * diff --git a/sys/dev/spi/spivar.h b/sys/dev/spi/spivar.h index 40f8624b504..807d61b7884 100644 --- a/sys/dev/spi/spivar.h +++ b/sys/dev/spi/spivar.h @@ -1,4 +1,4 @@ -/* $NetBSD: spivar.h,v 1.11 2022/01/19 05:21:44 thorpej Exp $ */ +/* $NetBSD: spivar.h,v 1.12 2022/01/19 13:33:11 thorpej Exp $ */ /*- * Copyright (c) 2006 Urbana-Champaign Independent Media Center. @@ -142,6 +142,9 @@ SIMPLEQ_HEAD(spi_transq, spi_transfer); int spi_compatible_match(const struct spi_attach_args *, const cfdata_t, const struct device_compatible_entry *); +const struct device_compatible_entry * + spi_compatible_lookup(const struct spi_attach_args *, + const struct device_compatible_entry *); int spi_configure(device_t, struct spi_handle *, int, int); int spi_transfer(struct spi_handle *, struct spi_transfer *); void spi_transfer_init(struct spi_transfer *); |
