summaryrefslogtreecommitdiff
path: root/sys/dev/gpio
diff options
context:
space:
mode:
authordrochner <drochner@NetBSD.org>2005-10-11 16:01:03 +0000
committerdrochner <drochner@NetBSD.org>2005-10-11 16:01:03 +0000
commitdbbdf74175dc4561a2d5ff96f18f14898da20e2c (patch)
tree37697648bd07c6ac102f51cbcc1d9357c599510c /sys/dev/gpio
parente8d3f46495a3dab0ddfe79fc637b1b79de6b5f17 (diff)
-kill gba_name in attach arg
-use constants from locators.h
Diffstat (limited to 'sys/dev/gpio')
-rw-r--r--sys/dev/gpio/gpio.c19
-rw-r--r--sys/dev/gpio/gpiovar.h3
2 files changed, 10 insertions, 12 deletions
diff --git a/sys/dev/gpio/gpio.c b/sys/dev/gpio/gpio.c
index 83a6abea61a..7f351a41c09 100644
--- a/sys/dev/gpio/gpio.c
+++ b/sys/dev/gpio/gpio.c
@@ -1,4 +1,4 @@
-/* $NetBSD: gpio.c,v 1.2 2005/10/11 09:56:51 cube Exp $ */
+/* $NetBSD: gpio.c,v 1.3 2005/10/11 16:01:03 drochner Exp $ */
/* $OpenBSD: gpio.c,v 1.4 2004/11/23 21:18:37 grange Exp $ */
/*
* Copyright (c) 2004 Alexander Yurchenko <grange@openbsd.org>
@@ -17,7 +17,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gpio.c,v 1.2 2005/10/11 09:56:51 cube Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gpio.c,v 1.3 2005/10/11 16:01:03 drochner Exp $");
/*
* General Purpose Input/Output framework.
@@ -33,6 +33,8 @@ __KERNEL_RCSID(0, "$NetBSD: gpio.c,v 1.2 2005/10/11 09:56:51 cube Exp $");
#include <dev/gpio/gpiovar.h>
+#include "locators.h"
+
struct gpio_softc {
struct device sc_dev;
@@ -68,10 +70,6 @@ extern struct cfdriver gpio_cd;
int
gpio_match(struct device *parent, struct cfdata *cf, void *aux)
{
- struct gpiobus_attach_args *gba = aux;
-
- if (strcmp(gba->gba_name, cf->cf_name) != 0)
- return (0);
return (1);
}
@@ -136,8 +134,8 @@ gpio_search(struct device *parent, struct cfdata *cf,
{
struct gpio_attach_args ga;
- ga.ga_pin = cf->cf_loc[0];
- ga.ga_mask = cf->cf_loc[1];
+ ga.ga_pin = cf->cf_loc[GPIOCF_PIN];
+ ga.ga_mask = cf->cf_loc[GPIOCF_MASK];
if (config_match(parent, cf, &ga) > 0)
config_attach(parent, cf, &ga, gpio_print);
@@ -162,10 +160,11 @@ gpio_print(void *aux, const char *pnp)
int
gpiobus_print(void *aux, const char *pnp)
{
+#if 0
struct gpiobus_attach_args *gba = aux;
-
+#endif
if (pnp != NULL)
- printf("%s at %s", gba->gba_name, pnp);
+ printf("%s at %s", "gpiobus", pnp);
return (UNCONF);
}
diff --git a/sys/dev/gpio/gpiovar.h b/sys/dev/gpio/gpiovar.h
index 7ead5558a04..9675c1b626e 100644
--- a/sys/dev/gpio/gpiovar.h
+++ b/sys/dev/gpio/gpiovar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: gpiovar.h,v 1.1 2005/09/27 02:34:02 jmcneill Exp $ */
+/* $NetBSD: gpiovar.h,v 1.2 2005/10/11 16:01:03 drochner Exp $ */
/* $OpenBSD: gpiovar.h,v 1.1 2004/06/03 18:08:00 grange Exp $ */
/*
* Copyright (c) 2004 Alexander Yurchenko <grange@openbsd.org>
@@ -38,7 +38,6 @@ typedef struct gpio_pin {
/* Attach GPIO framework to the controller */
struct gpiobus_attach_args {
- const char *gba_name; /* bus name */
gpio_chipset_tag_t gba_gc; /* underlying controller */
gpio_pin_t *gba_pins; /* pins array */
int gba_npins; /* total number of pins */