Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ofw In of_enter_i2c_devs(), we no longer need to set...



details:   https://anonhg.NetBSD.org/src/rev/f70c7fec507b
branches:  trunk
changeset: 323692:f70c7fec507b
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Tue Jun 26 06:24:52 2018 +0000

description:
In of_enter_i2c_devs(), we no longer need to set a "size" property
for a couple of models of Atmel EEPROMs because the driver can figure
this out on its own now (based on the same "compatible" criteria that
we're using).

diffstat:

 sys/dev/ofw/ofw_subr.c |  14 +++-----------
 1 files changed, 3 insertions(+), 11 deletions(-)

diffs (42 lines):

diff -r ea48ab3664a8 -r f70c7fec507b sys/dev/ofw/ofw_subr.c
--- a/sys/dev/ofw/ofw_subr.c    Tue Jun 26 06:21:23 2018 +0000
+++ b/sys/dev/ofw/ofw_subr.c    Tue Jun 26 06:24:52 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ofw_subr.c,v 1.30 2017/07/03 00:47:34 jmcneill Exp $   */
+/*     $NetBSD: ofw_subr.c,v 1.31 2018/06/26 06:24:52 thorpej Exp $    */
 
 /*
  * Copyright 1998
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ofw_subr.c,v 1.30 2017/07/03 00:47:34 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofw_subr.c,v 1.31 2018/06/26 06:24:52 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -450,7 +450,7 @@
     int addr_shift)
 {
        int node, len;
-       char name[32], compatible[32];
+       char name[32];
        uint64_t reg64;
        uint32_t reg32;
        uint64_t addr;
@@ -493,14 +493,6 @@
                prop_dictionary_set_uint32(dev, "addr", addr);
                prop_dictionary_set_uint64(dev, "cookie", node);
                of_to_dataprop(dev, node, "compatible", "compatible");
-               if (OF_getprop(node, "compatible", compatible,
-                   sizeof(compatible)) > 0) {
-                       /* Set size for EEPROM's that we know about */
-                       if (strcmp(compatible, "i2c-at24c64") == 0)
-                               prop_dictionary_set_uint32(dev, "size", 8192);
-                       if (strcmp(compatible, "i2c-at34c02") == 0)
-                               prop_dictionary_set_uint32(dev, "size", 256);
-               }
                prop_array_add(array, dev);
                prop_object_release(dev);
        }



Home | Main Index | Thread Index | Old Index