Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm If we don't get informed (via devi...



details:   https://anonhg.NetBSD.org/src/rev/4b1057361005
branches:  trunk
changeset: 318891:4b1057361005
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Wed May 09 02:53:00 2018 +0000
description:
If we don't get informed (via device properties) of child I2C devices,
don't assign an empty array to iba.iba_child_devices, as it will prevent
indirect configuration of the I2C bus from occurring.

Tested on Raspberry Pi (bcm2835), identical logical fix replicated
(and compile-tested) elsewhere.

PR port-arm/53171

diffstat:

 sys/arch/arm/broadcom/bcm2835_bsc.c |  6 ++----
 sys/arch/arm/nvidia/tegra_i2c.c     |  9 +++------
 sys/arch/arm/samsung/exynos_i2c.c   |  6 ++----
 sys/arch/arm/sunxi/sunxi_rsb.c      |  6 ++----
 sys/arch/arm/sunxi/sunxi_twi.c      |  6 ++----
 5 files changed, 11 insertions(+), 22 deletions(-)

diffs (139 lines):

diff -r 26a38001eaea -r 4b1057361005 sys/arch/arm/broadcom/bcm2835_bsc.c
--- a/sys/arch/arm/broadcom/bcm2835_bsc.c       Wed May 09 02:46:22 2018 +0000
+++ b/sys/arch/arm/broadcom/bcm2835_bsc.c       Wed May 09 02:53:00 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bcm2835_bsc.c,v 1.10 2018/03/03 16:03:38 skrll Exp $   */
+/*     $NetBSD: bcm2835_bsc.c,v 1.11 2018/05/09 02:53:00 thorpej Exp $ */
 
 /*
  * Copyright (c) 2012 Jonathan A. Kollasch
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_bsc.c,v 1.10 2018/03/03 16:03:38 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_bsc.c,v 1.11 2018/05/09 02:53:00 thorpej Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_kernhist.h"
@@ -183,8 +183,6 @@
        iba.iba_child_devices = prop_dictionary_get(devs, "i2c-child-devices");
        if (iba.iba_child_devices)
                prop_object_retain(iba.iba_child_devices);
-       else
-               iba.iba_child_devices = prop_array_create();
        prop_object_release(devs);
 
        config_found_ia(self, "i2cbus", &iba, iicbus_print);
diff -r 26a38001eaea -r 4b1057361005 sys/arch/arm/nvidia/tegra_i2c.c
--- a/sys/arch/arm/nvidia/tegra_i2c.c   Wed May 09 02:46:22 2018 +0000
+++ b/sys/arch/arm/nvidia/tegra_i2c.c   Wed May 09 02:53:00 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_i2c.c,v 1.16 2017/05/25 23:43:49 jmcneill Exp $ */
+/* $NetBSD: tegra_i2c.c,v 1.17 2018/05/09 02:53:00 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tegra_i2c.c,v 1.16 2017/05/25 23:43:49 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_i2c.c,v 1.17 2018/05/09 02:53:00 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -199,11 +199,8 @@
        memset(&iba, 0, sizeof(iba));
        iba.iba_tag = &sc->sc_ic;
        iba.iba_child_devices = prop_dictionary_get(devs, "i2c-child-devices");
-       if (iba.iba_child_devices != NULL) {
+       if (iba.iba_child_devices != NULL)
                prop_object_retain(iba.iba_child_devices);
-       } else {
-               iba.iba_child_devices = prop_array_create();
-       }
        prop_object_release(devs);
 
        sc->sc_i2cdev = config_found_ia(self, "i2cbus", &iba, iicbus_print);
diff -r 26a38001eaea -r 4b1057361005 sys/arch/arm/samsung/exynos_i2c.c
--- a/sys/arch/arm/samsung/exynos_i2c.c Wed May 09 02:46:22 2018 +0000
+++ b/sys/arch/arm/samsung/exynos_i2c.c Wed May 09 02:53:00 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: exynos_i2c.c,v 1.13 2017/07/02 18:27:45 jmcneill Exp $ */
+/*     $NetBSD: exynos_i2c.c,v 1.14 2018/05/09 02:53:00 thorpej Exp $ */
 
 /*
  * Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -31,7 +31,7 @@
 #include "opt_arm_debug.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: exynos_i2c.c,v 1.13 2017/07/02 18:27:45 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: exynos_i2c.c,v 1.14 2018/05/09 02:53:00 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -198,8 +198,6 @@
        iba.iba_child_devices = prop_dictionary_get(devs, "i2c-child-devices");
        if (iba.iba_child_devices != NULL)
                prop_object_retain(iba.iba_child_devices);
-       else
-               iba.iba_child_devices = prop_array_create();
        prop_object_release(devs);
 
        sc->sc_i2cdev = config_found_ia(self, "i2cbus", &iba, iicbus_print);
diff -r 26a38001eaea -r 4b1057361005 sys/arch/arm/sunxi/sunxi_rsb.c
--- a/sys/arch/arm/sunxi/sunxi_rsb.c    Wed May 09 02:46:22 2018 +0000
+++ b/sys/arch/arm/sunxi/sunxi_rsb.c    Wed May 09 02:53:00 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_rsb.c,v 1.1 2017/07/02 18:06:45 jmcneill Exp $ */
+/* $NetBSD: sunxi_rsb.c,v 1.2 2018/05/09 02:53:00 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2014-2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunxi_rsb.c,v 1.1 2017/07/02 18:06:45 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_rsb.c,v 1.2 2018/05/09 02:53:00 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -220,8 +220,6 @@
        iba.iba_child_devices = prop_dictionary_get(devs, "i2c-child-devices");
        if (iba.iba_child_devices)
                prop_object_retain(iba.iba_child_devices);
-       else
-               iba.iba_child_devices = prop_array_create();
        prop_object_release(devs);
 
        sc->sc_i2cdev = config_found_ia(self, "i2cbus", &iba, iicbus_print);
diff -r 26a38001eaea -r 4b1057361005 sys/arch/arm/sunxi/sunxi_twi.c
--- a/sys/arch/arm/sunxi/sunxi_twi.c    Wed May 09 02:46:22 2018 +0000
+++ b/sys/arch/arm/sunxi/sunxi_twi.c    Wed May 09 02:53:00 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_twi.c,v 1.8 2017/12/02 18:56:18 jmcneill Exp $ */
+/* $NetBSD: sunxi_twi.c,v 1.9 2018/05/09 02:53:00 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -33,7 +33,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_twi.c,v 1.8 2017/12/02 18:56:18 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_twi.c,v 1.9 2018/05/09 02:53:00 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -236,8 +236,6 @@
        iba.iba_child_devices = prop_dictionary_get(devs, "i2c-child-devices");
        if (iba.iba_child_devices)
                prop_object_retain(iba.iba_child_devices);
-       else
-               iba.iba_child_devices = prop_array_create();
        prop_object_release(devs);
 
        config_found_ia(self, "i2cbus", &iba, iicbus_print);



Home | Main Index | Thread Index | Old Index