Source-Changes-HG archive

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

[src/netbsd-10]: src/sys/dev/ic Pull up following revision(s) (requested by b...



details:   https://anonhg.NetBSD.org/src/rev/5551b086539d
branches:  netbsd-10
changeset: 374349:5551b086539d
user:      martin <martin%NetBSD.org@localhost>
date:      Thu Apr 20 14:18:41 2023 +0000

description:
Pull up following revision(s) (requested by brad in ticket #144):

        sys/dev/ic/bmx280.c: revision 1.2

Do not create the sysctl tree if the initial setup of the chip fails.

diffstat:

 sys/dev/ic/bmx280.c |  14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diffs (42 lines):

diff -r 17d414a8771c -r 5551b086539d sys/dev/ic/bmx280.c
--- a/sys/dev/ic/bmx280.c       Thu Apr 20 13:45:20 2023 +0000
+++ b/sys/dev/ic/bmx280.c       Thu Apr 20 14:18:41 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bmx280.c,v 1.1 2022/12/03 01:04:43 brad Exp $  */
+/*     $NetBSD: bmx280.c,v 1.1.2.1 2023/04/20 14:18:41 martin Exp $    */
 
 /*
  * Copyright (c) 2022 Brad Spencer <brad%anduin.eldar.org@localhost>
@@ -17,7 +17,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bmx280.c,v 1.1 2022/12/03 01:04:43 brad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bmx280.c,v 1.1.2.1 2023/04/20 14:18:41 martin Exp $");
 
 /*
  * Common driver for the Bosch BMP280/BME280 temperature, humidity (sometimes) and
@@ -444,11 +444,6 @@ bmx280_attach(struct bmx280_sc *sc)
                sc->sc_has_humidity = true;
        }
 
-       if ((error = bmx280_sysctl_init(sc)) != 0) {
-               aprint_error_dev(sc->sc_dev, "Can't setup sysctl tree (%d)\n", error);
-               goto out;
-       }
-
        uint8_t raw_blob_tp[24];
        reg = BMX280_REGISTER_DIG_T1;
        error = (*(sc->sc_func_read_register))(sc, reg, raw_blob_tp, 24);
@@ -500,6 +495,11 @@ bmx280_attach(struct bmx280_sc *sc)
                goto out;
        }
 
+       if ((error = bmx280_sysctl_init(sc)) != 0) {
+               aprint_error_dev(sc->sc_dev, "Can't setup sysctl tree (%d)\n", error);
+               goto out;
+       }
+
        for (i = 0; i < sc->sc_numsensors; i++) {
                if (sc->sc_has_humidity == false &&
                    bmx280_sensors[i].type == ENVSYS_SRELHUMIDITY) {



Home | Main Index | Thread Index | Old Index