Module Name:    src
Committed By:   martin
Date:           Tue Dec 17 12:39:39 UTC 2024

Modified Files:
        src/sys/dev/gpio: files.gpio gpio.c
Added Files:
        src/sys/dev/gpio: gpiobus.c

Log Message:
Move (the one and only) gpiobus_* function(s) into a separate file
that is build if we have gpiobus (independent of having gpio or not).


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/gpio/files.gpio
cvs rdiff -u -r1.74 -r1.75 src/sys/dev/gpio/gpio.c
cvs rdiff -u -r0 -r1.1 src/sys/dev/gpio/gpiobus.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/dev/gpio/files.gpio
diff -u src/sys/dev/gpio/files.gpio:1.16 src/sys/dev/gpio/files.gpio:1.17
--- src/sys/dev/gpio/files.gpio:1.16	Sun May 20 14:08:33 2018
+++ src/sys/dev/gpio/files.gpio	Tue Dec 17 12:39:39 2024
@@ -1,10 +1,12 @@
-# $NetBSD: files.gpio,v 1.16 2018/05/20 14:08:33 thorpej Exp $
+# $NetBSD: files.gpio,v 1.17 2024/12/17 12:39:39 martin Exp $
 
 define	gpio {[offset = -1], [mask = 0], [flag = 0]}
 
 device	gpio: gpio
 attach	gpio at gpiobus
-file	dev/gpio/gpio.c				gpio	needs-flag
+file	dev/gpio/gpio.c				gpio 	needs-flag
+
+file	dev/gpio/gpiobus.c			gpiobus
 
 # GPIO simulator
 defpseudodev	gpiosim: gpiobus

Index: src/sys/dev/gpio/gpio.c
diff -u src/sys/dev/gpio/gpio.c:1.74 src/sys/dev/gpio/gpio.c:1.75
--- src/sys/dev/gpio/gpio.c:1.74	Sun Dec  8 20:40:38 2024
+++ src/sys/dev/gpio/gpio.c	Tue Dec 17 12:39:39 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: gpio.c,v 1.74 2024/12/08 20:40:38 jmcneill Exp $ */
+/* $NetBSD: gpio.c,v 1.75 2024/12/17 12:39:39 martin Exp $ */
 /*	$OpenBSD: gpio.c,v 1.6 2006/01/14 12:33:49 grange Exp $	*/
 
 /*
@@ -23,7 +23,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gpio.c,v 1.74 2024/12/08 20:40:38 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gpio.c,v 1.75 2024/12/17 12:39:39 martin Exp $");
 
 /*
  * General Purpose Input/Output framework.
@@ -333,18 +333,6 @@ gpio_print(void *aux, const char *pnp)
 	return UNCONF;
 }
 
-int
-gpiobus_print(void *aux, const char *pnp)
-{
-#if 0
-	struct gpiobus_attach_args *gba = aux;
-#endif
-	if (pnp != NULL)
-		aprint_normal("gpiobus at %s", pnp);
-
-	return UNCONF;
-}
-
 void *
 gpio_find_device(const char *name)
 {

Added files:

Index: src/sys/dev/gpio/gpiobus.c
diff -u /dev/null src/sys/dev/gpio/gpiobus.c:1.1
--- /dev/null	Tue Dec 17 12:39:39 2024
+++ src/sys/dev/gpio/gpiobus.c	Tue Dec 17 12:39:39 2024
@@ -0,0 +1,44 @@
+/* $NetBSD: gpiobus.c,v 1.1 2024/12/17 12:39:39 martin Exp $ */
+/*	$OpenBSD: gpio.c,v 1.6 2006/01/14 12:33:49 grange Exp $	*/
+
+/*
+ * Copyright (c) 2008, 2009, 2010, 2011 Marc Balmer <m...@msys.ch>
+ * Copyright (c) 2004, 2006 Alexander Yurchenko <gra...@openbsd.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: gpiobus.c,v 1.1 2024/12/17 12:39:39 martin Exp $");
+
+/*
+ * General Purpose Input/Output framework.
+ */
+
+#include <sys/systm.h>
+#include <sys/gpio.h>
+#include <dev/gpio/gpiovar.h>
+
+int
+gpiobus_print(void *aux, const char *pnp)
+{
+#if 0
+	struct gpiobus_attach_args *gba = aux;
+#endif
+	if (pnp != NULL)
+		aprint_normal("gpiobus at %s", pnp);
+
+	return UNCONF;
+}
+

Reply via email to