git: 69474c060d7c - stable/13 - Use DEFINE_CLASS_0 in the arm generic timer
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 17 Oct 2022 10:39:10 UTC
The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=69474c060d7c19c7df9f8ec07cf5b04e5b355190 commit 69474c060d7c19c7df9f8ec07cf5b04e5b355190 Author: Andrew Turner <andrew@FreeBSD.org> AuthorDate: 2022-09-20 16:07:27 +0000 Commit: Andrew Turner <andrew@FreeBSD.org> CommitDate: 2022-10-17 08:41:54 +0000 Use DEFINE_CLASS_0 in the arm generic timer Rather than defining the structure manually use the DEFINE_CLASS_0 macro. As we have both an ACPI and FDT attachment we need to use the _0 variant of the macro as DEFINE_CLASS would create two structures with the same name. Sponsored by: The FreeBSD Foundation (cherry picked from commit 42353d81e3a580442a70404a4fcfcbc16c36ef3f) --- sys/arm/arm/generic_timer.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/sys/arm/arm/generic_timer.c b/sys/arm/arm/generic_timer.c index e465d1afbb3d..3f5f65439ddc 100644 --- a/sys/arm/arm/generic_timer.c +++ b/sys/arm/arm/generic_timer.c @@ -507,11 +507,8 @@ static device_method_t arm_tmr_fdt_methods[] = { { 0, 0 } }; -static driver_t arm_tmr_fdt_driver = { - "generic_timer", - arm_tmr_fdt_methods, - sizeof(struct arm_tmr_softc), -}; +static DEFINE_CLASS_0(generic_timer, arm_tmr_fdt_driver, arm_tmr_fdt_methods, + sizeof(struct arm_tmr_softc)); static devclass_t arm_tmr_fdt_devclass; @@ -529,11 +526,8 @@ static device_method_t arm_tmr_acpi_methods[] = { { 0, 0 } }; -static driver_t arm_tmr_acpi_driver = { - "generic_timer", - arm_tmr_acpi_methods, - sizeof(struct arm_tmr_softc), -}; +static DEFINE_CLASS_0(generic_timer, arm_tmr_acpi_driver, arm_tmr_acpi_methods, + sizeof(struct arm_tmr_softc)); static devclass_t arm_tmr_acpi_devclass;