Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/i2c match spdmem_i2c on "atmel, spd" compatible string



details:   https://anonhg.NetBSD.org/src/rev/b36f5cbc144a
branches:  trunk
changeset: 836104:b36f5cbc144a
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Wed Sep 26 20:15:08 2018 +0000

description:
match spdmem_i2c on "atmel,spd" compatible string

diffstat:

 sys/dev/i2c/spdmem_i2c.c |  13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diffs (39 lines):

diff -r 634d7c42e6d4 -r b36f5cbc144a sys/dev/i2c/spdmem_i2c.c
--- a/sys/dev/i2c/spdmem_i2c.c  Wed Sep 26 20:03:36 2018 +0000
+++ b/sys/dev/i2c/spdmem_i2c.c  Wed Sep 26 20:15:08 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: spdmem_i2c.c,v 1.15 2018/06/16 21:22:13 thorpej Exp $ */
+/* $NetBSD: spdmem_i2c.c,v 1.16 2018/09/26 20:15:08 jakllsch Exp $ */
 
 /*
  * Copyright (c) 2007 Nicolas Joly
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: spdmem_i2c.c,v 1.15 2018/06/16 21:22:13 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spdmem_i2c.c,v 1.16 2018/09/26 20:15:08 jakllsch Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -172,11 +172,20 @@
        return rv;
 }
 
+static const struct device_compatible_entry compat_data[] = {
+       { "atmel,spd",  0 },
+       { NULL,         0 }
+};
+
 static int
 spdmem_i2c_match(device_t parent, cfdata_t match, void *aux)
 {
        struct i2c_attach_args *ia = aux;
        struct spdmem_i2c_softc sc;
+       int match_result;
+
+       if (iic_use_direct_match(ia, match, compat_data, &match_result))
+               return match_result;
 
        /*
         * XXXJRT



Home | Main Index | Thread Index | Old Index