From 79f4179e2afa51e889e450d0cce1cad99358c7c8 Mon Sep 17 00:00:00 2001 From: ratchov Date: Tue, 12 May 2015 18:23:38 +0000 Subject: [PATCH] Remove unused code & definitions: midi_attach(), midi_unit_count(), midi_getinfo(), midi_writebytes(). They were "used" by the sequencer interface which we removed years ago. --- sys/dev/midi.c | 44 ++++++++------------------------------------ sys/dev/midi_if.h | 10 ++-------- 2 files changed, 10 insertions(+), 44 deletions(-) diff --git a/sys/dev/midi.c b/sys/dev/midi.c index 277682a932e..d1a9f87b536 100644 --- a/sys/dev/midi.c +++ b/sys/dev/midi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: midi.c,v 1.35 2015/05/12 18:05:43 ratchov Exp $ */ +/* $OpenBSD: midi.c,v 1.36 2015/05/12 18:23:38 ratchov Exp $ */ /* * Copyright (c) 2003, 2004 Alexandre Ratchov @@ -494,22 +494,10 @@ midiprobe(struct device *parent, void *match, void *aux) return (sa != NULL && (sa->type == AUDIODEV_TYPE_MIDI) ? 1 : 0); } -void -midi_attach(struct midi_softc *sc, struct device *parent) -{ - struct midi_info mi; - - sc->isdying = 0; - sc->hw_if->getinfo(sc->hw_hdl, &mi); - sc->props = mi.props; - sc->isopen = 0; - timeout_set(&sc->timeo, midi_timeout, sc); - printf(": <%s>\n", mi.name); -} - void midiattach(struct device *parent, struct device *self, void *aux) { + struct midi_info mi; struct midi_softc *sc = (struct midi_softc *)self; struct audio_attach_args *sa = (struct audio_attach_args *)aux; struct midi_hw_if *hwif = sa->hwif; @@ -527,7 +515,12 @@ midiattach(struct device *parent, struct device *self, void *aux) #endif sc->hw_if = hwif; sc->hw_hdl = hdl; - midi_attach(sc, parent); + sc->isdying = 0; + sc->hw_if->getinfo(sc->hw_hdl, &mi); + sc->props = mi.props; + sc->isopen = 0; + timeout_set(&sc->timeo, midi_timeout, sc); + printf(": <%s>\n", mi.name); } int @@ -565,19 +558,6 @@ midiprint(void *aux, const char *pnp) return (UNCONF); } -void -midi_getinfo(dev_t dev, struct midi_info *mi) -{ - struct midi_softc *sc = MIDI_DEV2SC(dev); - - if (MIDI_UNIT(dev) >= midi_cd.cd_ndevs || sc == NULL || sc->isdying) { - mi->name = "unconfigured"; - mi->props = 0; - return; - } - sc->hw_if->getinfo(sc->hw_hdl, mi); -} - struct device * midi_attach_mi(struct midi_hw_if *hwif, void *hdl, struct device *dev) { @@ -588,11 +568,3 @@ midi_attach_mi(struct midi_hw_if *hwif, void *hdl, struct device *dev) arg.hdl = hdl; return config_found(dev, &arg, midiprint); } - - -int -midi_unit_count(void) -{ - return midi_cd.cd_ndevs; -} - diff --git a/sys/dev/midi_if.h b/sys/dev/midi_if.h index e9f28b44597..609e30973fc 100644 --- a/sys/dev/midi_if.h +++ b/sys/dev/midi_if.h @@ -1,4 +1,4 @@ -/* $OpenBSD: midi_if.h,v 1.7 2008/06/26 05:42:14 ray Exp $ */ +/* $OpenBSD: midi_if.h,v 1.8 2015/05/12 18:23:38 ratchov Exp $ */ /* $NetBSD: midi_if.h,v 1.3 1998/11/25 22:17:07 augustss Exp $ */ /* @@ -54,12 +54,6 @@ struct midi_hw_if { int (*ioctl)(void *, u_long, caddr_t, int, struct proc *); }; -void midi_attach(struct midi_softc *, struct device *); -struct device *midi_attach_mi(struct midi_hw_if *, void *, - struct device *); - -int midi_unit_count(void); -void midi_getinfo(dev_t, struct midi_info *); -int midi_writebytes(int, u_char *, int); +struct device *midi_attach_mi(struct midi_hw_if *, void *, struct device *); #endif /* _SYS_DEV_MIDI_IF_H_ */ -- 2.20.1