Module Name: src Committed By: thorpej Date: Wed Jan 19 13:33:11 UTC 2022
Modified Files: src/sys/dev/spi: spi.c spivar.h Log Message: Provide a spi_compatible_lookup() function to go along with spi_compatible_match(). To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/sys/dev/spi/spi.c cvs rdiff -u -r1.11 -r1.12 src/sys/dev/spi/spivar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/spi/spi.c diff -u src/sys/dev/spi/spi.c:1.22 src/sys/dev/spi/spi.c:1.23 --- src/sys/dev/spi/spi.c:1.22 Wed Jan 19 12:58:06 2022 +++ src/sys/dev/spi/spi.c Wed Jan 19 13:33:11 2022 @@ -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_at 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. * Index: src/sys/dev/spi/spivar.h diff -u src/sys/dev/spi/spivar.h:1.11 src/sys/dev/spi/spivar.h:1.12 --- src/sys/dev/spi/spivar.h:1.11 Wed Jan 19 05:21:44 2022 +++ src/sys/dev/spi/spivar.h Wed Jan 19 13:33:11 2022 @@ -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 *);