Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Nov 2014 11:11:46 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r274035 - in head/sys/dev/sound: isa midi pci pcm
Message-ID:  <201411031111.sA3BBkqB037888@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bapt
Date: Mon Nov  3 11:11:45 2014
New Revision: 274035
URL: https://svnweb.freebsd.org/changeset/base/274035

Log:
  Remove check for obsolete FreeBSD versions
  
  PR:		194517
  Submitted by:	François Tigeot <ftigeot@wolfpond.org>

Modified:
  head/sys/dev/sound/isa/gusc.c
  head/sys/dev/sound/isa/sb16.c
  head/sys/dev/sound/isa/sbc.c
  head/sys/dev/sound/midi/sequencer.c
  head/sys/dev/sound/pci/als4000.c
  head/sys/dev/sound/pci/cs4281.c
  head/sys/dev/sound/pci/csa.c
  head/sys/dev/sound/pci/emu10kx.c
  head/sys/dev/sound/pci/envy24.c
  head/sys/dev/sound/pci/envy24ht.c
  head/sys/dev/sound/pci/maestro.c
  head/sys/dev/sound/pci/vibes.c
  head/sys/dev/sound/pcm/dsp.c
  head/sys/dev/sound/pcm/mixer.c
  head/sys/dev/sound/pcm/sound.c
  head/sys/dev/sound/pcm/sound.h

Modified: head/sys/dev/sound/isa/gusc.c
==============================================================================
--- head/sys/dev/sound/isa/gusc.c	Mon Nov  3 11:08:00 2014	(r274034)
+++ head/sys/dev/sound/isa/gusc.c	Mon Nov  3 11:11:45 2014	(r274035)
@@ -421,20 +421,16 @@ gusc_release_resource(device_t bus, devi
 
 static int
 gusc_setup_intr(device_t dev, device_t child, struct resource *irq, int flags,
-#if __FreeBSD_version >= 700031
 		driver_filter_t *filter,
-#endif
 		driver_intr_t *intr, void *arg, void **cookiep)
 {
 	sc_p scp = (sc_p)device_get_softc(dev);
 	devclass_t devclass;
 
-#if __FreeBSD_version >= 700031
 	if (filter != NULL) {
 		printf("gusc.c: we cannot use a filter here\n");
 		return (EINVAL);
 	}
-#endif
 	devclass = device_get_devclass(child);
 	if (strcmp(devclass_get_name(devclass), "midi") == 0) {
 		scp->midi_intr.intr = intr;
@@ -446,9 +442,7 @@ gusc_setup_intr(device_t dev, device_t c
 		return 0;
 	}
 	return bus_generic_setup_intr(dev, child, irq, flags,
-#if __FreeBSD_version >= 700031
 				filter,
-#endif
 				intr, arg, cookiep);
 }
 

Modified: head/sys/dev/sound/isa/sb16.c
==============================================================================
--- head/sys/dev/sound/isa/sb16.c	Mon Nov  3 11:08:00 2014	(r274034)
+++ head/sys/dev/sound/isa/sb16.c	Mon Nov  3 11:11:45 2014	(r274035)
@@ -176,10 +176,8 @@ sb_dspwr(struct sb_info *sb, u_char val)
 			return 1;
 		}
     	}
-#if __FreeBSD_version > 500000
 	if (curthread->td_intr_nesting_level == 0)
 		printf("sb_dspwr(0x%02x) timed out.\n", val);
-#endif
     	return 0;
 }
 

Modified: head/sys/dev/sound/isa/sbc.c
==============================================================================
--- head/sys/dev/sound/isa/sbc.c	Mon Nov  3 11:08:00 2014	(r274034)
+++ head/sys/dev/sound/isa/sbc.c	Mon Nov  3 11:11:45 2014	(r274035)
@@ -85,9 +85,7 @@ static int sbc_release_resource(device_t
 				struct resource *r);
 static int sbc_setup_intr(device_t dev, device_t child, struct resource *irq,
    	       int flags,
-#if __FreeBSD_version >= 700031
 	       driver_filter_t *filter,
-#endif
 	       driver_intr_t *intr, 
    	       void *arg, void **cookiep);
 static int sbc_teardown_intr(device_t dev, device_t child, struct resource *irq,
@@ -512,9 +510,7 @@ sbc_intr(void *p)
 
 static int
 sbc_setup_intr(device_t dev, device_t child, struct resource *irq, int flags,
-#if __FreeBSD_version >= 700031
    	       driver_filter_t *filter,
-#endif
 	       driver_intr_t *intr, 
    	       void *arg, void **cookiep)
 {
@@ -522,12 +518,10 @@ sbc_setup_intr(device_t dev, device_t ch
 	struct sbc_ihl *ihl = NULL;
 	int i, ret;
 
-#if __FreeBSD_version >= 700031
 	if (filter != NULL) {
 		printf("sbc.c: we cannot use a filter here\n");
 		return (EINVAL);
 	}
-#endif
 	sbc_lock(scp);
 	i = 0;
 	while (i < IRQ_MAX) {

Modified: head/sys/dev/sound/midi/sequencer.c
==============================================================================
--- head/sys/dev/sound/midi/sequencer.c	Mon Nov  3 11:08:00 2014	(r274034)
+++ head/sys/dev/sound/midi/sequencer.c	Mon Nov  3 11:11:45 2014	(r274035)
@@ -466,12 +466,7 @@ done:
 	cv_broadcast(&scp->th_cv);
 	mtx_unlock(&scp->seq_lock);
 	SEQ_DEBUG(2, printf("seq_eventthread finished\n"));
-#if __FreeBSD_version >= 800002
 	kproc_exit(0);
-#else
-	mtx_lock(&Giant);
-	kthread_exit(0);
-#endif
 }
 
 /*
@@ -587,11 +582,7 @@ seq_addunit(void)
 	 */
 
 	ret =
-#if __FreeBSD_version >= 800002
 	    kproc_create
-#else
-	    kthread_create
-#endif
 	    (seq_eventthread, scp, NULL, RFHIGHPID, 0,
 	    "sequencer %02d", scp->unit);
 

Modified: head/sys/dev/sound/pci/als4000.c
==============================================================================
--- head/sys/dev/sound/pci/als4000.c	Mon Nov  3 11:08:00 2014	(r274034)
+++ head/sys/dev/sound/pci/als4000.c	Mon Nov  3 11:11:45 2014	(r274035)
@@ -818,22 +818,12 @@ als_pci_attach(device_t dev)
          * ALS4000 is entirely controlled by the pci powerstate.  We
          * could attempt finer grained control by setting GCR6.31.
 	 */
-#if __FreeBSD_version > 500000
 	if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) {
 		/* Reset the power state. */
 		device_printf(dev, "chip is in D%d power mode "
 			      "-- setting to D0\n", pci_get_powerstate(dev));
 		pci_set_powerstate(dev, PCI_POWERSTATE_D0);
 	}
-#else
-	data = pci_read_config(dev, ALS_PCI_POWERREG, 2);
-	if ((data & 0x03) != 0) {
-		device_printf(dev, "chip is in D%d power mode "
-			      "-- setting to D0\n", data & 0x03);
-		data &= ~0x03;
-		pci_write_config(dev, ALS_PCI_POWERREG, data, 2);
-	}
-#endif
 
 	if (als_resource_grab(dev, sc)) {
 		device_printf(dev, "failed to allocate resources\n");

Modified: head/sys/dev/sound/pci/cs4281.c
==============================================================================
--- head/sys/dev/sound/pci/cs4281.c	Mon Nov  3 11:08:00 2014	(r274034)
+++ head/sys/dev/sound/pci/cs4281.c	Mon Nov  3 11:11:45 2014	(r274035)
@@ -768,7 +768,6 @@ cs4281_pci_attach(device_t dev)
 
     pci_enable_busmaster(dev);
 
-#if __FreeBSD_version > 500000
     if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) {
 	/* Reset the power state. */
 	device_printf(dev, "chip is in D%d power mode "
@@ -776,17 +775,6 @@ cs4281_pci_attach(device_t dev)
 
 	pci_set_powerstate(dev, PCI_POWERSTATE_D0);
     }
-#else
-    data = pci_read_config(dev, CS4281PCI_PMCS_OFFSET, 4);
-    if (data & CS4281PCI_PMCS_PS_MASK) {
-	    /* Reset the power state. */
-	    device_printf(dev, "chip is in D%d power mode "
-			  "-- setting to D0\n",
-			  data & CS4281PCI_PMCS_PS_MASK);
-	    pci_write_config(dev, CS4281PCI_PMCS_OFFSET,
-			     data & ~CS4281PCI_PMCS_PS_MASK, 4);
-    }
-#endif
 
     sc->regid   = PCIR_BAR(0);
     sc->regtype = SYS_RES_MEMORY;

Modified: head/sys/dev/sound/pci/csa.c
==============================================================================
--- head/sys/dev/sound/pci/csa.c	Mon Nov  3 11:08:00 2014	(r274034)
+++ head/sys/dev/sound/pci/csa.c	Mon Nov  3 11:11:45 2014	(r274035)
@@ -86,9 +86,7 @@ static int csa_release_resource(device_t
 				   struct resource *r);
 static int csa_setup_intr(device_t bus, device_t child,
 			  struct resource *irq, int flags,
-#if __FreeBSD_version >= 700031
 			  driver_filter_t *filter,
-#endif
 			  driver_intr_t *intr,  void *arg, void **cookiep);
 static int csa_teardown_intr(device_t bus, device_t child,
 			     struct resource *irq, void *cookie);
@@ -450,21 +448,17 @@ csa_release_resource(device_t bus, devic
 static int
 csa_setup_intr(device_t bus, device_t child,
 	       struct resource *irq, int flags,
-#if __FreeBSD_version >= 700031
 	       driver_filter_t *filter,
-#endif
 	       driver_intr_t *intr, void *arg, void **cookiep)
 {
 	sc_p scp;
 	csa_res *resp;
 	struct sndcard_func *func;
 
-#if __FreeBSD_version >= 700031
 	if (filter != NULL) {
 		printf("ata-csa.c: we cannot use a filter here\n");
 		return (EINVAL);
 	}
-#endif
 	scp = device_get_softc(bus);
 	resp = &scp->res;
 

Modified: head/sys/dev/sound/pci/emu10kx.c
==============================================================================
--- head/sys/dev/sound/pci/emu10kx.c	Mon Nov  3 11:08:00 2014	(r274034)
+++ head/sys/dev/sound/pci/emu10kx.c	Mon Nov  3 11:11:45 2014	(r274035)
@@ -3203,9 +3203,7 @@ emu_pci_attach(device_t dev)
 	i = 0;
 	sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &i, RF_ACTIVE | RF_SHAREABLE);
 	if ((sc->irq == NULL) || bus_setup_intr(dev, sc->irq, INTR_MPSAFE | INTR_TYPE_AV,
-#if __FreeBSD_version >= 700031
 	    NULL,
-#endif
 	    emu_intr, sc, &sc->ih)) {
 		device_printf(dev, "unable to map interrupt\n");
 		goto bad;

Modified: head/sys/dev/sound/pci/envy24.c
==============================================================================
--- head/sys/dev/sound/pci/envy24.c	Mon Nov  3 11:08:00 2014	(r274034)
+++ head/sys/dev/sound/pci/envy24.c	Mon Nov  3 11:11:45 2014	(r274035)
@@ -2690,11 +2690,7 @@ static device_method_t envy24_methods[] 
 static driver_t envy24_driver = {
 	"pcm",
 	envy24_methods,
-#if __FreeBSD_version > 500000
 	PCM_SOFTC_SIZE,
-#else
-	sizeof(struct snddev_info),
-#endif
 };
 
 DRIVER_MODULE(snd_envy24, pci, envy24_driver, pcm_devclass, 0, 0);

Modified: head/sys/dev/sound/pci/envy24ht.c
==============================================================================
--- head/sys/dev/sound/pci/envy24ht.c	Mon Nov  3 11:08:00 2014	(r274034)
+++ head/sys/dev/sound/pci/envy24ht.c	Mon Nov  3 11:11:45 2014	(r274035)
@@ -2588,11 +2588,7 @@ static device_method_t envy24ht_methods[
 static driver_t envy24ht_driver = {
 	"pcm",
 	envy24ht_methods,
-#if __FreeBSD_version > 500000
 	PCM_SOFTC_SIZE,
-#else
-	sizeof(struct snddev_info),
-#endif
 };
 
 DRIVER_MODULE(snd_envy24ht, pci, envy24ht_driver, pcm_devclass, 0, 0);

Modified: head/sys/dev/sound/pci/maestro.c
==============================================================================
--- head/sys/dev/sound/pci/maestro.c	Mon Nov  3 11:08:00 2014	(r274034)
+++ head/sys/dev/sound/pci/maestro.c	Mon Nov  3 11:11:45 2014	(r274035)
@@ -87,12 +87,6 @@ SND_DECLARE_FILE("$FreeBSD$");
 #define AGG_DEFAULT_BUFSZ	0x4000 /* 0x1000, but gets underflows */
 
 
-/* compatibility */
-#if __FreeBSD_version < 500000
-# define critical_enter()	disable_intr()
-# define critical_exit()	enable_intr()
-#endif
-
 #ifndef PCIR_BAR
 #define PCIR_BAR(x)	(PCIR_MAPS + (x) * 4)
 #endif
@@ -1815,9 +1809,7 @@ agg_attach(device_t dev)
 			       /*filter*/ NULL, NULL,
 			       /*size  */ ess->bufsz, 1, 0x3ffff,
 			       /*flags */ 0,
-#if __FreeBSD_version >= 501102
 			       /*lock  */ busdma_lock_mutex, &Giant,
-#endif
 			       &ess->buf_dmat) != 0) {
 		device_printf(dev, "unable to create dma tag\n");
 		ret = ENOMEM;
@@ -1831,9 +1823,7 @@ agg_attach(device_t dev)
 			       /*filter*/ NULL, NULL,
 			       /*size  */ 3*ess->bufsz, 1, 0x3ffff,
 			       /*flags */ 0,
-#if __FreeBSD_version >= 501102
 			       /*lock  */ busdma_lock_mutex, &Giant,
-#endif
 			       &ess->stat_dmat) != 0) {
 		device_printf(dev, "unable to create dma tag\n");
 		ret = ENOMEM;

Modified: head/sys/dev/sound/pci/vibes.c
==============================================================================
--- head/sys/dev/sound/pci/vibes.c	Mon Nov  3 11:08:00 2014	(r274034)
+++ head/sys/dev/sound/pci/vibes.c	Mon Nov  3 11:11:45 2014	(r274035)
@@ -730,13 +730,11 @@ sv_attach(device_t dev) {
 
 	pci_enable_busmaster(dev);
 
-#if __FreeBSD_version > 500000
         if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) {
                 device_printf(dev, "chip is in D%d power mode "
                               "-- setting to D0\n", pci_get_powerstate(dev));
                 pci_set_powerstate(dev, PCI_POWERSTATE_D0);
         }
-#endif
 	sc->enh_rid  = SV_PCI_ENHANCED;
 	sc->enh_type = SYS_RES_IOPORT;
 	sc->enh_reg  = bus_alloc_resource(dev, sc->enh_type,

Modified: head/sys/dev/sound/pcm/dsp.c
==============================================================================
--- head/sys/dev/sound/pcm/dsp.c	Mon Nov  3 11:08:00 2014	(r274034)
+++ head/sys/dev/sound/pcm/dsp.c	Mon Nov  3 11:11:45 2014	(r274035)
@@ -2324,9 +2324,7 @@ dsp_stdclone(char *name, char *namep, ch
 
 static void
 dsp_clone(void *arg,
-#if __FreeBSD_version >= 600034
     struct ucred *cred,
-#endif
     char *name, int namelen, struct cdev **dev)
 {
 	struct snddev_info *d;

Modified: head/sys/dev/sound/pcm/mixer.c
==============================================================================
--- head/sys/dev/sound/pcm/mixer.c	Mon Nov  3 11:08:00 2014	(r274034)
+++ head/sys/dev/sound/pcm/mixer.c	Mon Nov  3 11:11:45 2014	(r274035)
@@ -1328,9 +1328,7 @@ done:
 
 static void
 mixer_clone(void *arg,
-#if __FreeBSD_version >= 600034
     struct ucred *cred,
-#endif
     char *name, int namelen, struct cdev **dev)
 {
 	struct snddev_info *d;

Modified: head/sys/dev/sound/pcm/sound.c
==============================================================================
--- head/sys/dev/sound/pcm/sound.c	Mon Nov  3 11:08:00 2014	(r274034)
+++ head/sys/dev/sound/pcm/sound.c	Mon Nov  3 11:11:45 2014	(r274035)
@@ -124,11 +124,7 @@ snd_setup_intr(device_t dev, struct reso
 	if (d != NULL && (flags & INTR_MPSAFE))
 		d->flags |= SD_F_MPSAFE;
 
-	return bus_setup_intr(dev, res, flags,
-#if __FreeBSD_version >= 700031
-			NULL,
-#endif
-			hand, param, cookiep);
+	return bus_setup_intr(dev, res, flags, NULL, hand, param, cookiep);
 }
 
 static void

Modified: head/sys/dev/sound/pcm/sound.h
==============================================================================
--- head/sys/dev/sound/pcm/sound.h	Mon Nov  3 11:08:00 2014	(r274034)
+++ head/sys/dev/sound/pcm/sound.h	Mon Nov  3 11:11:45 2014	(r274035)
@@ -53,9 +53,6 @@
 #include <sys/errno.h>
 #include <sys/malloc.h>
 #include <sys/bus.h>
-#if __FreeBSD_version < 500000
-#include <sys/buf.h>
-#endif
 #include <machine/resource.h>
 #include <machine/bus.h>
 #include <sys/rman.h>
@@ -120,11 +117,7 @@ struct snd_mixer;
 #define PCMCHAN(x)		(snd_unit2c(dev2unit(x)))
 
 /* XXX unit2minor compat */
-#if __FreeBSD_version >= 800062
 #define PCMMINOR(x)	(x)
-#else
-#define PCMMINOR(x)	unit2minor(x)
-#endif
 
 /*
  * By design, limit possible channels for each direction.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201411031111.sA3BBkqB037888>