Date: Sun, 30 Apr 2023 06:57:52 GMT From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: d4a8b3f7cf10 - stable/13 - usb: purge EOL release compatibility Message-ID: <202304300657.33U6vqd3071517@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=d4a8b3f7cf101fa54385e0d3613a2fcd1be47090 commit d4a8b3f7cf101fa54385e0d3613a2fcd1be47090 Author: Elliott Mitchell <ehem+freebsd@m5p.com> AuthorDate: 2022-06-23 00:53:47 +0000 Commit: Hans Petter Selasky <hselasky@FreeBSD.org> CommitDate: 2023-04-30 06:56:16 +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 (cherry picked from commit 336fbb23def7a6b3dc44ce5c76bbc07a701c0a69) --- 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 9018b2e4db40..98e2172e5e95 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 8c3ee521b5b1..5a84f9bb529c 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 07bc25b644e3..7cfd2c18d0d6 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?202304300657.33U6vqd3071517>