Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/i2c If we're going to keep a reference on the "props...



details:   https://anonhg.NetBSD.org/src/rev/952706a1bfc6
branches:  trunk
changeset: 959031:952706a1bfc6
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sat Jan 30 01:22:06 2021 +0000

description:
If we're going to keep a reference on the "props" dictionary from
the i2c_attach_args, we should retain it.

diffstat:

 sys/dev/i2c/adm1021.c |  5 +++--
 sys/dev/i2c/dbcool.c  |  5 +++--
 sys/dev/i2c/dstemp.c  |  5 +++--
 sys/dev/i2c/lm75.c    |  5 +++--
 4 files changed, 12 insertions(+), 8 deletions(-)

diffs (104 lines):

diff -r 13e900fe943d -r 952706a1bfc6 sys/dev/i2c/adm1021.c
--- a/sys/dev/i2c/adm1021.c     Fri Jan 29 23:45:35 2021 +0000
+++ b/sys/dev/i2c/adm1021.c     Sat Jan 30 01:22:06 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: adm1021.c,v 1.26 2021/01/28 14:35:11 thorpej Exp $ */
+/*     $NetBSD: adm1021.c,v 1.27 2021/01/30 01:22:06 thorpej Exp $ */
 /*     $OpenBSD: adm1021.c,v 1.27 2007/06/24 05:34:35 dlg Exp $        */
 
 /*
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: adm1021.c,v 1.26 2021/01/28 14:35:11 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: adm1021.c,v 1.27 2021/01/30 01:22:06 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -342,6 +342,7 @@
        sc->sc_tag = ia->ia_tag;
        sc->sc_addr = ia->ia_addr;
        sc->sc_prop = ia->ia_prop;
+       prop_object_retain(sc->sc_prop);
 
        iic_acquire_bus(sc->sc_tag, 0);
        cmd = ADM1021_CONFIG_READ;
diff -r 13e900fe943d -r 952706a1bfc6 sys/dev/i2c/dbcool.c
--- a/sys/dev/i2c/dbcool.c      Fri Jan 29 23:45:35 2021 +0000
+++ b/sys/dev/i2c/dbcool.c      Sat Jan 30 01:22:06 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dbcool.c,v 1.59 2021/01/27 02:29:48 thorpej Exp $ */
+/*     $NetBSD: dbcool.c,v 1.60 2021/01/30 01:22:06 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -50,7 +50,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dbcool.c,v 1.59 2021/01/27 02:29:48 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dbcool.c,v 1.60 2021/01/30 01:22:06 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -776,6 +776,7 @@
        sc->sc_dc.dc_writereg = dbcool_writereg;
        sc->sc_dev = self;
        sc->sc_prop = args->ia_prop;
+       prop_object_retain(sc->sc_prop);
 
        if (dbcool_chip_ident(&sc->sc_dc) < 0 || sc->sc_dc.dc_chip == NULL)
                panic("could not identify chip at addr %d", args->ia_addr);
diff -r 13e900fe943d -r 952706a1bfc6 sys/dev/i2c/dstemp.c
--- a/sys/dev/i2c/dstemp.c      Fri Jan 29 23:45:35 2021 +0000
+++ b/sys/dev/i2c/dstemp.c      Sat Jan 30 01:22:06 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dstemp.c,v 1.9 2021/01/27 02:29:48 thorpej Exp $ */
+/* $NetBSD: dstemp.c,v 1.10 2021/01/30 01:22:06 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2018 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dstemp.c,v 1.9 2021/01/27 02:29:48 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dstemp.c,v 1.10 2021/01/30 01:22:06 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -109,6 +109,7 @@
        sc->sc_i2c = ia->ia_tag;
        sc->sc_addr = ia->ia_addr;
        sc->sc_prop = ia->ia_prop;
+       prop_object_retain(sc->sc_prop);
 
        aprint_naive("\n");
        aprint_normal(": DS1361\n");
diff -r 13e900fe943d -r 952706a1bfc6 sys/dev/i2c/lm75.c
--- a/sys/dev/i2c/lm75.c        Fri Jan 29 23:45:35 2021 +0000
+++ b/sys/dev/i2c/lm75.c        Sat Jan 30 01:22:06 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lm75.c,v 1.39 2021/01/27 02:29:48 thorpej Exp $        */
+/*     $NetBSD: lm75.c,v 1.40 2021/01/30 01:22:06 thorpej Exp $        */
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lm75.c,v 1.39 2021/01/27 02:29:48 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lm75.c,v 1.40 2021/01/30 01:22:06 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -188,6 +188,7 @@
        sc->sc_tag = ia->ia_tag;
        sc->sc_address = ia->ia_addr;
        sc->sc_prop = ia->ia_prop;
+       prop_object_retain(sc->sc_prop);
 
        aprint_naive(": Temperature Sensor\n");
        if (ia->ia_name) {



Home | Main Index | Thread Index | Old Index