All that the activation hook radioactivate() did was to change

sc_dying, and nothing in the driver examines sc_dying, so get rid of
radioactivate() and sc_dying.
This commit is contained in:
dyoung 2010-01-21 02:19:55 +00:00
parent 975667d3ea
commit 4cb8eac3b5
1 changed files with 3 additions and 19 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: radio.c,v 1.23 2009/12/06 22:42:48 dyoung Exp $ */ /* $NetBSD: radio.c,v 1.24 2010/01/21 02:19:55 dyoung Exp $ */
/* $OpenBSD: radio.c,v 1.2 2001/12/05 10:27:06 mickey Exp $ */ /* $OpenBSD: radio.c,v 1.2 2001/12/05 10:27:06 mickey Exp $ */
/* $RuOBSD: radio.c,v 1.7 2001/12/04 06:03:05 tm Exp $ */ /* $RuOBSD: radio.c,v 1.7 2001/12/04 06:03:05 tm Exp $ */
@ -30,7 +30,7 @@
/* This is the /dev/radio driver from OpenBSD */ /* This is the /dev/radio driver from OpenBSD */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: radio.c,v 1.23 2009/12/06 22:42:48 dyoung Exp $"); __KERNEL_RCSID(0, "$NetBSD: radio.c,v 1.24 2010/01/21 02:19:55 dyoung Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -48,17 +48,15 @@ struct radio_softc {
void *hw_hdl; /* hardware driver handle */ void *hw_hdl; /* hardware driver handle */
device_t sc_dev; /* hardware device struct */ device_t sc_dev; /* hardware device struct */
const struct radio_hw_if *hw_if; /* hardware interface */ const struct radio_hw_if *hw_if; /* hardware interface */
char sc_dying; /* device detached */
}; };
static int radioprobe(device_t, cfdata_t, void *); static int radioprobe(device_t, cfdata_t, void *);
static void radioattach(device_t, device_t, void *); static void radioattach(device_t, device_t, void *);
static int radioprint(void *, const char *); static int radioprint(void *, const char *);
static int radiodetach(device_t, int); static int radiodetach(device_t, int);
static int radioactivate(device_t, enum devact);
CFATTACH_DECL_NEW(radio, sizeof(struct radio_softc), CFATTACH_DECL_NEW(radio, sizeof(struct radio_softc),
radioprobe, radioattach, radiodetach, radioactivate); radioprobe, radioattach, radiodetach, NULL);
static dev_type_open(radioopen); static dev_type_open(radioopen);
static dev_type_close(radioclose); static dev_type_close(radioclose);
@ -195,17 +193,3 @@ radiodetach(device_t self, int flags)
return (0); return (0);
} }
static int
radioactivate(device_t self, enum devact act)
{
struct radio_softc *sc = device_private(self);
switch (act) {
case DVACT_DEACTIVATE:
sc->sc_dying = 1;
return 0;
default:
return EOPNOTSUPP;
}
}