Module Name:    src
Committed By:   skrll
Date:           Thu Feb  8 07:13:10 UTC 2024

Modified Files:
        src/sys/arch/riscv/starfive: jh7100_pinctrl.c

Log Message:
Some fixes from Roland Illig
- fix a locking bug
- '\n' at the end of error messages


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/riscv/starfive/jh7100_pinctrl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/riscv/starfive/jh7100_pinctrl.c
diff -u src/sys/arch/riscv/starfive/jh7100_pinctrl.c:1.1 src/sys/arch/riscv/starfive/jh7100_pinctrl.c:1.2
--- src/sys/arch/riscv/starfive/jh7100_pinctrl.c:1.1	Wed Feb  7 17:17:59 2024
+++ src/sys/arch/riscv/starfive/jh7100_pinctrl.c	Thu Feb  8 07:13:10 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: jh7100_pinctrl.c,v 1.1 2024/02/07 17:17:59 skrll Exp $ */
+/* $NetBSD: jh7100_pinctrl.c,v 1.2 2024/02/08 07:13:10 skrll Exp $ */
 
 /*-
  * Copyright (c) 2023 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: jh7100_pinctrl.c,v 1.1 2024/02/07 17:17:59 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: jh7100_pinctrl.c,v 1.2 2024/02/08 07:13:10 skrll Exp $");
 
 #include <sys/param.h>
 
@@ -222,7 +222,7 @@ jh7100_pinctrl_pin_properties(struct jh7
 	case -1:
 		break;
 	default:
-		aprint_error_dev(sc->sc_dev, "invalid slew rate");
+		aprint_error_dev(sc->sc_dev, "invalid slew rate\n");
 	}
 
 	if (of_hasprop(phandle, "starfive,strong-pull-up")) {
@@ -322,7 +322,6 @@ jh7100_pinctrl_set_config_group(struct j
 			jh7100_padctl_rmw(sc, sc->sc_padctl_gpio + pin_no,
 			    val, mask);
 		}
-
 	}
 }
 
@@ -413,7 +412,7 @@ jh7100_pinctrl_gpio_write(device_t dev, 
 
 	mutex_enter(&sc->sc_lock);
 	GPIOWR4(sc, GPO_DOUT_CFG(pin_no), val);
-	mutex_enter(&sc->sc_lock);
+	mutex_exit(&sc->sc_lock);
 }
 
 static struct fdtbus_gpio_controller_func jh7100_pinctrl_gpio_funcs = {
@@ -446,7 +445,7 @@ jh7100_pinctrl_attach(device_t parent, d
 	sc->sc_bst = faa->faa_bst;
 
 	if (!of_hasprop(phandle, "gpio-controller")) {
-		aprint_error(": no gpio controller");
+		aprint_error(": no gpio controller\n");
 		return;
 	}
 
@@ -494,7 +493,7 @@ jh7100_pinctrl_attach(device_t parent, d
 		sc->sc_padctl_gpio = PAD_FUNC_SHARE(0);
 		break;
 	default:
-		aprint_error_dev(sc->sc_dev, "invalid signal group %u", sel);
+		aprint_error_dev(sc->sc_dev, "invalid signal group %u\n", sel);
 		return;
 	}
 

Reply via email to