Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/ti If we can't find a hwmod name, use the devic...



details:   https://anonhg.NetBSD.org/src/rev/c7bd4c184d9f
branches:  trunk
changeset: 934013:c7bd4c184d9f
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Wed Jun 03 16:00:00 2020 +0000

description:
If we can't find a hwmod name, use the device type and mmio address

diffstat:

 sys/arch/arm/ti/ti_gpio.c |   6 ++++--
 sys/arch/arm/ti/ti_iic.c  |  10 +++++++---
 2 files changed, 11 insertions(+), 5 deletions(-)

diffs (58 lines):

diff -r 2a32ea8504ec -r c7bd4c184d9f sys/arch/arm/ti/ti_gpio.c
--- a/sys/arch/arm/ti/ti_gpio.c Wed Jun 03 15:59:22 2020 +0000
+++ b/sys/arch/arm/ti/ti_gpio.c Wed Jun 03 16:00:00 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ti_gpio.c,v 1.3 2019/11/03 11:34:40 jmcneill Exp $ */
+/* $NetBSD: ti_gpio.c,v 1.4 2020/06/03 16:00:00 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2019 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ti_gpio.c,v 1.3 2019/11/03 11:34:40 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ti_gpio.c,v 1.4 2020/06/03 16:00:00 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -518,6 +518,8 @@
        sc->sc_modname = fdtbus_get_string(phandle, "ti,hwmods");
        if (sc->sc_modname == NULL)
                sc->sc_modname = fdtbus_get_string(OF_parent(phandle), "ti,hwmods");
+       if (sc->sc_modname == NULL)
+               sc->sc_modname = kmem_asprintf("gpio@%" PRIxBUSADDR, addr);
 
        aprint_naive("\n");
        aprint_normal(": GPIO (%s)\n", sc->sc_modname);
diff -r 2a32ea8504ec -r c7bd4c184d9f sys/arch/arm/ti/ti_iic.c
--- a/sys/arch/arm/ti/ti_iic.c  Wed Jun 03 15:59:22 2020 +0000
+++ b/sys/arch/arm/ti/ti_iic.c  Wed Jun 03 16:00:00 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ti_iic.c,v 1.5 2020/05/14 08:34:20 msaitoh Exp $ */
+/* $NetBSD: ti_iic.c,v 1.6 2020/06/03 16:00:00 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2013 Manuel Bouyer.  All rights reserved.
@@ -50,7 +50,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ti_iic.c,v 1.5 2020/05/14 08:34:20 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ti_iic.c,v 1.6 2020/06/03 16:00:00 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -292,7 +292,11 @@
        sc->sc_rxthres = sc->sc_txthres = fifo >> 1;
 
        aprint_naive("\n");
-       aprint_normal(": I2C controller (%s), %d-bytes FIFO\n", modname, fifo);
+       if (modname != NULL)
+               aprint_normal(": I2C controller (%s), %d-bytes FIFO\n", modname, fifo);
+       else
+               aprint_normal(": I2C controller (i2c@%" PRIxBUSADDR "), %d-bytes FIFO\n",
+                   addr, fifo);
 
        ti_iic_reset(sc);
        ti_iic_flush(sc);



Home | Main Index | Thread Index | Old Index