Source-Changes-HG archive

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

[src/thorpej-i2c-spi-conf2]: src/sys/arch/sparc64/sparc64 No longer need to f...



details:   https://anonhg.NetBSD.org/src/rev/1a01433edc54
branches:  thorpej-i2c-spi-conf2
changeset: 985856:1a01433edc54
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sat Sep 11 13:02:29 2021 +0000

description:
No longer need to fixup the devhandle for the "pmu" i2c bus node,
since of_i2c_enumerate_devices() now handles it.

diffstat:

 sys/arch/sparc64/sparc64/ofw_patch.c |  56 +----------------------------------
 1 files changed, 2 insertions(+), 54 deletions(-)

diffs (84 lines):

diff -r 7506f139ffa0 -r 1a01433edc54 sys/arch/sparc64/sparc64/ofw_patch.c
--- a/sys/arch/sparc64/sparc64/ofw_patch.c      Sat Sep 11 12:58:48 2021 +0000
+++ b/sys/arch/sparc64/sparc64/ofw_patch.c      Sat Sep 11 13:02:29 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ofw_patch.c,v 1.7.14.3 2021/09/11 01:03:18 thorpej Exp $ */
+/*     $NetBSD: ofw_patch.c,v 1.7.14.4 2021/09/11 13:02:29 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2020, 2021 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ofw_patch.c,v 1.7.14.3 2021/09/11 01:03:18 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofw_patch.c,v 1.7.14.4 2021/09/11 13:02:29 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/kmem.h>
@@ -699,55 +699,6 @@
 };
 
 /*****************************************************************************
- * Universal fixups
- *****************************************************************************/
-
-static void
-universal_fixups(device_t dev, void *aux)
-{
-       /*
-        * If the parent of an "iic" instance is named "pmu" in the
-        * device tree, then we need to fix up the devhandle for the
-        * bus because the device tree topology is:
-        *
-        *      pmu -> i2c -> [devices...]
-        */
-       if (device_is_a(dev, "iic")) {
-               device_t parent = device_parent(dev);
-               devhandle_t parent_devhandle = device_handle(parent);
-               char name[32];
-
-               if (devhandle_type(parent_devhandle) != DEVHANDLE_TYPE_OF) {
-                       return;
-               }
-               int parent_phandle = devhandle_to_of(parent_devhandle);
-
-               if (OF_getprop(parent_phandle, "name", name,
-                              sizeof(name)) <= 0) {
-                       return;
-               }
-               name[sizeof(name) - 1] = '\0';  /* sanity */
-               if (strcmp(name, "pmu") != 0) {
-                       return;
-               }
-
-               int node;
-               for (node = OF_child(parent_phandle); node != 0;
-                    node = OF_peer(node)) {
-                       if (OF_getprop(node, "name", name,
-                                      sizeof(name)) <= 0) {
-                               continue;
-                       }
-                       if (strcmp(name, "i2c") == 0) {
-                               device_set_handle(dev,
-                                   devhandle_from_of(node));
-                               break;
-                       }
-               }
-       }
-}
-
-/*****************************************************************************
  * End of system-specific data
  *****************************************************************************/
 
@@ -784,9 +735,6 @@
        void (*fn)(device_t, void *);
        devhandle_t devhandle;
 
-       /* First, deal with some universal fixups. */
-       universal_fixups(dev, aux);
-
        devhandle = device_handle(dev);
 
        if (! system_fixup_entry_initialized) {



Home | Main Index | Thread Index | Old Index