Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/gpio Delete unnecessary device-activation hooks. Si...
details: https://anonhg.NetBSD.org/src/rev/bbe85950a37a
branches: trunk
changeset: 749733:bbe85950a37a
user: dyoung <dyoung%NetBSD.org@localhost>
date: Sun Dec 06 22:33:44 2009 +0000
description:
Delete unnecessary device-activation hooks. Simplify the rest.
diffstat:
sys/dev/gpio/gpioiic.c | 21 +++------------------
sys/dev/gpio/gpiolock.c | 9 ++++-----
sys/dev/gpio/gpiosim.c | 17 ++---------------
3 files changed, 9 insertions(+), 38 deletions(-)
diffs (128 lines):
diff -r f5d53a21bd29 -r bbe85950a37a sys/dev/gpio/gpioiic.c
--- a/sys/dev/gpio/gpioiic.c Sun Dec 06 21:40:31 2009 +0000
+++ b/sys/dev/gpio/gpioiic.c Sun Dec 06 22:33:44 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gpioiic.c,v 1.1 2009/08/09 08:18:00 mbalmer Exp $ */
+/* $NetBSD: gpioiic.c,v 1.2 2009/12/06 22:33:44 dyoung Exp $ */
/* $OpenBSD: gpioiic.c,v 1.8 2008/11/24 12:12:12 mbalmer Exp $ */
/*
@@ -18,7 +18,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gpioiic.c,v 1.1 2009/08/09 08:18:00 mbalmer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gpioiic.c,v 1.2 2009/12/06 22:33:44 dyoung Exp $");
/*
* I2C bus bit-banging through GPIO pins.
@@ -58,7 +58,6 @@
int gpioiic_match(device_t, cfdata_t, void *);
void gpioiic_attach(device_t, device_t, void *);
int gpioiic_detach(device_t, int);
-int gpioiic_activate(device_t, enum devact);
int gpioiic_i2c_acquire_bus(void *, int);
void gpioiic_i2c_release_bus(void *, int);
@@ -73,7 +72,7 @@
u_int32_t gpioiic_bb_read_bits(void *);
CFATTACH_DECL_NEW(gpioiic, sizeof(struct gpioiic_softc),
- gpioiic_match, gpioiic_attach, gpioiic_detach, gpioiic_activate);
+ gpioiic_match, gpioiic_attach, gpioiic_detach, NULL);
extern struct cfdriver gpioiic_cd;
@@ -212,20 +211,6 @@
}
int
-gpioiic_activate(device_t self, enum devact act)
-{
- int rv = 0;
-
- switch (act) {
- case DVACT_ACTIVATE:
- return EOPNOTSUPP;
- case DVACT_DEACTIVATE:
- break;
- }
- return rv;
-}
-
-int
gpioiic_i2c_acquire_bus(void *cookie, int flags)
{
struct gpioiic_softc *sc = cookie;
diff -r f5d53a21bd29 -r bbe85950a37a sys/dev/gpio/gpiolock.c
--- a/sys/dev/gpio/gpiolock.c Sun Dec 06 21:40:31 2009 +0000
+++ b/sys/dev/gpio/gpiolock.c Sun Dec 06 22:33:44 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gpiolock.c,v 1.2 2009/08/15 09:43:59 mbalmer Exp $ */
+/* $NetBSD: gpiolock.c,v 1.3 2009/12/06 22:33:44 dyoung Exp $ */
/*
* Copyright (c) 2009 Marc Balmer <marc%msys.ch@localhost>
@@ -152,14 +152,13 @@
struct gpiolock_softc *sc = device_private(self);
switch (act) {
- case DVACT_ACTIVATE:
- return EOPNOTSUPP;
case DVACT_DEACTIVATE:
sc->sc_dying = 1;
- break;
+ return 0;
+ default:
+ return EOPNOTSUPP;
}
- return 0;
}
int
diff -r f5d53a21bd29 -r bbe85950a37a sys/dev/gpio/gpiosim.c
--- a/sys/dev/gpio/gpiosim.c Sun Dec 06 21:40:31 2009 +0000
+++ b/sys/dev/gpio/gpiosim.c Sun Dec 06 22:33:44 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gpiosim.c,v 1.6 2009/08/07 08:08:18 mbalmer Exp $ */
+/* $NetBSD: gpiosim.c,v 1.7 2009/12/06 22:33:44 dyoung Exp $ */
/* $OpenBSD: gpiosim.c,v 1.1 2008/11/23 18:46:49 mbalmer Exp $ */
/*
@@ -45,7 +45,6 @@
void gpiosimattach(int);
void gpiosim_attach(device_t, device_t, void *);
int gpiosim_detach(device_t, int);
-int gpiosim_activate(device_t, enum devact);
int gpiosim_sysctl(SYSCTLFN_PROTO);
int gpiosim_pin_read(void *, int);
@@ -53,7 +52,7 @@
void gpiosim_pin_ctl(void *, int, int);
CFATTACH_DECL_NEW(gpiosim, sizeof(struct gpiosim_softc), gpiosim_match,
- gpiosim_attach, gpiosim_detach, gpiosim_activate);
+ gpiosim_attach, gpiosim_detach, NULL);
extern struct cfdriver gpiosim_cd;
@@ -167,18 +166,6 @@
}
int
-gpiosim_activate(device_t self, enum devact act)
-{
- switch (act) {
- case DVACT_ACTIVATE:
- return EOPNOTSUPP;
- case DVACT_DEACTIVATE:
- break;
- }
- return 0;
-}
-
-int
gpiosim_sysctl(SYSCTLFN_ARGS)
{
struct sysctlnode node;
Home |
Main Index |
Thread Index |
Old Index