Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/imcsmb Search for child devices using the i2cbus att...



details:   https://anonhg.NetBSD.org/src/rev/b3cfb32dc4a5
branches:  trunk
changeset: 359813:b3cfb32dc4a5
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Mon Feb 26 04:25:32 2018 +0000

description:
Search for child devices using the i2cbus attribute

diffstat:

 sys/dev/imcsmb/imcsmb.c |  5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diffs (22 lines):

diff -r fac4bfdce92a -r b3cfb32dc4a5 sys/dev/imcsmb/imcsmb.c
--- a/sys/dev/imcsmb/imcsmb.c   Mon Feb 26 04:19:00 2018 +0000
+++ b/sys/dev/imcsmb/imcsmb.c   Mon Feb 26 04:25:32 2018 +0000
@@ -125,7 +125,7 @@
        if (!pmf_device_register(self, NULL, NULL))
                aprint_error_dev(self, "couldn't establish power handler\n");
 
-       imcsmb_rescan(self, "imcsmb", 0);
+       imcsmb_rescan(self, "i2cbus", 0);
 }
 
 static int
@@ -134,6 +134,9 @@
        struct imcsmb_softc *sc = device_private(self);
        struct i2cbus_attach_args iba;
 
+       if (!ifattr_match(ifattr, "i2cbus"))
+               return 0;
+
        /* Create the i2cbus child */
        if (sc->sc_smbus != NULL)
                return 0;



Home | Main Index | Thread Index | Old Index