Module Name:    src
Committed By:   thorpej
Date:           Tue Jun 26 06:24:52 UTC 2018

Modified Files:
        src/sys/dev/ofw: ofw_subr.c

Log Message:
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).


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/ofw/ofw_subr.c

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/ofw/ofw_subr.c
diff -u src/sys/dev/ofw/ofw_subr.c:1.30 src/sys/dev/ofw/ofw_subr.c:1.31
--- src/sys/dev/ofw/ofw_subr.c:1.30	Mon Jul  3 00:47:34 2017
+++ src/sys/dev/ofw/ofw_subr.c	Tue Jun 26 06:24:52 2018
@@ -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 @@ of_enter_i2c_devs(prop_dictionary_t prop
     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 @@ of_enter_i2c_devs(prop_dictionary_t prop
 		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);
 	}

Reply via email to