Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 4 Feb 2023 16:20:10 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 336fbb23def7 - main - usb: purge EOL release compatibility
Message-ID:  <202302041620.314GKAOh009296@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=336fbb23def7a6b3dc44ce5c76bbc07a701c0a69

commit 336fbb23def7a6b3dc44ce5c76bbc07a701c0a69
Author:     Elliott Mitchell <ehem+freebsd@m5p.com>
AuthorDate: 2022-06-23 00:53:47 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2023-02-04 16:10:32 +0000

    usb: purge EOL release compatibility
    
    Remove conditionsals for FreeBSD 6, 7, 8 and 9 compatibility.
    
    Reviewed by: imp
    Pull Request: https://github.com/freebsd/freebsd-src/pull/603
    Differential Revision: https://reviews.freebsd.org/D35560
---
 sys/dev/usb/controller/ehci_pci.c |  5 -----
 sys/dev/usb/controller/ohci_pci.c |  5 -----
 sys/dev/usb/controller/uhci_pci.c |  5 -----
 sys/dev/usb/usb_busdma.h          |  4 ----
 sys/dev/usb/usb_dev.c             |  5 -----
 sys/dev/usb/usb_process.c         | 21 ---------------------
 sys/dev/usb/usb_process.h         |  4 ----
 7 files changed, 49 deletions(-)

diff --git a/sys/dev/usb/controller/ehci_pci.c b/sys/dev/usb/controller/ehci_pci.c
index 4ff15a37538c..a4430aa3a05d 100644
--- a/sys/dev/usb/controller/ehci_pci.c
+++ b/sys/dev/usb/controller/ehci_pci.c
@@ -424,13 +424,8 @@ ehci_pci_attach(device_t self)
 		sprintf(sc->sc_vendor, "(0x%04x)", pci_get_vendor(self));
 	}
 
-#if (__FreeBSD_version >= 700031)
 	err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
 	    NULL, (driver_intr_t *)ehci_interrupt, sc, &sc->sc_intr_hdl);
-#else
-	err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
-	    (driver_intr_t *)ehci_interrupt, sc, &sc->sc_intr_hdl);
-#endif
 	if (err) {
 		device_printf(self, "Could not setup irq, %d\n", err);
 		sc->sc_intr_hdl = NULL;
diff --git a/sys/dev/usb/controller/ohci_pci.c b/sys/dev/usb/controller/ohci_pci.c
index b9d90ba5432d..abca9526db52 100644
--- a/sys/dev/usb/controller/ohci_pci.c
+++ b/sys/dev/usb/controller/ohci_pci.c
@@ -296,13 +296,8 @@ ohci_pci_attach(device_t self)
 
 	/* sc->sc_bus.usbrev; set by ohci_init() */
 
-#if (__FreeBSD_version >= 700031)
 	err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
 	    NULL, (driver_intr_t *)ohci_interrupt, sc, &sc->sc_intr_hdl);
-#else
-	err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
-	    (driver_intr_t *)ohci_interrupt, sc, &sc->sc_intr_hdl);
-#endif
 	if (err) {
 		device_printf(self, "Could not setup irq, %d\n", err);
 		sc->sc_intr_hdl = NULL;
diff --git a/sys/dev/usb/controller/uhci_pci.c b/sys/dev/usb/controller/uhci_pci.c
index 2b38e31208f2..19efb0ef6a5a 100644
--- a/sys/dev/usb/controller/uhci_pci.c
+++ b/sys/dev/usb/controller/uhci_pci.c
@@ -363,13 +363,8 @@ uhci_pci_attach(device_t self)
 		break;
 	}
 
-#if (__FreeBSD_version >= 700031)
 	err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
 	    NULL, (driver_intr_t *)uhci_interrupt, sc, &sc->sc_intr_hdl);
-#else
-	err = bus_setup_intr(self, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
-	    (driver_intr_t *)uhci_interrupt, sc, &sc->sc_intr_hdl);
-#endif
 
 	if (err) {
 		device_printf(self, "Could not setup irq, %d\n", err);
diff --git a/sys/dev/usb/usb_busdma.h b/sys/dev/usb/usb_busdma.h
index 2f60b30963d2..254694e1b21f 100644
--- a/sys/dev/usb/usb_busdma.h
+++ b/sys/dev/usb/usb_busdma.h
@@ -40,11 +40,7 @@
 
 #define	USB_PAGE_SIZE PAGE_SIZE		/* use system PAGE_SIZE */
 
-#if (__FreeBSD_version >= 700020)
 #define	USB_GET_DMA_TAG(dev) bus_get_dma_tag(dev)
-#else
-#define	USB_GET_DMA_TAG(dev) NULL	/* XXX */
-#endif
 
 /* structure prototypes */
 
diff --git a/sys/dev/usb/usb_dev.c b/sys/dev/usb/usb_dev.c
index 4811d280562c..84446edc3ecd 100644
--- a/sys/dev/usb/usb_dev.c
+++ b/sys/dev/usb/usb_dev.c
@@ -96,12 +96,7 @@ SYSCTL_INT(_hw_usb_dev, OID_AUTO, debug, CTLFLAG_RWTUN,
     &usb_fifo_debug, 0, "Debug Level");
 #endif
 
-#if ((__FreeBSD_version >= 700001) || (__FreeBSD_version == 0) || \
-     ((__FreeBSD_version >= 600034) && (__FreeBSD_version < 700000)))
 #define	USB_UCRED struct ucred *ucred,
-#else
-#define	USB_UCRED
-#endif
 
 /* prototypes */
 
diff --git a/sys/dev/usb/usb_process.c b/sys/dev/usb/usb_process.c
index 37495608a30d..33dbad1bf998 100644
--- a/sys/dev/usb/usb_process.c
+++ b/sys/dev/usb/usb_process.c
@@ -62,31 +62,14 @@
 #include <sys/sched.h>
 #endif			/* USB_GLOBAL_INCLUDE_FILE */
 
-#if (__FreeBSD_version < 700000)
-#define	thread_lock(td) mtx_lock_spin(&sched_lock)
-#define	thread_unlock(td) mtx_unlock_spin(&sched_lock)
-#endif
-
-#if (__FreeBSD_version >= 800000)
 static struct proc *usbproc;
 static int usb_pcount;
 #define	USB_THREAD_CREATE(f, s, p, ...) \
 		kproc_kthread_add((f), (s), &usbproc, (p), RFHIGHPID, \
 		    0, "usb", __VA_ARGS__)
-#if (__FreeBSD_version >= 900000)
 #define	USB_THREAD_SUSPEND_CHECK() kthread_suspend_check()
-#else
-#define	USB_THREAD_SUSPEND_CHECK() kthread_suspend_check(curthread)
-#endif
 #define	USB_THREAD_SUSPEND(p)   kthread_suspend(p,0)
 #define	USB_THREAD_EXIT(err)	kthread_exit()
-#else
-#define	USB_THREAD_CREATE(f, s, p, ...) \
-		kthread_create((f), (s), (p), RFHIGHPID, 0, __VA_ARGS__)
-#define	USB_THREAD_SUSPEND_CHECK() kthread_suspend_check(curproc)
-#define	USB_THREAD_SUSPEND(p)   kthread_suspend(p,0)
-#define	USB_THREAD_EXIT(err)	kthread_exit(err)
-#endif
 
 #ifdef USB_DEBUG
 static int usb_proc_debug;
@@ -198,11 +181,9 @@ usb_process(void *arg)
 	up->up_ptr = NULL;
 	cv_signal(&up->up_cv);
 	USB_MTX_UNLOCK(up->up_mtx);
-#if (__FreeBSD_version >= 800000)
 	/* Clear the proc pointer if this is the last thread. */
 	if (--usb_pcount == 0)
 		usbproc = NULL;
-#endif
 
 	USB_THREAD_EXIT(0);
 }
@@ -238,9 +219,7 @@ usb_proc_create(struct usb_process *up, struct mtx *p_mtx,
 		up->up_ptr = NULL;
 		goto error;
 	}
-#if (__FreeBSD_version >= 800000)
 	usb_pcount++;
-#endif
 	return (0);
 
 error:
diff --git a/sys/dev/usb/usb_process.h b/sys/dev/usb/usb_process.h
index 7be78917b8f0..8a416a308856 100644
--- a/sys/dev/usb/usb_process.h
+++ b/sys/dev/usb/usb_process.h
@@ -57,11 +57,7 @@ struct usb_process {
 	struct cv up_cv;
 	struct cv up_drain;
 
-#if (__FreeBSD_version >= 800000)
 	struct thread *up_ptr;
-#else
-	struct proc *up_ptr;
-#endif
 	struct thread *up_curtd;
 	struct mtx *up_mtx;
 



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