From 6e54367a22fbc89a1139d033e95bec0c0cf0975b Mon Sep 17 00:00:00 2001 From: thorpej Date: Wed, 27 Jan 2021 03:10:18 +0000 Subject: [PATCH] Rename of_match_compat_data() to of_compatible_match(). Similarly, rename of_search_compatible() to of_compatible_lookup(). Standardize on of_compatible_match() for driver matching, and adapt all call sites. --- sys/arch/arm/altera/cycv_clkmgr.c | 8 ++-- sys/arch/arm/altera/cycv_dwcmmc.c | 12 +++--- sys/arch/arm/altera/cycv_gmac.c | 11 ++++-- sys/arch/arm/altera/cycv_rstmgr.c | 12 ++++-- sys/arch/arm/amlogic/meson6_timer.c | 14 +++---- sys/arch/arm/amlogic/meson8b_clkc.c | 14 +++---- sys/arch/arm/amlogic/meson_dwmac.c | 18 ++++----- sys/arch/arm/amlogic/meson_genfb.c | 14 +++---- sys/arch/arm/amlogic/meson_pinctrl.c | 8 ++-- sys/arch/arm/amlogic/meson_pwm.c | 6 +-- sys/arch/arm/amlogic/meson_resets.c | 16 ++++---- sys/arch/arm/amlogic/meson_rng.c | 12 +++--- sys/arch/arm/amlogic/meson_rtc.c | 12 +++--- sys/arch/arm/amlogic/meson_sdhc.c | 20 +++++----- sys/arch/arm/amlogic/meson_sdio.c | 20 +++++----- sys/arch/arm/amlogic/meson_thermal.c | 8 ++-- sys/arch/arm/amlogic/meson_uart.c | 20 +++++----- sys/arch/arm/amlogic/meson_usbctrl.c | 8 ++-- sys/arch/arm/amlogic/meson_usbphy.c | 8 ++-- sys/arch/arm/amlogic/meson_wdt.c | 12 +++--- sys/arch/arm/amlogic/mesong12_aoclkc.c | 12 +++--- sys/arch/arm/amlogic/mesong12_clkc.c | 8 ++-- sys/arch/arm/amlogic/mesong12_usb2phy.c | 12 +++--- sys/arch/arm/amlogic/mesong12_usb3pciephy.c | 12 +++--- sys/arch/arm/amlogic/mesongx_mmc.c | 8 ++-- sys/arch/arm/amlogic/mesongx_wdt.c | 12 +++--- sys/arch/arm/amlogic/mesongxbb_aoclkc.c | 14 +++---- sys/arch/arm/amlogic/mesongxbb_clkc.c | 8 ++-- sys/arch/arm/amlogic/mesongxl_usb2phy.c | 12 +++--- sys/arch/arm/amlogic/mesongxl_usb3phy.c | 12 +++--- sys/arch/arm/broadcom/bcm2835_aux.c | 12 ++++-- sys/arch/arm/broadcom/bcm2835_bsc_fdt.c | 12 ++++-- sys/arch/arm/broadcom/bcm2835_cm.c | 15 +++---- sys/arch/arm/broadcom/bcm2835_com.c | 14 +++---- sys/arch/arm/broadcom/bcm2835_cprman.c | 16 ++++---- sys/arch/arm/broadcom/bcm2835_dmac.c | 15 +++---- sys/arch/arm/broadcom/bcm2835_dwctwo.c | 17 ++++---- sys/arch/arm/broadcom/bcm2835_emmc.c | 10 ++--- sys/arch/arm/broadcom/bcm2835_genfb.c | 12 ++++-- sys/arch/arm/broadcom/bcm2835_gpio.c | 19 ++++----- sys/arch/arm/broadcom/bcm2835_intr.c | 10 ++--- sys/arch/arm/broadcom/bcm2835_mbox_fdt.c | 12 ++++-- sys/arch/arm/broadcom/bcm2835_pmwdog.c | 12 ++++-- sys/arch/arm/broadcom/bcm2835_pwm.c | 12 ++++-- sys/arch/arm/broadcom/bcm2835_rng.c | 12 ++++-- sys/arch/arm/broadcom/bcm2835_sdhost.c | 15 +++---- sys/arch/arm/broadcom/bcm2835_spi.c | 15 +++---- sys/arch/arm/broadcom/bcm2835_tmr.c | 16 ++++---- sys/arch/arm/broadcom/bcm2838_rng.c | 12 ++++-- sys/arch/arm/broadcom/bcm283x_platform.c | 12 +++--- sys/arch/arm/fdt/a9ptmr_fdt.c | 17 ++++---- sys/arch/arm/fdt/a9tmr_fdt.c | 17 ++++---- sys/arch/arm/fdt/a9wdt_fdt.c | 17 ++++---- sys/arch/arm/fdt/aaci_fdt.c | 12 +++--- sys/arch/arm/fdt/acpi_fdt.c | 12 +++--- sys/arch/arm/fdt/arm_fdt.c | 12 ++++-- sys/arch/arm/fdt/arm_simplefb.c | 14 ++++--- sys/arch/arm/fdt/gic_fdt.c | 29 ++++++++------ sys/arch/arm/fdt/gicv3_fdt.c | 10 ++--- sys/arch/arm/fdt/gtmr_fdt.c | 17 ++++---- sys/arch/arm/fdt/l2cc_fdt.c | 15 +++---- sys/arch/arm/fdt/pcihost_fdt.c | 8 ++-- sys/arch/arm/fdt/plcom_fdt.c | 13 ++++--- sys/arch/arm/fdt/plfb_fdt.c | 14 +++---- sys/arch/arm/fdt/plkmi_fdt.c | 12 +++--- sys/arch/arm/fdt/plmmc_fdt.c | 14 +++---- sys/arch/arm/fdt/plrtc_fdt.c | 12 +++--- sys/arch/arm/fdt/pmu_fdt.c | 34 ++++++++-------- sys/arch/arm/fdt/psci_fdt.c | 16 ++++---- sys/arch/arm/fdt/smsh_fdt.c | 14 +++---- sys/arch/arm/nvidia/tegra124_car.c | 17 ++++---- sys/arch/arm/nvidia/tegra124_cpu.c | 12 ++++-- sys/arch/arm/nvidia/tegra124_xusbpad.c | 13 ++++--- sys/arch/arm/nvidia/tegra210_car.c | 17 ++++---- sys/arch/arm/nvidia/tegra210_xusbpad.c | 15 +++---- sys/arch/arm/nvidia/tegra_ahcisata.c | 8 ++-- sys/arch/arm/nvidia/tegra_apbdma.c | 17 ++++---- sys/arch/arm/nvidia/tegra_cec.c | 12 ++++-- sys/arch/arm/nvidia/tegra_com.c | 18 ++++----- sys/arch/arm/nvidia/tegra_drm.c | 30 +++++++++----- sys/arch/arm/nvidia/tegra_ehci.c | 19 ++++----- sys/arch/arm/nvidia/tegra_fuse.c | 17 ++++---- sys/arch/arm/nvidia/tegra_gpio.c | 19 ++++----- sys/arch/arm/nvidia/tegra_hdaudio.c | 17 ++++---- sys/arch/arm/nvidia/tegra_i2c.c | 19 ++++----- sys/arch/arm/nvidia/tegra_lic.c | 17 ++++---- sys/arch/arm/nvidia/tegra_mc.c | 12 ++++-- sys/arch/arm/nvidia/tegra_nouveau.c | 10 ++--- sys/arch/arm/nvidia/tegra_pcie.c | 8 ++-- sys/arch/arm/nvidia/tegra_pinmux.c | 10 ++--- sys/arch/arm/nvidia/tegra_platform.c | 11 +++--- sys/arch/arm/nvidia/tegra_pmc.c | 17 ++++---- sys/arch/arm/nvidia/tegra_rtc.c | 19 ++++----- sys/arch/arm/nvidia/tegra_sdhc.c | 17 ++++---- sys/arch/arm/nvidia/tegra_soctherm.c | 8 ++-- sys/arch/arm/nvidia/tegra_timer.c | 19 ++++----- sys/arch/arm/nvidia/tegra_usbphy.c | 19 ++++----- sys/arch/arm/nvidia/tegra_xusb.c | 8 ++-- sys/arch/arm/nxp/if_enet_imx.c | 8 ++-- sys/arch/arm/nxp/imx6_clk.c | 12 ++++-- sys/arch/arm/nxp/imx6_dwhdmi.c | 14 +++---- sys/arch/arm/nxp/imx6_gpc.c | 12 ++++-- sys/arch/arm/nxp/imx6_iomux.c | 19 ++++----- sys/arch/arm/nxp/imx6_ocotp.c | 25 ++++++------ sys/arch/arm/nxp/imx6_pcie.c | 8 ++-- sys/arch/arm/nxp/imx6_platform.c | 20 +++++----- sys/arch/arm/nxp/imx6_pwm.c | 12 ++++-- sys/arch/arm/nxp/imx6_spi.c | 8 ++-- sys/arch/arm/nxp/imx6_usb.c | 14 +++---- sys/arch/arm/nxp/imx6_usbphy.c | 12 +++--- sys/arch/arm/nxp/imx7_gpc.c | 17 ++++---- sys/arch/arm/nxp/imx7d_ccm.c | 20 +++++----- sys/arch/arm/nxp/imx8mq_ccm.c | 12 +++--- sys/arch/arm/nxp/imx8mq_usbphy.c | 6 +-- sys/arch/arm/nxp/imx_ahcisata.c | 12 ++++-- sys/arch/arm/nxp/imx_com.c | 14 +++---- sys/arch/arm/nxp/imx_gpio.c | 15 +++---- sys/arch/arm/nxp/imx_i2c.c | 12 ++++-- sys/arch/arm/nxp/imx_sdhc.c | 8 ++-- sys/arch/arm/nxp/imx_snvs.c | 15 +++---- sys/arch/arm/nxp/imxwdog.c | 17 ++++---- sys/arch/arm/rockchip/rk3328_cru.c | 12 +++--- sys/arch/arm/rockchip/rk3328_iomux.c | 10 ++--- sys/arch/arm/rockchip/rk3399_cru.c | 12 +++--- sys/arch/arm/rockchip/rk3399_iomux.c | 8 ++-- sys/arch/arm/rockchip/rk3399_pcie.c | 15 +++---- sys/arch/arm/rockchip/rk3399_pcie_phy.c | 12 +++--- sys/arch/arm/rockchip/rk3399_pmucru.c | 12 +++--- sys/arch/arm/rockchip/rk_anxdp.c | 12 +++--- sys/arch/arm/rockchip/rk_drm.c | 12 +++--- sys/arch/arm/rockchip/rk_dwhdmi.c | 12 +++--- sys/arch/arm/rockchip/rk_emmcphy.c | 12 +++--- sys/arch/arm/rockchip/rk_gmac.c | 10 ++--- sys/arch/arm/rockchip/rk_gpio.c | 12 +++--- sys/arch/arm/rockchip/rk_i2c.c | 12 +++--- sys/arch/arm/rockchip/rk_i2s.c | 10 ++--- sys/arch/arm/rockchip/rk_pwm.c | 6 +-- sys/arch/arm/rockchip/rk_spi.c | 16 ++++---- sys/arch/arm/rockchip/rk_tsadc.c | 8 ++-- sys/arch/arm/rockchip/rk_usb.c | 8 ++-- sys/arch/arm/rockchip/rk_v1crypto.c | 6 +-- sys/arch/arm/rockchip/rk_vop.c | 8 ++-- sys/arch/arm/samsung/exynos5410_clock.c | 12 ++++-- sys/arch/arm/samsung/exynos5422_clock.c | 12 ++++-- sys/arch/arm/samsung/exynos_combiner.c | 14 ++++--- sys/arch/arm/samsung/exynos_dwcmmc.c | 8 ++-- sys/arch/arm/samsung/exynos_ehci.c | 15 +++---- sys/arch/arm/samsung/exynos_i2c.c | 12 ++++-- sys/arch/arm/samsung/exynos_ohci.c | 15 +++---- sys/arch/arm/samsung/exynos_pinctrl.c | 8 ++-- sys/arch/arm/samsung/exynos_platform.c | 8 ++-- sys/arch/arm/samsung/exynos_pwm.c | 12 +++--- sys/arch/arm/samsung/exynos_rtc.c | 14 ++++--- sys/arch/arm/samsung/exynos_uart.c | 14 +++---- sys/arch/arm/samsung/exynos_usbdrdphy.c | 6 +-- sys/arch/arm/samsung/exynos_usbphy.c | 6 +-- sys/arch/arm/samsung/exynos_wdt.c | 12 ++++-- sys/arch/arm/samsung/mct.c | 15 ++++--- sys/arch/arm/sociox/if_ave.c | 8 ++-- sys/arch/arm/sociox/if_scx.c | 15 +++---- sys/arch/arm/sociox/sni_emmc.c | 17 ++++---- sys/arch/arm/sociox/sni_exiu.c | 15 +++---- sys/arch/arm/sociox/sni_gpio.c | 17 ++++---- sys/arch/arm/sociox/sni_i2c.c | 15 +++---- sys/arch/arm/sunxi/sun4i_a10_ccu.c | 8 ++-- sys/arch/arm/sunxi/sun4i_dma.c | 6 +-- sys/arch/arm/sunxi/sun4i_emac.c | 12 +++--- sys/arch/arm/sunxi/sun4i_spi.c | 12 +++--- sys/arch/arm/sunxi/sun50i_a64_acodec.c | 12 +++--- sys/arch/arm/sunxi/sun50i_a64_ccu.c | 12 +++--- sys/arch/arm/sunxi/sun50i_a64_r_ccu.c | 12 +++--- sys/arch/arm/sunxi/sun50i_h6_ccu.c | 12 +++--- sys/arch/arm/sunxi/sun50i_h6_r_ccu.c | 12 +++--- sys/arch/arm/sunxi/sun5i_a13_ccu.c | 14 +++---- sys/arch/arm/sunxi/sun6i_a31_ccu.c | 12 +++--- sys/arch/arm/sunxi/sun6i_dma.c | 8 ++-- sys/arch/arm/sunxi/sun6i_spi.c | 15 +++---- sys/arch/arm/sunxi/sun8i_a23_apbclk.c | 12 ++++-- sys/arch/arm/sunxi/sun8i_a83t_ccu.c | 12 +++--- sys/arch/arm/sunxi/sun8i_codec.c | 12 +++--- sys/arch/arm/sunxi/sun8i_crypto.c | 6 +-- sys/arch/arm/sunxi/sun8i_h3_ccu.c | 14 +++---- sys/arch/arm/sunxi/sun8i_h3_codec.c | 12 +++--- sys/arch/arm/sunxi/sun8i_h3_r_ccu.c | 12 +++--- sys/arch/arm/sunxi/sun9i_a80_ccu.c | 12 +++--- sys/arch/arm/sunxi/sun9i_a80_cpusclk.c | 12 ++++-- sys/arch/arm/sunxi/sun9i_a80_mmcclk.c | 12 +++--- sys/arch/arm/sunxi/sun9i_a80_usbclk.c | 12 +++--- sys/arch/arm/sunxi/sun9i_a80_usbphy.c | 12 +++--- sys/arch/arm/sunxi/sunxi_can.c | 6 +-- sys/arch/arm/sunxi/sunxi_codec.c | 8 ++-- sys/arch/arm/sunxi/sunxi_de2.c | 12 +++--- sys/arch/arm/sunxi/sunxi_de2_ccu.c | 8 ++-- sys/arch/arm/sunxi/sunxi_debe.c | 19 +++++---- sys/arch/arm/sunxi/sunxi_dep.c | 6 +-- sys/arch/arm/sunxi/sunxi_drm.c | 21 +++++----- sys/arch/arm/sunxi/sunxi_dwhdmi.c | 14 +++---- sys/arch/arm/sunxi/sunxi_emac.c | 10 ++--- sys/arch/arm/sunxi/sunxi_gates.c | 14 +++---- sys/arch/arm/sunxi/sunxi_gmac.c | 12 +++--- sys/arch/arm/sunxi/sunxi_gmacclk.c | 12 ++++-- sys/arch/arm/sunxi/sunxi_gpio.c | 8 ++-- sys/arch/arm/sunxi/sunxi_hdmi.c | 8 ++-- sys/arch/arm/sunxi/sunxi_hdmiphy.c | 8 ++-- sys/arch/arm/sunxi/sunxi_hstimer.c | 16 ++++---- sys/arch/arm/sunxi/sunxi_i2s.c | 8 ++-- sys/arch/arm/sunxi/sunxi_intc.c | 12 +++--- sys/arch/arm/sunxi/sunxi_lcdc.c | 8 ++-- sys/arch/arm/sunxi/sunxi_lradc.c | 6 +-- sys/arch/arm/sunxi/sunxi_mixer.c | 8 ++-- sys/arch/arm/sunxi/sunxi_mmc.c | 8 ++-- sys/arch/arm/sunxi/sunxi_musb.c | 8 ++-- sys/arch/arm/sunxi/sunxi_nand.c | 12 +++--- sys/arch/arm/sunxi/sunxi_nmi.c | 8 ++-- sys/arch/arm/sunxi/sunxi_platform.c | 24 ++++++------ sys/arch/arm/sunxi/sunxi_pwm.c | 6 +-- sys/arch/arm/sunxi/sunxi_resets.c | 12 +++--- sys/arch/arm/sunxi/sunxi_rsb.c | 8 ++-- sys/arch/arm/sunxi/sunxi_rtc.c | 8 ++-- sys/arch/arm/sunxi/sunxi_sata.c | 12 +++--- sys/arch/arm/sunxi/sunxi_sid.c | 8 ++-- sys/arch/arm/sunxi/sunxi_sramc.c | 10 ++--- sys/arch/arm/sunxi/sunxi_tcon.c | 8 ++-- sys/arch/arm/sunxi/sunxi_thermal.c | 8 ++-- sys/arch/arm/sunxi/sunxi_timer.c | 12 +++--- sys/arch/arm/sunxi/sunxi_ts.c | 8 ++-- sys/arch/arm/sunxi/sunxi_twi.c | 8 ++-- sys/arch/arm/sunxi/sunxi_usb3phy.c | 8 ++-- sys/arch/arm/sunxi/sunxi_usbphy.c | 8 ++-- sys/arch/arm/sunxi/sunxi_wdt.c | 8 ++-- sys/arch/arm/ti/am3_prcm.c | 32 ++++++++------- sys/arch/arm/ti/if_cpsw.c | 17 ++++---- sys/arch/arm/ti/omap2_nand.c | 14 +++---- sys/arch/arm/ti/omap3_cm.c | 12 +++--- sys/arch/arm/ti/omap3_dss.c | 14 +++---- sys/arch/arm/ti/omap3_prm.c | 12 +++--- sys/arch/arm/ti/ti_com.c | 16 ++++---- sys/arch/arm/ti/ti_cpufreq.c | 12 ++++-- sys/arch/arm/ti/ti_div_clock.c | 12 +++--- sys/arch/arm/ti/ti_dpll_clock.c | 10 ++--- sys/arch/arm/ti/ti_edma.c | 12 +++--- sys/arch/arm/ti/ti_ehci.c | 15 +++---- sys/arch/arm/ti/ti_gpio.c | 8 ++-- sys/arch/arm/ti/ti_gpmc.c | 12 +++--- sys/arch/arm/ti/ti_iic.c | 8 ++-- sys/arch/arm/ti/ti_lcdc.c | 12 +++--- sys/arch/arm/ti/ti_motg.c | 12 +++--- sys/arch/arm/ti/ti_mux_clock.c | 12 ++++-- sys/arch/arm/ti/ti_omapintc.c | 8 ++-- sys/arch/arm/ti/ti_omaptimer.c | 8 ++-- sys/arch/arm/ti/ti_otg.c | 12 +++--- sys/arch/arm/ti/ti_rng.c | 12 +++--- sys/arch/arm/ti/ti_sdhc.c | 8 ++-- sys/arch/arm/ti/ti_sysc.c | 12 +++--- sys/arch/arm/ti/ti_tptc.c | 12 +++--- sys/arch/arm/ti/ti_usb.c | 12 +++--- sys/arch/arm/ti/ti_usbtll.c | 12 +++--- sys/arch/arm/ti/ti_wdt.c | 12 +++--- sys/arch/arm/vexpress/vexpress_sysreg.c | 11 ++++-- sys/arch/arm/xilinx/zynq7000_sdhc.c | 12 +++--- sys/arch/arm/xilinx/zynq7000_uart.c | 16 ++++---- sys/arch/arm/xilinx/zynq7000_usb.c | 12 +++--- sys/arch/arm/xilinx/zynq_cemac.c | 12 +++--- sys/arch/mips/cavium/dev/octeon_cib.c | 6 +-- sys/arch/mips/cavium/dev/octeon_intc.c | 8 ++-- sys/arch/mips/cavium/dev/octeon_pip.c | 20 +++++----- sys/arch/mips/cavium/dev/octeon_smi.c | 12 +++--- sys/arch/mips/cavium/dev/octeon_xhci.c | 10 ++--- sys/arch/shark/ofw/chipsfb_ofbus.c | 19 ++++----- sys/arch/shark/ofw/igsfb_ofbus.c | 17 ++++---- sys/arch/shark/ofw/ofrom.c | 13 ++++--- sys/arch/shark/ofw/vga_ofbus.c | 11 ++++-- sys/arch/shark/ofw/vlpci.c | 15 +++---- sys/dev/fdt/ahcisata_fdt.c | 14 +++---- sys/dev/fdt/amdccp_fdt.c | 6 +-- sys/dev/fdt/arasan_sdhc_fdt.c | 18 +++++---- sys/dev/fdt/ausoc.c | 11 ++++-- sys/dev/fdt/connector_fdt.c | 8 ++-- sys/dev/fdt/cpufreq_dt.c | 12 ++++-- sys/dev/fdt/dw_apb_uart.c | 14 +++---- sys/dev/fdt/dwc2_fdt.c | 8 ++-- sys/dev/fdt/dwc3_fdt.c | 39 +++++++++++-------- sys/dev/fdt/dwcmmc_fdt.c | 8 ++-- sys/dev/fdt/dwcwdt_fdt.c | 12 +++--- sys/dev/fdt/dwiic_fdt.c | 12 +++--- sys/dev/fdt/ehci_fdt.c | 15 +++---- sys/dev/fdt/fdt_panel.c | 12 +++--- sys/dev/fdt/fdtbus.c | 6 +-- sys/dev/fdt/fixedclock.c | 12 ++++-- sys/dev/fdt/fixedfactorclock.c | 12 ++++-- sys/dev/fdt/fixedregulator.c | 12 ++++-- sys/dev/fdt/genet_fdt.c | 15 +++---- sys/dev/fdt/gpiokeys.c | 12 ++++-- sys/dev/fdt/gpioleds.c | 12 ++++-- sys/dev/fdt/gpioregulator.c | 12 ++++-- sys/dev/fdt/hdmi_connector.c | 12 +++--- sys/dev/fdt/i2cmux_fdt.c | 8 ++-- sys/dev/fdt/mmc_pwrseq_emmc.c | 12 +++--- sys/dev/fdt/mmc_pwrseq_simple.c | 12 +++--- sys/dev/fdt/ns8250_uart.c | 12 +++--- sys/dev/fdt/ohci_fdt.c | 15 +++---- sys/dev/fdt/panel_fdt.c | 8 ++-- sys/dev/fdt/pinctrl_single.c | 8 ++-- sys/dev/fdt/pl061gpio_fdt.c | 15 +++---- sys/dev/fdt/pwm_backlight.c | 12 +++--- sys/dev/fdt/pwm_fan.c | 12 +++--- sys/dev/fdt/pwmregulator.c | 12 +++--- sys/dev/fdt/qemufwcfg_fdt.c | 12 +++--- sys/dev/fdt/simple_amplifier.c | 12 +++--- sys/dev/fdt/simplefb.c | 14 +++---- sys/dev/fdt/spdif_tx.c | 12 +++--- sys/dev/fdt/syscon.c | 14 +++---- sys/dev/fdt/usbnopphy.c | 12 +++--- sys/dev/fdt/virtio_mmio_fdt.c | 12 +++--- sys/dev/fdt/vmt_fdt.c | 6 +-- sys/dev/i2c/twl4030.c | 8 ++-- sys/dev/ofisa/atppc_ofisa.c | 6 +-- sys/dev/ofisa/com_ofisa.c | 6 +-- sys/dev/ofisa/ess_ofisa.c | 6 +-- sys/dev/ofisa/if_cs_ofisa.c | 6 +-- sys/dev/ofisa/joy_ofisa.c | 6 +-- sys/dev/ofisa/lpt_ofisa.c | 6 +-- sys/dev/ofisa/ofisa.c | 6 +-- sys/dev/ofisa/pckbc_ofisa.c | 8 ++-- sys/dev/ofisa/sb_ofisa.c | 6 +-- sys/dev/ofisa/wdc_ofisa.c | 6 +-- sys/dev/ofw/ofw_subr.c | 14 +++---- sys/dev/ofw/openfirm.h | 6 +-- sys/dev/sdmmc/if_bwfm_sdio.c | 10 ++--- .../interface/vchiq_arm/vchiq_netbsd_fdt.c | 12 ++++-- 330 files changed, 2152 insertions(+), 1895 deletions(-) diff --git a/sys/arch/arm/altera/cycv_clkmgr.c b/sys/arch/arm/altera/cycv_clkmgr.c index de6dbd09a595..1b578045e159 100644 --- a/sys/arch/arm/altera/cycv_clkmgr.c +++ b/sys/arch/arm/altera/cycv_clkmgr.c @@ -1,9 +1,9 @@ -/* $NetBSD: cycv_clkmgr.c,v 1.7 2021/01/27 01:47:40 thorpej Exp $ */ +/* $NetBSD: cycv_clkmgr.c,v 1.8 2021/01/27 03:10:18 thorpej Exp $ */ /* This file is in the public domain. */ #include -__KERNEL_RCSID(0, "$NetBSD: cycv_clkmgr.c,v 1.7 2021/01/27 01:47:40 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cycv_clkmgr.c,v 1.8 2021/01/27 03:10:18 thorpej Exp $"); #include #include @@ -121,7 +121,7 @@ cycv_clkmgr_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args *faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -239,7 +239,7 @@ cycv_clkmgr_clock_parse(struct cycv_clkmgr_softc *sc, int handle, u_int clkno) clk->refcnt = 0; const struct device_compatible_entry * const dce = - of_search_compatible(handle, clock_types); + of_compatible_lookup(handle, clock_types); if (dce == NULL) goto err; clk->type = dce->value; diff --git a/sys/arch/arm/altera/cycv_dwcmmc.c b/sys/arch/arm/altera/cycv_dwcmmc.c index efadf69634dd..ba63409b897d 100644 --- a/sys/arch/arm/altera/cycv_dwcmmc.c +++ b/sys/arch/arm/altera/cycv_dwcmmc.c @@ -1,4 +1,4 @@ -/* $NetBSD: cycv_dwcmmc.c,v 1.5 2020/03/20 06:23:51 skrll Exp $ */ +/* $NetBSD: cycv_dwcmmc.c,v 1.6 2021/01/27 03:10:18 thorpej Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cycv_dwcmmc.c,v 1.5 2020/03/20 06:23:51 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cycv_dwcmmc.c,v 1.6 2021/01/27 03:10:18 thorpej Exp $"); #include #include @@ -63,9 +63,9 @@ struct cycv_dwcmmc_softc { CFATTACH_DECL_NEW(cycv_dwcmmc, sizeof(struct dwc_mmc_softc), cycv_dwcmmc_match, cycv_dwcmmc_attach, NULL, NULL); -static const char * const cycv_dwcmmc_compat[] = { - "altr,socfpga-dw-mshc", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "altr,socfpga-dw-mshc" }, + DEVICE_COMPAT_EOL }; static int @@ -73,7 +73,7 @@ cycv_dwcmmc_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, cycv_dwcmmc_compat); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/altera/cycv_gmac.c b/sys/arch/arm/altera/cycv_gmac.c index 9da80a12bd2c..83c866abff6d 100644 --- a/sys/arch/arm/altera/cycv_gmac.c +++ b/sys/arch/arm/altera/cycv_gmac.c @@ -1,4 +1,4 @@ -/* $NetBSD: cycv_gmac.c,v 1.4 2019/07/21 08:24:32 mrg Exp $ */ +/* $NetBSD: cycv_gmac.c,v 1.5 2021/01/27 03:10:18 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -30,7 +30,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: cycv_gmac.c,v 1.4 2019/07/21 08:24:32 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cycv_gmac.c,v 1.5 2021/01/27 03:10:18 thorpej Exp $"); #include #include @@ -51,7 +51,10 @@ __KERNEL_RCSID(0, "$NetBSD: cycv_gmac.c,v 1.4 2019/07/21 08:24:32 mrg Exp $"); #include -static const char * compatible[] = { "altr,socfpga-stmmac", NULL }; +static const struct device_compatible_entry compat_data[] = { + { .compat = "altr,socfpga-stmmac" }, + DEVICE_COMPAT_EOL +}; static int cycv_gmac_intr(void *arg) @@ -64,7 +67,7 @@ cycv_gmac_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/altera/cycv_rstmgr.c b/sys/arch/arm/altera/cycv_rstmgr.c index 5f3b4df4c795..93734d9d4d17 100644 --- a/sys/arch/arm/altera/cycv_rstmgr.c +++ b/sys/arch/arm/altera/cycv_rstmgr.c @@ -1,9 +1,9 @@ -/* $NetBSD: cycv_rstmgr.c,v 1.3 2019/10/18 06:50:08 skrll Exp $ */ +/* $NetBSD: cycv_rstmgr.c,v 1.4 2021/01/27 03:10:18 thorpej Exp $ */ /* This file is in the public domain. */ #include -__KERNEL_RCSID(0, "$NetBSD: cycv_rstmgr.c,v 1.3 2019/10/18 06:50:08 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cycv_rstmgr.c,v 1.4 2021/01/27 03:10:18 thorpej Exp $"); #include #include @@ -49,13 +49,17 @@ CFATTACH_DECL_NEW(cycvrstmgr, sizeof (struct cycv_rstmgr_softc), static struct cycv_rstmgr_softc *cycv_rstmgr_sc; +static const struct device_compatible_entry compat_data[] = { + { .compat = "altr,rst-mgr" }, + DEVICE_COMPAT_EOL +}; + static int cycv_rstmgr_match(device_t parent, cfdata_t cf, void *aux) { - const char *compatible[] = { "altr,rst-mgr", NULL }; struct fdt_attach_args *faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/amlogic/meson6_timer.c b/sys/arch/arm/amlogic/meson6_timer.c index 92937468829a..822dfc18f5e6 100644 --- a/sys/arch/arm/amlogic/meson6_timer.c +++ b/sys/arch/arm/amlogic/meson6_timer.c @@ -1,4 +1,4 @@ -/* $NetBSD: meson6_timer.c,v 1.1 2019/08/14 15:08:53 skrll Exp $ */ +/* $NetBSD: meson6_timer.c,v 1.2 2021/01/27 03:10:18 thorpej Exp $ */ /*- * Copyright (c) 2019 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: meson6_timer.c,v 1.1 2019/08/14 15:08:53 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: meson6_timer.c,v 1.2 2021/01/27 03:10:18 thorpej Exp $"); #include #include @@ -97,17 +97,17 @@ meson6_timer_get_timecount(struct timecounter *tc) return TIMER_READ(sc, MESON_TIMERE); } +static const struct device_compatible_entry compat_data[] = { + { .compat = "amlogic,meson6-timer" }, + DEVICE_COMPAT_EOL +}; static int meson6_timer_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "amlogic,meson6-timer", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/amlogic/meson8b_clkc.c b/sys/arch/arm/amlogic/meson8b_clkc.c index b6f4f0cb2123..0dbf3f1cd2d8 100644 --- a/sys/arch/arm/amlogic/meson8b_clkc.c +++ b/sys/arch/arm/amlogic/meson8b_clkc.c @@ -1,4 +1,4 @@ -/* $NetBSD: meson8b_clkc.c,v 1.5 2019/08/16 10:36:06 jmcneill Exp $ */ +/* $NetBSD: meson8b_clkc.c,v 1.6 2021/01/27 03:10:18 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: meson8b_clkc.c,v 1.5 2019/08/16 10:36:06 jmcneill Exp $"); +__KERNEL_RCSID(1, "$NetBSD: meson8b_clkc.c,v 1.6 2021/01/27 03:10:18 thorpej Exp $"); #include #include @@ -73,10 +73,10 @@ __KERNEL_RCSID(1, "$NetBSD: meson8b_clkc.c,v 1.5 2019/08/16 10:36:06 jmcneill Ex static int meson8b_clkc_match(device_t, cfdata_t, void *); static void meson8b_clkc_attach(device_t, device_t, void *); -static const char * const compatible[] = { - "amlogic,meson8-clkc", - "amlogic,meson8b-clkc", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "amlogic,meson8-clkc" }, + { .compat = "amlogic,meson8b-clkc" }, + DEVICE_COMPAT_EOL }; CFATTACH_DECL_NEW(meson8b_clkc, sizeof(struct meson_clk_softc), @@ -326,7 +326,7 @@ meson8b_clkc_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/amlogic/meson_dwmac.c b/sys/arch/arm/amlogic/meson_dwmac.c index c823e70ac53b..44232884c068 100644 --- a/sys/arch/arm/amlogic/meson_dwmac.c +++ b/sys/arch/arm/amlogic/meson_dwmac.c @@ -1,4 +1,4 @@ -/* $NetBSD: meson_dwmac.c,v 1.10 2021/01/15 18:42:40 ryo Exp $ */ +/* $NetBSD: meson_dwmac.c,v 1.11 2021/01/27 03:10:18 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: meson_dwmac.c,v 1.10 2021/01/15 18:42:40 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: meson_dwmac.c,v 1.11 2021/01/27 03:10:18 thorpej Exp $"); #include #include @@ -57,12 +57,12 @@ __KERNEL_RCSID(0, "$NetBSD: meson_dwmac.c,v 1.10 2021/01/15 18:42:40 ryo Exp $") #define TX_CLK_DELAY __BITS(6,5) #define PHY_INTERFACE_SEL __BIT(0) -static const char * compatible[] = { - "amlogic,meson8b-dwmac", - "amlogic,meson-gx-dwmac", - "amlogic,meson-gxbb-dwmac", - "amlogic,meson-axg-dwmac", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "amlogic,meson8b-dwmac" }, + { .compat = "amlogic,meson-gx-dwmac" }, + { .compat = "amlogic,meson-gxbb-dwmac" }, + { .compat = "amlogic,meson-axg-dwmac" }, + DEVICE_COMPAT_EOL }; static int @@ -146,7 +146,7 @@ meson_dwmac_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/amlogic/meson_genfb.c b/sys/arch/arm/amlogic/meson_genfb.c index 8ec4574e0c07..ff2d12000c5f 100644 --- a/sys/arch/arm/amlogic/meson_genfb.c +++ b/sys/arch/arm/amlogic/meson_genfb.c @@ -1,4 +1,4 @@ -/* $NetBSD: meson_genfb.c,v 1.1 2019/01/19 21:43:43 jmcneill Exp $ */ +/* $NetBSD: meson_genfb.c,v 1.2 2021/01/27 03:10:18 thorpej Exp $ */ /*- * Copyright (c) 2015-2019 Jared McNeill @@ -33,7 +33,7 @@ #include "opt_wsdisplay_compat.h" #include -__KERNEL_RCSID(0, "$NetBSD: meson_genfb.c,v 1.1 2019/01/19 21:43:43 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: meson_genfb.c,v 1.2 2021/01/27 03:10:18 thorpej Exp $"); #include #include @@ -52,9 +52,9 @@ __KERNEL_RCSID(0, "$NetBSD: meson_genfb.c,v 1.1 2019/01/19 21:43:43 jmcneill Exp #include -static const char * const compatible[] = { - "amlogic,meson8b-fb", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "amlogic,meson8b-fb" }, + DEVICE_COMPAT_EOL }; #define AMLOGIC_GENFB_DEFAULT_DEPTH 16 @@ -172,7 +172,7 @@ meson_genfb_match(device_t parent, cfdata_t match, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -710,7 +710,7 @@ meson_genfb_ddb_trap_callback(int where) static int meson_genfb_console_match(int phandle) { - return of_match_compatible(phandle, compatible); + return of_compatible_match(phandle, compat_data); } static void diff --git a/sys/arch/arm/amlogic/meson_pinctrl.c b/sys/arch/arm/amlogic/meson_pinctrl.c index ab0175d82ca5..911a8824f269 100644 --- a/sys/arch/arm/amlogic/meson_pinctrl.c +++ b/sys/arch/arm/amlogic/meson_pinctrl.c @@ -1,4 +1,4 @@ -/* $NetBSD: meson_pinctrl.c,v 1.10 2021/01/27 01:49:36 thorpej Exp $ */ +/* $NetBSD: meson_pinctrl.c,v 1.11 2021/01/27 03:10:18 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared D. McNeill @@ -29,7 +29,7 @@ #include "opt_soc.h" #include -__KERNEL_RCSID(0, "$NetBSD: meson_pinctrl.c,v 1.10 2021/01/27 01:49:36 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: meson_pinctrl.c,v 1.11 2021/01/27 03:10:18 thorpej Exp $"); #include #include @@ -574,7 +574,7 @@ meson_pinctrl_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -586,7 +586,7 @@ meson_pinctrl_attach(device_t parent, device_t self, void *aux) sc->sc_dev = self; sc->sc_phandle = faa->faa_phandle; sc->sc_bst = faa->faa_bst; - sc->sc_conf = of_search_compatible(sc->sc_phandle, compat_data)->data; + sc->sc_conf = of_compatible_lookup(sc->sc_phandle, compat_data)->data; mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_VM); if (meson_pinctrl_initres(sc) != 0) diff --git a/sys/arch/arm/amlogic/meson_pwm.c b/sys/arch/arm/amlogic/meson_pwm.c index 884c24f22cd9..a80de7e61d5e 100644 --- a/sys/arch/arm/amlogic/meson_pwm.c +++ b/sys/arch/arm/amlogic/meson_pwm.c @@ -1,4 +1,4 @@ -/* $NetBSD: meson_pwm.c,v 1.4 2021/01/27 01:49:36 thorpej Exp $ */ +/* $NetBSD: meson_pwm.c,v 1.5 2021/01/27 03:10:18 thorpej Exp $ */ /* * Copyright (c) 2021 Ryo Shimizu @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: meson_pwm.c,v 1.4 2021/01/27 01:49:36 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: meson_pwm.c,v 1.5 2021/01/27 03:10:18 thorpej Exp $"); #include #include @@ -327,7 +327,7 @@ meson_pwm_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/amlogic/meson_resets.c b/sys/arch/arm/amlogic/meson_resets.c index 7dfb2e9572bc..09ba2a1f2eef 100644 --- a/sys/arch/arm/amlogic/meson_resets.c +++ b/sys/arch/arm/amlogic/meson_resets.c @@ -1,4 +1,4 @@ -/* $NetBSD: meson_resets.c,v 1.3 2021/01/01 07:15:18 ryo Exp $ */ +/* $NetBSD: meson_resets.c,v 1.4 2021/01/27 03:10:18 thorpej Exp $ */ /*- * Copyright (c) 2017-2019 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: meson_resets.c,v 1.3 2021/01/01 07:15:18 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: meson_resets.c,v 1.4 2021/01/27 03:10:18 thorpej Exp $"); #include #include @@ -43,11 +43,11 @@ __KERNEL_RCSID(0, "$NetBSD: meson_resets.c,v 1.3 2021/01/01 07:15:18 ryo Exp $") #define LEVEL_OFFSET 0x7c -static const char * compatible[] = { - "amlogic,meson8b-reset", - "amlogic,meson-axg-reset", - "amlogic,meson-gxbb-reset", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "amlogic,meson8b-reset" }, + { .compat = "amlogic,meson-axg-reset" }, + { .compat = "amlogic,meson-gxbb-reset" }, + DEVICE_COMPAT_EOL }; struct meson_resets_softc { @@ -118,7 +118,7 @@ meson_resets_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/amlogic/meson_rng.c b/sys/arch/arm/amlogic/meson_rng.c index 02c820b793bc..b5e943f2819e 100644 --- a/sys/arch/arm/amlogic/meson_rng.c +++ b/sys/arch/arm/amlogic/meson_rng.c @@ -1,4 +1,4 @@ -/* $NetBSD: meson_rng.c,v 1.3 2020/04/30 03:40:52 riastradh Exp $ */ +/* $NetBSD: meson_rng.c,v 1.4 2021/01/27 03:10:18 thorpej Exp $ */ /*- * Copyright (c) 2015-2019 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: meson_rng.c,v 1.3 2020/04/30 03:40:52 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: meson_rng.c,v 1.4 2021/01/27 03:10:18 thorpej Exp $"); #include #include @@ -53,9 +53,9 @@ struct meson_rng_softc { krndsource_t sc_rndsource; }; -static const char * const compatible[] = { - "amlogic,meson-rng", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "amlogic,meson-rng" }, + DEVICE_COMPAT_EOL }; CFATTACH_DECL_NEW(meson_rng, sizeof(struct meson_rng_softc), @@ -66,7 +66,7 @@ meson_rng_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/amlogic/meson_rtc.c b/sys/arch/arm/amlogic/meson_rtc.c index a599586d715d..4e0f217a3b24 100644 --- a/sys/arch/arm/amlogic/meson_rtc.c +++ b/sys/arch/arm/amlogic/meson_rtc.c @@ -1,4 +1,4 @@ -/* $NetBSD: meson_rtc.c,v 1.2 2019/01/20 20:22:13 jmcneill Exp $ */ +/* $NetBSD: meson_rtc.c,v 1.3 2021/01/27 03:10:18 thorpej Exp $ */ /*- * Copyright (c) 2015 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: meson_rtc.c,v 1.2 2019/01/20 20:22:13 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: meson_rtc.c,v 1.3 2021/01/27 03:10:18 thorpej Exp $"); #include #include @@ -55,9 +55,9 @@ struct meson_rtc_softc { unsigned int sc_busy; }; -static const char * const compatible[] = { - "amlogic,meson8b-rtc", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "amlogic,meson8b-rtc" }, + DEVICE_COMPAT_EOL }; static int meson_rtc_match(device_t, cfdata_t, void *); @@ -112,7 +112,7 @@ meson_rtc_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/amlogic/meson_sdhc.c b/sys/arch/arm/amlogic/meson_sdhc.c index a6cb23f61a41..f5a1f226be80 100644 --- a/sys/arch/arm/amlogic/meson_sdhc.c +++ b/sys/arch/arm/amlogic/meson_sdhc.c @@ -1,4 +1,4 @@ -/* $NetBSD: meson_sdhc.c,v 1.2 2021/01/15 18:42:40 ryo Exp $ */ +/* $NetBSD: meson_sdhc.c,v 1.3 2021/01/27 03:10:18 thorpej Exp $ */ /*- * Copyright (c) 2015-2019 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: meson_sdhc.c,v 1.2 2021/01/15 18:42:40 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: meson_sdhc.c,v 1.3 2021/01/27 03:10:18 thorpej Exp $"); #include #include @@ -150,14 +150,14 @@ meson_sdhc_set_clear(struct meson_sdhc_softc *sc, bus_addr_t reg, uint32_t set, SDHC_WRITE(sc, reg, new); } -static const char * const compatible[] = { - "amlogic,meson8b-sdhc", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "amlogic,meson8b-sdhc" }, + DEVICE_COMPAT_EOL }; -static const char * const slot_compatible[] = { - "mmc-slot", - NULL +static const struct device_compatible_entry slot_compat_data[] = { + { .compat = "mmc-slot" }, + DEVICE_COMPAT_EOL }; static int @@ -165,7 +165,7 @@ meson_sdhc_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -215,7 +215,7 @@ meson_sdhc_attach(device_t parent, device_t self, void *aux) sc->sc_port = -1; for (child = OF_child(phandle); child; child = OF_peer(child)) - if (of_match_compatible(child, slot_compatible) > 0) { + if (of_compatible_match(child, slot_compat_data)) { if (fdtbus_get_reg(child, 0, &port, NULL) == 0) { sc->sc_slot_phandle = child; sc->sc_port = port; diff --git a/sys/arch/arm/amlogic/meson_sdio.c b/sys/arch/arm/amlogic/meson_sdio.c index ed77629cb318..d8baf55e9656 100644 --- a/sys/arch/arm/amlogic/meson_sdio.c +++ b/sys/arch/arm/amlogic/meson_sdio.c @@ -1,4 +1,4 @@ -/* $NetBSD: meson_sdio.c,v 1.2 2021/01/15 18:42:40 ryo Exp $ */ +/* $NetBSD: meson_sdio.c,v 1.3 2021/01/27 03:10:18 thorpej Exp $ */ /*- * Copyright (c) 2015-2019 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: meson_sdio.c,v 1.2 2021/01/15 18:42:40 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: meson_sdio.c,v 1.3 2021/01/27 03:10:18 thorpej Exp $"); #include #include @@ -130,14 +130,14 @@ static struct sdmmc_chip_functions meson_sdio_chip_functions = { #define SDIO_READ(sc, reg) \ bus_space_read_4((sc)->sc_bst, (sc)->sc_bsh, (reg)) -static const char * const compatible[] = { - "amlogic,meson8b-sdio", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "amlogic,meson8b-sdio" }, + DEVICE_COMPAT_EOL }; -static const char * const slot_compatible[] = { - "mmc-slot", - NULL +static const struct device_compatible_entry slot_compat_data[] = { + { .compat = "mmc-slot" }, + DEVICE_COMPAT_EOL }; static int @@ -145,7 +145,7 @@ meson_sdio_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -195,7 +195,7 @@ meson_sdio_attach(device_t parent, device_t self, void *aux) sc->sc_cur_port = -1; for (child = OF_child(phandle); child; child = OF_peer(child)) - if (of_match_compatible(child, slot_compatible) > 0) { + if (of_compatible_match(child, slot_compat_data)) { if (fdtbus_get_reg(child, 0, &port, NULL) == 0) { sc->sc_slot_phandle = child; sc->sc_cur_port = port; diff --git a/sys/arch/arm/amlogic/meson_thermal.c b/sys/arch/arm/amlogic/meson_thermal.c index a54d0e68c53e..6b17d5276e76 100644 --- a/sys/arch/arm/amlogic/meson_thermal.c +++ b/sys/arch/arm/amlogic/meson_thermal.c @@ -1,4 +1,4 @@ -/* $NetBSD: meson_thermal.c,v 1.5 2021/01/27 01:49:36 thorpej Exp $ */ +/* $NetBSD: meson_thermal.c,v 1.6 2021/01/27 03:10:18 thorpej Exp $ */ /* * Copyright (c) 2021 Ryo Shimizu @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: meson_thermal.c,v 1.5 2021/01/27 01:49:36 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: meson_thermal.c,v 1.6 2021/01/27 03:10:18 thorpej Exp $"); #include #include @@ -172,7 +172,7 @@ meson_thermal_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -187,7 +187,7 @@ meson_thermal_attach(device_t parent, device_t self, void *aux) sc->sc_dev = self; sc->sc_bst = faa->faa_bst; sc->sc_phandle = phandle = faa->faa_phandle; - sc->sc_conf = of_search_compatible(phandle, compat_data)->data; + sc->sc_conf = of_compatible_lookup(phandle, compat_data)->data; if (fdtbus_get_reg(phandle, 0, &addr, &size) != 0) { aprint_error(": couldn't get registers\n"); diff --git a/sys/arch/arm/amlogic/meson_uart.c b/sys/arch/arm/amlogic/meson_uart.c index 1e6c0acc28b3..1363b930f8c8 100644 --- a/sys/arch/arm/amlogic/meson_uart.c +++ b/sys/arch/arm/amlogic/meson_uart.c @@ -1,4 +1,4 @@ -/* $NetBSD: meson_uart.c,v 1.4 2021/01/15 18:42:40 ryo Exp $ */ +/* $NetBSD: meson_uart.c,v 1.5 2021/01/27 03:10:18 thorpej Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: meson_uart.c,v 1.4 2021/01/15 18:42:40 ryo Exp $"); +__KERNEL_RCSID(1, "$NetBSD: meson_uart.c,v 1.5 2021/01/27 03:10:18 thorpej Exp $"); #define cn_trap() \ do { \ @@ -75,12 +75,12 @@ static int meson_uart_param(struct tty *, struct termios *); extern struct cfdriver mesonuart_cd; -static const char * const compatible[] = { - "amlogic,meson6-uart", - "amlogic,meson8-uart", - "amlogic,meson8b-uart", - "amlogic,meson-gx-uart", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "amlogic,meson6-uart" }, + { .compat = "amlogic,meson8-uart" }, + { .compat = "amlogic,meson8b-uart" }, + { .compat = "amlogic,meson-gx-uart" }, + DEVICE_COMPAT_EOL }; struct meson_uart_softc { @@ -151,7 +151,7 @@ meson_uart_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -513,7 +513,7 @@ meson_uart_rxsoft(void *priv) static int meson_uart_console_match(int phandle) { - return of_match_compatible(phandle, compatible); + return of_compatible_match(phandle, compat_data); } static void diff --git a/sys/arch/arm/amlogic/meson_usbctrl.c b/sys/arch/arm/amlogic/meson_usbctrl.c index 67475ad7a94c..8590efef67e0 100644 --- a/sys/arch/arm/amlogic/meson_usbctrl.c +++ b/sys/arch/arm/amlogic/meson_usbctrl.c @@ -1,4 +1,4 @@ -/* $NetBSD: meson_usbctrl.c,v 1.4 2021/01/27 01:49:36 thorpej Exp $ */ +/* $NetBSD: meson_usbctrl.c,v 1.5 2021/01/27 03:10:18 thorpej Exp $ */ /* * Copyright (c) 2021 Ryo Shimizu @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: meson_usbctrl.c,v 1.4 2021/01/27 01:49:36 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: meson_usbctrl.c,v 1.5 2021/01/27 03:10:18 thorpej Exp $"); #include #include @@ -252,7 +252,7 @@ meson_usbctrl_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -267,7 +267,7 @@ meson_usbctrl_attach(device_t parent, device_t self, void *aux) sc->sc_dev = self; sc->sc_bst = faa->faa_bst; sc->sc_phandle = phandle = faa->faa_phandle; - sc->sc_conf = of_search_compatible(phandle, compat_data)->data; + sc->sc_conf = of_compatible_lookup(phandle, compat_data)->data; if (fdtbus_get_reg(phandle, 0, &addr, &size) != 0) { aprint_error(": couldn't get registers\n"); diff --git a/sys/arch/arm/amlogic/meson_usbphy.c b/sys/arch/arm/amlogic/meson_usbphy.c index caf0fa351094..2f00529a372b 100644 --- a/sys/arch/arm/amlogic/meson_usbphy.c +++ b/sys/arch/arm/amlogic/meson_usbphy.c @@ -1,4 +1,4 @@ -/* $NetBSD: meson_usbphy.c,v 1.5 2021/01/27 01:49:36 thorpej Exp $ */ +/* $NetBSD: meson_usbphy.c,v 1.6 2021/01/27 03:10:18 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: meson_usbphy.c,v 1.5 2021/01/27 01:49:36 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: meson_usbphy.c,v 1.6 2021/01/27 03:10:18 thorpej Exp $"); #include #include @@ -187,7 +187,7 @@ meson_usbphy_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -205,7 +205,7 @@ meson_usbphy_attach(device_t parent, device_t self, void *aux) sc->sc_dev = self; sc->sc_bst = faa->faa_bst; sc->sc_phandle = phandle; - sc->sc_type = of_search_compatible(phandle, compat_data)->value; + sc->sc_type = of_compatible_lookup(phandle, compat_data)->value; if (fdtbus_get_reg(phandle, 0, &addr, &size) != 0) { aprint_error(": couldn't get registers\n"); diff --git a/sys/arch/arm/amlogic/meson_wdt.c b/sys/arch/arm/amlogic/meson_wdt.c index a286b1540773..497f2e0cce0e 100644 --- a/sys/arch/arm/amlogic/meson_wdt.c +++ b/sys/arch/arm/amlogic/meson_wdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: meson_wdt.c,v 1.1 2019/01/19 20:56:03 jmcneill Exp $ */ +/* $NetBSD: meson_wdt.c,v 1.2 2021/01/27 03:10:18 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: meson_wdt.c,v 1.1 2019/01/19 20:56:03 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: meson_wdt.c,v 1.2 2021/01/27 03:10:18 thorpej Exp $"); #include #include @@ -53,9 +53,9 @@ __KERNEL_RCSID(0, "$NetBSD: meson_wdt.c,v 1.1 2019/01/19 20:56:03 jmcneill Exp $ #define WATCHDOG_PERIOD_MAX 8 #define WATCHDOG_TICKS_PER_SEC 7812 -static const char * compatible[] = { - "amlogic,meson8b-wdt", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "amlogic,meson8b-wdt" }, + DEVICE_COMPAT_EOL }; struct meson_wdt_softc { @@ -117,7 +117,7 @@ meson_wdt_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/amlogic/mesong12_aoclkc.c b/sys/arch/arm/amlogic/mesong12_aoclkc.c index 6bbb539edf3f..afc2e72380ce 100644 --- a/sys/arch/arm/amlogic/mesong12_aoclkc.c +++ b/sys/arch/arm/amlogic/mesong12_aoclkc.c @@ -1,4 +1,4 @@ -/* $NetBSD: mesong12_aoclkc.c,v 1.1 2021/01/01 07:21:58 ryo Exp $ */ +/* $NetBSD: mesong12_aoclkc.c,v 1.2 2021/01/27 03:10:18 thorpej Exp $ */ /* * Copyright (c) 2021 Ryo Shimizu @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mesong12_aoclkc.c,v 1.1 2021/01/01 07:21:58 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mesong12_aoclkc.c,v 1.2 2021/01/27 03:10:18 thorpej Exp $"); #include #include @@ -48,9 +48,9 @@ __KERNEL_RCSID(0, "$NetBSD: mesong12_aoclkc.c,v 1.1 2021/01/01 07:21:58 ryo Exp static int mesong12_aoclkc_match(device_t, cfdata_t, void *); static void mesong12_aoclkc_attach(device_t, device_t, void *); -static const char * const compatible[] = { - "amlogic,meson-g12a-aoclkc", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "amlogic,meson-g12a-aoclkc" }, + DEVICE_COMPAT_EOL }; CFATTACH_DECL_NEW(mesong12_aoclkc, sizeof(struct meson_clk_softc), @@ -104,7 +104,7 @@ mesong12_aoclkc_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/amlogic/mesong12_clkc.c b/sys/arch/arm/amlogic/mesong12_clkc.c index 4dfb318e6e44..84b12663a4d9 100644 --- a/sys/arch/arm/amlogic/mesong12_clkc.c +++ b/sys/arch/arm/amlogic/mesong12_clkc.c @@ -1,4 +1,4 @@ -/* $NetBSD: mesong12_clkc.c,v 1.4 2021/01/27 01:49:36 thorpej Exp $ */ +/* $NetBSD: mesong12_clkc.c,v 1.5 2021/01/27 03:10:18 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mesong12_clkc.c,v 1.4 2021/01/27 01:49:36 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mesong12_clkc.c,v 1.5 2021/01/27 03:10:18 thorpej Exp $"); #include #include @@ -1503,7 +1503,7 @@ mesong12_clkc_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -1522,7 +1522,7 @@ mesong12_clkc_attach(device_t parent, device_t self, void *aux) return; } - conf = of_search_compatible(phandle, compat_data)->data; + conf = of_compatible_lookup(phandle, compat_data)->data; sc->sc_clks = conf->clks; sc->sc_nclks = conf->nclks; diff --git a/sys/arch/arm/amlogic/mesong12_usb2phy.c b/sys/arch/arm/amlogic/mesong12_usb2phy.c index 523256c404e3..204a7445a241 100644 --- a/sys/arch/arm/amlogic/mesong12_usb2phy.c +++ b/sys/arch/arm/amlogic/mesong12_usb2phy.c @@ -1,4 +1,4 @@ -/* $NetBSD: mesong12_usb2phy.c,v 1.1 2021/01/01 07:21:58 ryo Exp $ */ +/* $NetBSD: mesong12_usb2phy.c,v 1.2 2021/01/27 03:10:18 thorpej Exp $ */ /* * Copyright (c) 2021 Ryo Shimizu @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mesong12_usb2phy.c,v 1.1 2021/01/01 07:21:58 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mesong12_usb2phy.c,v 1.2 2021/01/27 03:10:18 thorpej Exp $"); #include #include @@ -271,9 +271,9 @@ mesong12_usb2phy_enable(device_t dev, void *priv, bool enable) return 0; } -static const char *compatible[] = { - "amlogic,g12a-usb2-phy", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "amlogic,g12a-usb2-phy" }, + DEVICE_COMPAT_EOL }; static int @@ -281,7 +281,7 @@ mesong12_usb2phy_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static const struct fdtbus_phy_controller_func mesong12_usb2phy_funcs = { diff --git a/sys/arch/arm/amlogic/mesong12_usb3pciephy.c b/sys/arch/arm/amlogic/mesong12_usb3pciephy.c index b04a6a9d22b9..577e8035333a 100644 --- a/sys/arch/arm/amlogic/mesong12_usb3pciephy.c +++ b/sys/arch/arm/amlogic/mesong12_usb3pciephy.c @@ -1,4 +1,4 @@ -/* $NetBSD: mesong12_usb3pciephy.c,v 1.1 2021/01/01 07:21:58 ryo Exp $ */ +/* $NetBSD: mesong12_usb3pciephy.c,v 1.2 2021/01/27 03:10:18 thorpej Exp $ */ /* * Copyright (c) 2021 Ryo Shimizu @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mesong12_usb3pciephy.c,v 1.1 2021/01/01 07:21:58 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mesong12_usb3pciephy.c,v 1.2 2021/01/27 03:10:18 thorpej Exp $"); #include #include @@ -283,9 +283,9 @@ mesong12_usb3pciephy_enable(device_t dev, void *priv, bool enable) return 0; } -static const char *compatible[] = { - "amlogic,g12a-usb3-pcie-phy", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "amlogic,g12a-usb3-pcie-phy" }, + DEVICE_COMPAT_EOL }; static int @@ -293,7 +293,7 @@ mesong12_usb3pciephy_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static const struct fdtbus_phy_controller_func mesong12_usb3pciephy_funcs = { diff --git a/sys/arch/arm/amlogic/mesongx_mmc.c b/sys/arch/arm/amlogic/mesongx_mmc.c index 286a724f0a9f..a7c3c22c8ff5 100644 --- a/sys/arch/arm/amlogic/mesongx_mmc.c +++ b/sys/arch/arm/amlogic/mesongx_mmc.c @@ -1,4 +1,4 @@ -/* $NetBSD: mesongx_mmc.c,v 1.12 2021/01/27 01:49:36 thorpej Exp $ */ +/* $NetBSD: mesongx_mmc.c,v 1.13 2021/01/27 03:10:18 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mesongx_mmc.c,v 1.12 2021/01/27 01:49:36 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mesongx_mmc.c,v 1.13 2021/01/27 03:10:18 thorpej Exp $"); #include #include @@ -279,7 +279,7 @@ mesongx_mmc_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -292,7 +292,7 @@ mesongx_mmc_attach(device_t parent, device_t self, void *aux) bus_addr_t addr; bus_size_t size; - sc->sc_hwtype = of_search_compatible(phandle, compat_data)->value; + sc->sc_hwtype = of_compatible_lookup(phandle, compat_data)->value; if (fdtbus_get_reg(phandle, 0, &addr, &size) != 0) { aprint_error(": couldn't get registers\n"); diff --git a/sys/arch/arm/amlogic/mesongx_wdt.c b/sys/arch/arm/amlogic/mesongx_wdt.c index fa9864b18fa8..131a73bc3028 100644 --- a/sys/arch/arm/amlogic/mesongx_wdt.c +++ b/sys/arch/arm/amlogic/mesongx_wdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: mesongx_wdt.c,v 1.1 2019/04/21 13:51:04 jmcneill Exp $ */ +/* $NetBSD: mesongx_wdt.c,v 1.2 2021/01/27 03:10:18 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mesongx_wdt.c,v 1.1 2019/04/21 13:51:04 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mesongx_wdt.c,v 1.2 2021/01/27 03:10:18 thorpej Exp $"); #include #include @@ -54,9 +54,9 @@ __KERNEL_RCSID(0, "$NetBSD: mesongx_wdt.c,v 1.1 2019/04/21 13:51:04 jmcneill Exp #define WATCHDOG_PERIOD_DEFAULT 8 #define WATCHDOG_PERIOD_MAX 8 -static const char * compatible[] = { - "amlogic,meson-gx-wdt", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "amlogic,meson-gx-wdt" }, + DEVICE_COMPAT_EOL }; struct mesongx_wdt_softc { @@ -120,7 +120,7 @@ mesongx_wdt_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/amlogic/mesongxbb_aoclkc.c b/sys/arch/arm/amlogic/mesongxbb_aoclkc.c index 5b8f562574a2..b02afdbcc8d7 100644 --- a/sys/arch/arm/amlogic/mesongxbb_aoclkc.c +++ b/sys/arch/arm/amlogic/mesongxbb_aoclkc.c @@ -1,4 +1,4 @@ -/* $NetBSD: mesongxbb_aoclkc.c,v 1.2 2019/04/19 19:07:56 jmcneill Exp $ */ +/* $NetBSD: mesongxbb_aoclkc.c,v 1.3 2021/01/27 03:10:18 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: mesongxbb_aoclkc.c,v 1.2 2019/04/19 19:07:56 jmcneill Exp $"); +__KERNEL_RCSID(1, "$NetBSD: mesongxbb_aoclkc.c,v 1.3 2021/01/27 03:10:18 thorpej Exp $"); #include #include @@ -47,10 +47,10 @@ __KERNEL_RCSID(1, "$NetBSD: mesongxbb_aoclkc.c,v 1.2 2019/04/19 19:07:56 jmcneil static int mesongxbb_aoclkc_match(device_t, cfdata_t, void *); static void mesongxbb_aoclkc_attach(device_t, device_t, void *); -static const char * const compatible[] = { - "amlogic,meson-gxbb-aoclkc", - "amlogic,meson-gxl-aoclkc", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "amlogic,meson-gxbb-aoclkc" }, + { .compat = "amlogic,meson-gxl-aoclkc" }, + DEVICE_COMPAT_EOL }; CFATTACH_DECL_NEW(mesongxbb_aoclkc, sizeof(struct meson_clk_softc), @@ -79,7 +79,7 @@ mesongxbb_aoclkc_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/amlogic/mesongxbb_clkc.c b/sys/arch/arm/amlogic/mesongxbb_clkc.c index 4b88817a5a22..ac6cd19f53de 100644 --- a/sys/arch/arm/amlogic/mesongxbb_clkc.c +++ b/sys/arch/arm/amlogic/mesongxbb_clkc.c @@ -1,4 +1,4 @@ -/* $NetBSD: mesongxbb_clkc.c,v 1.5 2021/01/27 01:49:36 thorpej Exp $ */ +/* $NetBSD: mesongxbb_clkc.c,v 1.6 2021/01/27 03:10:18 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: mesongxbb_clkc.c,v 1.5 2021/01/27 01:49:36 thorpej Exp $"); +__KERNEL_RCSID(1, "$NetBSD: mesongxbb_clkc.c,v 1.6 2021/01/27 03:10:18 thorpej Exp $"); #include #include @@ -228,7 +228,7 @@ mesongxbb_clkc_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -252,7 +252,7 @@ mesongxbb_clkc_attach(device_t parent, device_t self, void *aux) meson_clk_attach(sc); - conf = of_search_compatible(phandle, compat_data)->data; + conf = of_compatible_lookup(phandle, compat_data)->data; aprint_naive("\n"); aprint_normal(": %s clock controller\n", conf->name); diff --git a/sys/arch/arm/amlogic/mesongxl_usb2phy.c b/sys/arch/arm/amlogic/mesongxl_usb2phy.c index cf41c12e8d76..01f7f839f440 100644 --- a/sys/arch/arm/amlogic/mesongxl_usb2phy.c +++ b/sys/arch/arm/amlogic/mesongxl_usb2phy.c @@ -1,4 +1,4 @@ -/* $NetBSD: mesongxl_usb2phy.c,v 1.1 2019/04/19 19:07:56 jmcneill Exp $ */ +/* $NetBSD: mesongxl_usb2phy.c,v 1.2 2021/01/27 03:10:18 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: mesongxl_usb2phy.c,v 1.1 2019/04/19 19:07:56 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mesongxl_usb2phy.c,v 1.2 2021/01/27 03:10:18 thorpej Exp $"); #include #include @@ -48,9 +48,9 @@ __KERNEL_RCSID(0, "$NetBSD: mesongxl_usb2phy.c,v 1.1 2019/04/19 19:07:56 jmcneil static int mesongxl_usb2phy_match(device_t, cfdata_t, void *); static void mesongxl_usb2phy_attach(device_t, device_t, void *); -static const char *compatible[] = { - "amlogic,meson-gxl-usb2-phy", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "amlogic,meson-gxl-usb2-phy" }, + DEVICE_COMPAT_EOL }; struct mesongxl_usb2phy_softc { @@ -139,7 +139,7 @@ mesongxl_usb2phy_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/amlogic/mesongxl_usb3phy.c b/sys/arch/arm/amlogic/mesongxl_usb3phy.c index 66d8db22a6a9..dc9e86806620 100644 --- a/sys/arch/arm/amlogic/mesongxl_usb3phy.c +++ b/sys/arch/arm/amlogic/mesongxl_usb3phy.c @@ -1,4 +1,4 @@ -/* $NetBSD: mesongxl_usb3phy.c,v 1.1 2019/04/19 19:07:56 jmcneill Exp $ */ +/* $NetBSD: mesongxl_usb3phy.c,v 1.2 2021/01/27 03:10:18 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: mesongxl_usb3phy.c,v 1.1 2019/04/19 19:07:56 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mesongxl_usb3phy.c,v 1.2 2021/01/27 03:10:18 thorpej Exp $"); #include #include @@ -56,9 +56,9 @@ __KERNEL_RCSID(0, "$NetBSD: mesongxl_usb3phy.c,v 1.1 2019/04/19 19:07:56 jmcneil static int mesongxl_usb3phy_match(device_t, cfdata_t, void *); static void mesongxl_usb3phy_attach(device_t, device_t, void *); -static const char *compatible[] = { - "amlogic,meson-gxl-usb3-phy", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "amlogic,meson-gxl-usb3-phy" }, + DEVICE_COMPAT_EOL }; struct mesongxl_usb3phy_softc { @@ -148,7 +148,7 @@ mesongxl_usb3phy_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/broadcom/bcm2835_aux.c b/sys/arch/arm/broadcom/bcm2835_aux.c index eaa009c9f532..0618436f057b 100644 --- a/sys/arch/arm/broadcom/bcm2835_aux.c +++ b/sys/arch/arm/broadcom/bcm2835_aux.c @@ -1,4 +1,4 @@ -/* $NetBSD: bcm2835_aux.c,v 1.2 2018/09/09 07:21:17 aymeric Exp $ */ +/* $NetBSD: bcm2835_aux.c,v 1.3 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bcm2835_aux.c,v 1.2 2018/09/09 07:21:17 aymeric Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bcm2835_aux.c,v 1.3 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -97,13 +97,17 @@ struct bcmaux_softc { CFATTACH_DECL_NEW(bcmaux_fdt, sizeof(struct bcmaux_softc), bcmaux_match, bcmaux_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "brcm,bcm2835-aux" }, + DEVICE_COMPAT_EOL +}; + static int bcmaux_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { "brcm,bcm2835-aux", NULL }; const struct fdt_attach_args *faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/broadcom/bcm2835_bsc_fdt.c b/sys/arch/arm/broadcom/bcm2835_bsc_fdt.c index b6829fc9fc3f..78c703680c2f 100644 --- a/sys/arch/arm/broadcom/bcm2835_bsc_fdt.c +++ b/sys/arch/arm/broadcom/bcm2835_bsc_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: bcm2835_bsc_fdt.c,v 1.4 2020/12/23 16:02:11 thorpej Exp $ */ +/* $NetBSD: bcm2835_bsc_fdt.c,v 1.5 2021/01/27 03:10:19 thorpej Exp $ */ /* * Copyright (c) 2019 Jason R. Thorpe @@ -28,7 +28,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bcm2835_bsc_fdt.c,v 1.4 2020/12/23 16:02:11 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bcm2835_bsc_fdt.c,v 1.5 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -52,13 +52,17 @@ static void bsciic_fdt_attach(device_t, device_t, void *); CFATTACH_DECL_NEW(bsciic_fdt, sizeof(struct bsciic_softc), bsciic_fdt_match, bsciic_fdt_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "brcm,bcm2835-i2c" }, + DEVICE_COMPAT_EOL +}; + static int bsciic_fdt_match(device_t parent, cfdata_t match, void *aux) { - const char * const compatible[] = { "brcm,bcm2835-i2c", NULL }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/broadcom/bcm2835_cm.c b/sys/arch/arm/broadcom/bcm2835_cm.c index 8a93500322e0..1afef1108ddc 100644 --- a/sys/arch/arm/broadcom/bcm2835_cm.c +++ b/sys/arch/arm/broadcom/bcm2835_cm.c @@ -1,4 +1,4 @@ -/* $NetBSD: bcm2835_cm.c,v 1.2 2017/12/10 21:38:26 skrll Exp $ */ +/* $NetBSD: bcm2835_cm.c,v 1.3 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2015 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bcm2835_cm.c,v 1.2 2017/12/10 21:38:26 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bcm2835_cm.c,v 1.3 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -68,17 +68,18 @@ static int bcmcm_wait(struct bcm2835cm_softc *, int, int); CFATTACH_DECL_NEW(bcmcm_fdt, sizeof(struct bcm2835cm_softc), bcmcm_match, bcmcm_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "brcm,bcm2835-cprman" }, + DEVICE_COMPAT_EOL +}; + /* ARGSUSED */ static int bcmcm_match(device_t parent, cfdata_t match, void *aux) { - const char * const compatible[] = { - "brcm,bcm2835-cprman", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/broadcom/bcm2835_com.c b/sys/arch/arm/broadcom/bcm2835_com.c index 9a5cb346e7cc..209d8321e871 100644 --- a/sys/arch/arm/broadcom/bcm2835_com.c +++ b/sys/arch/arm/broadcom/bcm2835_com.c @@ -1,4 +1,4 @@ -/* $NetBSD: bcm2835_com.c,v 1.6 2020/09/28 11:54:23 jmcneill Exp $ */ +/* $NetBSD: bcm2835_com.c,v 1.7 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bcm2835_com.c,v 1.6 2020/09/28 11:54:23 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bcm2835_com.c,v 1.7 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -50,9 +50,9 @@ static void bcm_com_attach(device_t, device_t, void *); CFATTACH_DECL_NEW(bcmcom, sizeof(struct com_softc), bcm_com_match, bcm_com_attach, NULL, NULL); -static const char * const compatible[] = { - "brcm,bcm2835-aux-uart", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "brcm,bcm2835-aux-uart" }, + DEVICE_COMPAT_EOL }; static int @@ -60,7 +60,7 @@ bcm_com_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -130,7 +130,7 @@ static int bcmaux_com_console_match(int phandle) { - return of_match_compatible(phandle, compatible); + return of_compatible_match(phandle, compat_data); } static void diff --git a/sys/arch/arm/broadcom/bcm2835_cprman.c b/sys/arch/arm/broadcom/bcm2835_cprman.c index 7f62bf4cfda9..26d7abc97deb 100644 --- a/sys/arch/arm/broadcom/bcm2835_cprman.c +++ b/sys/arch/arm/broadcom/bcm2835_cprman.c @@ -1,4 +1,4 @@ -/* $NetBSD: bcm2835_cprman.c,v 1.4 2019/12/30 15:36:37 skrll Exp $ */ +/* $NetBSD: bcm2835_cprman.c,v 1.5 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bcm2835_cprman.c,v 1.4 2019/12/30 15:36:37 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bcm2835_cprman.c,v 1.5 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -155,16 +155,18 @@ cprman_add_clock(struct cprman_softc *sc, u_int id, const char *name) sc->sc_clk[id].id = id; } +static const struct device_compatible_entry compat_data[] = { + { .compat = "brcm,bcm2835-cprman" }, + { .compat = "brcm,bcm2711-cprman" }, + DEVICE_COMPAT_EOL +}; + static int cprman_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "brcm,bcm2835-cprman", - "brcm,bcm2711-cprman", - NULL }; const struct fdt_attach_args *faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/broadcom/bcm2835_dmac.c b/sys/arch/arm/broadcom/bcm2835_dmac.c index 336011b5a58c..578ebdaf9699 100644 --- a/sys/arch/arm/broadcom/bcm2835_dmac.c +++ b/sys/arch/arm/broadcom/bcm2835_dmac.c @@ -1,4 +1,4 @@ -/* $NetBSD: bcm2835_dmac.c,v 1.17 2020/09/30 23:58:13 jmcneill Exp $ */ +/* $NetBSD: bcm2835_dmac.c,v 1.18 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2014 Jared D. McNeill @@ -29,7 +29,7 @@ #include "opt_ddb.h" #include -__KERNEL_RCSID(0, "$NetBSD: bcm2835_dmac.c,v 1.17 2020/09/30 23:58:13 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bcm2835_dmac.c,v 1.18 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -96,16 +96,17 @@ void bcm_dmac_dump_regs(void); CFATTACH_DECL_NEW(bcmdmac_fdt, sizeof(struct bcm_dmac_softc), bcm_dmac_match, bcm_dmac_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "brcm,bcm2835-dma" }, + DEVICE_COMPAT_EOL +}; + static int bcm_dmac_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "brcm,bcm2835-dma", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/broadcom/bcm2835_dwctwo.c b/sys/arch/arm/broadcom/bcm2835_dwctwo.c index 6f2ad60f6610..0b4fc1a65687 100644 --- a/sys/arch/arm/broadcom/bcm2835_dwctwo.c +++ b/sys/arch/arm/broadcom/bcm2835_dwctwo.c @@ -1,4 +1,4 @@ -/* $NetBSD: bcm2835_dwctwo.c,v 1.8 2017/12/10 21:38:26 skrll Exp $ */ +/* $NetBSD: bcm2835_dwctwo.c,v 1.9 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bcm2835_dwctwo.c,v 1.8 2017/12/10 21:38:26 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bcm2835_dwctwo.c,v 1.9 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -97,18 +97,19 @@ static void bcmdwc2_deferred(device_t); CFATTACH_DECL_NEW(bcmdwctwo, sizeof(struct bcmdwc2_softc), bcmdwc2_match, bcmdwc2_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "brcm,bcm2708-usb" }, + { .compat = "brcm,bcm2835-usb" }, + DEVICE_COMPAT_EOL +}; + /* ARGSUSED */ static int bcmdwc2_match(device_t parent, struct cfdata *match, void *aux) { - const char * const compatible[] = { - "brcm,bcm2708-usb", - "brcm,bcm2835-usb", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } /* ARGSUSED */ diff --git a/sys/arch/arm/broadcom/bcm2835_emmc.c b/sys/arch/arm/broadcom/bcm2835_emmc.c index a65f32474732..a3797ab92426 100644 --- a/sys/arch/arm/broadcom/bcm2835_emmc.c +++ b/sys/arch/arm/broadcom/bcm2835_emmc.c @@ -1,4 +1,4 @@ -/* $NetBSD: bcm2835_emmc.c,v 1.41 2021/01/25 14:20:38 thorpej Exp $ */ +/* $NetBSD: bcm2835_emmc.c,v 1.42 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bcm2835_emmc.c,v 1.41 2021/01/25 14:20:38 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bcm2835_emmc.c,v 1.42 2021/01/27 03:10:19 thorpej Exp $"); #include "bcmdmac.h" @@ -99,7 +99,7 @@ enum bcmemmc_type { static const struct device_compatible_entry compat_data[] = { { .compat = "brcm,bcm2835-sdhci", .value = BCM2835_SDHCI }, { .compat = "brcm,bcm2711-emmc2", .value = BCM2711_EMMC2 }, - { } + DEVICE_COMPAT_EOL }; /* ARGSUSED */ @@ -108,7 +108,7 @@ bcmemmc_match(device_t parent, struct cfdata *match, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } /* ARGSUSED */ @@ -184,7 +184,7 @@ bcmemmc_attach(device_t parent, device_t self, void *aux) #if NBCMDMAC > 0 enum bcmemmc_type type = - of_search_compatible(phandle, compat_data)->value; + of_compatible_lookup(phandle, compat_data)->value; if (type != BCM2835_SDHCI) goto done; diff --git a/sys/arch/arm/broadcom/bcm2835_genfb.c b/sys/arch/arm/broadcom/bcm2835_genfb.c index 641ea7e28bda..b38b70ecbab0 100644 --- a/sys/arch/arm/broadcom/bcm2835_genfb.c +++ b/sys/arch/arm/broadcom/bcm2835_genfb.c @@ -1,4 +1,4 @@ -/* $NetBSD: bcm2835_genfb.c,v 1.11 2020/12/01 04:17:10 rin Exp $ */ +/* $NetBSD: bcm2835_genfb.c,v 1.12 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2013 Jared D. McNeill @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bcm2835_genfb.c,v 1.11 2020/12/01 04:17:10 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bcm2835_genfb.c,v 1.12 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -71,13 +71,17 @@ int (*bcmgenfb_ioctl_handler)(void *, void *, u_long, void *, int, struct lwp *) CFATTACH_DECL_NEW(bcmgenfb, sizeof(struct bcmgenfb_softc), bcmgenfb_match, bcmgenfb_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "brcm,bcm2835-fb" }, + DEVICE_COMPAT_EOL +}; + static int bcmgenfb_match(device_t parent, cfdata_t match, void *aux) { - const char * const compatible[] = { "brcm,bcm2835-fb", NULL }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/broadcom/bcm2835_gpio.c b/sys/arch/arm/broadcom/bcm2835_gpio.c index 5b636a97ea7b..09fbbe975b00 100644 --- a/sys/arch/arm/broadcom/bcm2835_gpio.c +++ b/sys/arch/arm/broadcom/bcm2835_gpio.c @@ -1,4 +1,4 @@ -/* $NetBSD: bcm2835_gpio.c,v 1.17 2021/01/15 00:38:22 jmcneill Exp $ */ +/* $NetBSD: bcm2835_gpio.c,v 1.18 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2013, 2014, 2017 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bcm2835_gpio.c,v 1.17 2021/01/15 00:38:22 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bcm2835_gpio.c,v 1.18 2021/01/27 03:10:19 thorpej Exp $"); /* * Driver for BCM2835 GPIO @@ -238,18 +238,19 @@ bcm283x_pinctrl_set_config(device_t dev, const void *data, size_t len) return 0; } +static const struct device_compatible_entry compat_data[] = { + { .compat = "brcm,bcm2835-gpio" }, + { .compat = "brcm,bcm2838-gpio" }, + { .compat = "brcm,bcm2711-gpio" }, + DEVICE_COMPAT_EOL +}; + static int bcmgpio_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "brcm,bcm2835-gpio", - "brcm,bcm2838-gpio", - "brcm,bcm2711-gpio", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/broadcom/bcm2835_intr.c b/sys/arch/arm/broadcom/bcm2835_intr.c index 52464b748c63..174cee8d6b9b 100644 --- a/sys/arch/arm/broadcom/bcm2835_intr.c +++ b/sys/arch/arm/broadcom/bcm2835_intr.c @@ -1,4 +1,4 @@ -/* $NetBSD: bcm2835_intr.c,v 1.36 2021/01/25 14:20:38 thorpej Exp $ */ +/* $NetBSD: bcm2835_intr.c,v 1.37 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2012, 2015, 2019 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bcm2835_intr.c,v 1.36 2021/01/25 14:20:38 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bcm2835_intr.c,v 1.37 2021/01/27 03:10:19 thorpej Exp $"); #define _INTR_PRIVATE @@ -260,7 +260,7 @@ static const struct device_compatible_entry compat_data[] = { { .compat = "brcm,bcm2835-armctrl-ic", .value = 0 }, { .compat = "brcm,bcm2836-armctrl-ic", .value = 0 }, { .compat = "brcm,bcm2836-l1-intc", .value = 1 }, - { } + DEVICE_COMPAT_EOL }; static int @@ -268,7 +268,7 @@ bcm2835_icu_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -300,7 +300,7 @@ bcm2835_icu_attach(device_t parent, device_t self, void *aux) sc->sc_ioh = ioh; sc->sc_phandle = phandle; - dce = of_search_compatible(faa->faa_phandle, compat_data); + dce = of_compatible_lookup(faa->faa_phandle, compat_data); KASSERT(dce != NULL); if (dce->value != 0) { diff --git a/sys/arch/arm/broadcom/bcm2835_mbox_fdt.c b/sys/arch/arm/broadcom/bcm2835_mbox_fdt.c index 94b25ccaac6d..b68cdb452971 100644 --- a/sys/arch/arm/broadcom/bcm2835_mbox_fdt.c +++ b/sys/arch/arm/broadcom/bcm2835_mbox_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: bcm2835_mbox_fdt.c,v 1.1 2019/12/30 18:43:38 jmcneill Exp $ */ +/* $NetBSD: bcm2835_mbox_fdt.c,v 1.2 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bcm2835_mbox_fdt.c,v 1.1 2019/12/30 18:43:38 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bcm2835_mbox_fdt.c,v 1.2 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -53,14 +53,18 @@ static void bcmmbox_fdt_attach(device_t, device_t, void *); CFATTACH_DECL_NEW(bcmmbox_fdt, sizeof(struct bcm2835mbox_softc), bcmmbox_fdt_match, bcmmbox_fdt_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "brcm,bcm2835-mbox" }, + DEVICE_COMPAT_EOL +}; + /* ARGSUSED */ static int bcmmbox_fdt_match(device_t parent, cfdata_t match, void *aux) { - const char * const compatible[] = { "brcm,bcm2835-mbox", NULL }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/broadcom/bcm2835_pmwdog.c b/sys/arch/arm/broadcom/bcm2835_pmwdog.c index 09dd2a1741d9..826d961792e6 100644 --- a/sys/arch/arm/broadcom/bcm2835_pmwdog.c +++ b/sys/arch/arm/broadcom/bcm2835_pmwdog.c @@ -1,4 +1,4 @@ -/* $NetBSD: bcm2835_pmwdog.c,v 1.1 2017/12/10 21:38:26 skrll Exp $ */ +/* $NetBSD: bcm2835_pmwdog.c,v 1.2 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2012, 2016 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bcm2835_pmwdog.c,v 1.1 2017/12/10 21:38:26 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bcm2835_pmwdog.c,v 1.2 2021/01/27 03:10:19 thorpej Exp $"); #include @@ -85,14 +85,18 @@ static int bcmpmwdog_tickle(struct sysmon_wdog *); CFATTACH_DECL_NEW(bcmpmwdog_fdt, sizeof(struct bcm2835pmwdog_softc), bcmpmwdog_match, bcmpmwdog_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "brcm,bcm2835-pm-wdt" }, + DEVICE_COMPAT_EOL +}; + /* ARGSUSED */ static int bcmpmwdog_match(device_t parent, cfdata_t match, void *aux) { - const char * const compatible[] = { "brcm,bcm2835-pm-wdt", NULL }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/broadcom/bcm2835_pwm.c b/sys/arch/arm/broadcom/bcm2835_pwm.c index 507cf8052ef4..8d39d73860e2 100644 --- a/sys/arch/arm/broadcom/bcm2835_pwm.c +++ b/sys/arch/arm/broadcom/bcm2835_pwm.c @@ -1,4 +1,4 @@ -/* $NetBSD: bcm2835_pwm.c,v 1.3 2017/12/10 21:38:26 skrll Exp $ */ +/* $NetBSD: bcm2835_pwm.c,v 1.4 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2015 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bcm2835_pwm.c,v 1.3 2017/12/10 21:38:26 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bcm2835_pwm.c,v 1.4 2021/01/27 03:10:19 thorpej Exp $"); #include "bcmdmac.h" @@ -88,14 +88,18 @@ static int bcmpwm_wait(struct bcm2835pwm_softc *); CFATTACH_DECL_NEW(bcmpwm, sizeof(struct bcm2835pwm_softc), bcmpwm_match, bcmpwm_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "brcm,bcm2835-pwm" }, + DEVICE_COMPAT_EOL +}; + /* ARGSUSED */ static int bcmpwm_match(device_t parent, cfdata_t match, void *aux) { - const char * const compatible[] = { "brcm,bcm2835-pwm", NULL }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/broadcom/bcm2835_rng.c b/sys/arch/arm/broadcom/bcm2835_rng.c index 97bc2ec09b8c..81338c2e744d 100644 --- a/sys/arch/arm/broadcom/bcm2835_rng.c +++ b/sys/arch/arm/broadcom/bcm2835_rng.c @@ -1,4 +1,4 @@ -/* $NetBSD: bcm2835_rng.c,v 1.14 2020/04/30 03:40:52 riastradh Exp $ */ +/* $NetBSD: bcm2835_rng.c,v 1.15 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bcm2835_rng.c,v 1.14 2020/04/30 03:40:52 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bcm2835_rng.c,v 1.15 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -69,14 +69,18 @@ static void bcmrng_get(size_t, void *); CFATTACH_DECL_NEW(bcmrng_fdt, sizeof(struct bcm2835rng_softc), bcmrng_match, bcmrng_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "brcm,bcm2835-rng" }, + DEVICE_COMPAT_EOL +}; + /* ARGSUSED */ static int bcmrng_match(device_t parent, cfdata_t match, void *aux) { - const char * const compatible[] = { "brcm,bcm2835-rng", NULL }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/broadcom/bcm2835_sdhost.c b/sys/arch/arm/broadcom/bcm2835_sdhost.c index 85334fbba256..4f0188278ced 100644 --- a/sys/arch/arm/broadcom/bcm2835_sdhost.c +++ b/sys/arch/arm/broadcom/bcm2835_sdhost.c @@ -1,4 +1,4 @@ -/* $NetBSD: bcm2835_sdhost.c,v 1.6 2020/12/01 04:15:04 rin Exp $ */ +/* $NetBSD: bcm2835_sdhost.c,v 1.7 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bcm2835_sdhost.c,v 1.6 2020/12/01 04:15:04 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bcm2835_sdhost.c,v 1.7 2021/01/27 03:10:19 thorpej Exp $"); #include "bcmdmac.h" @@ -174,16 +174,17 @@ CFATTACH_DECL_NEW(bcmsdhost, sizeof(struct sdhost_softc), #define SDHOST_READ(sc, reg) \ bus_space_read_4((sc)->sc_bst, (sc)->sc_bsh, (reg)) +static const struct device_compatible_entry compat_data[] = { + { .compat = "brcm,bcm2835-sdhost" }, + DEVICE_COMPAT_EOL +}; + static int sdhost_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "brcm,bcm2835-sdhost", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/broadcom/bcm2835_spi.c b/sys/arch/arm/broadcom/bcm2835_spi.c index 8939de6dd575..13dcb0031c9b 100644 --- a/sys/arch/arm/broadcom/bcm2835_spi.c +++ b/sys/arch/arm/broadcom/bcm2835_spi.c @@ -1,4 +1,4 @@ -/* $NetBSD: bcm2835_spi.c,v 1.7 2020/08/04 13:20:45 kardel Exp $ */ +/* $NetBSD: bcm2835_spi.c,v 1.8 2021/01/27 03:10:19 thorpej Exp $ */ /* * Copyright (c) 2012 Jonathan A. Kollasch @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bcm2835_spi.c,v 1.7 2020/08/04 13:20:45 kardel Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bcm2835_spi.c,v 1.8 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -77,16 +77,17 @@ static void bcmspi_recv(struct bcmspi_softc * const); CFATTACH_DECL_NEW(bcmspi, sizeof(struct bcmspi_softc), bcmspi_match, bcmspi_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "brcm,bcm2835-spi" }, + DEVICE_COMPAT_EOL +}; + static int bcmspi_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "brcm,bcm2835-spi", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/broadcom/bcm2835_tmr.c b/sys/arch/arm/broadcom/bcm2835_tmr.c index df53942c1e75..111fd9999dd3 100644 --- a/sys/arch/arm/broadcom/bcm2835_tmr.c +++ b/sys/arch/arm/broadcom/bcm2835_tmr.c @@ -1,4 +1,4 @@ -/* $NetBSD: bcm2835_tmr.c,v 1.10 2019/06/07 13:43:44 skrll Exp $ */ +/* $NetBSD: bcm2835_tmr.c,v 1.11 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bcm2835_tmr.c,v 1.10 2019/06/07 13:43:44 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bcm2835_tmr.c,v 1.11 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -100,16 +100,18 @@ static struct timecounter bcm2835tmr_timecounter = { CFATTACH_DECL_NEW(bcmtmr_fdt, sizeof(struct bcm2835tmr_softc), bcmtmr_match, bcmtmr_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "brcm,bcm2835-system-timer" }, + DEVICE_COMPAT_EOL +}; + /* ARGSUSED */ static int bcmtmr_match(device_t parent, cfdata_t match, void *aux) { - const char * const compatible[] = { - "brcm,bcm2835-system-timer", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/broadcom/bcm2838_rng.c b/sys/arch/arm/broadcom/bcm2838_rng.c index 13193e483420..08b09972e727 100644 --- a/sys/arch/arm/broadcom/bcm2838_rng.c +++ b/sys/arch/arm/broadcom/bcm2838_rng.c @@ -1,4 +1,4 @@ -/* $NetBSD: bcm2838_rng.c,v 1.1 2019/09/01 17:27:22 mlelstv Exp $ */ +/* $NetBSD: bcm2838_rng.c,v 1.2 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2019 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bcm2838_rng.c,v 1.1 2019/09/01 17:27:22 mlelstv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bcm2838_rng.c,v 1.2 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -49,14 +49,18 @@ static void bcm2838rng_attach(device_t, device_t, void *); CFATTACH_DECL_NEW(bcm2838rng_fdt, sizeof(struct bcm2838rng_softc), bcm2838rng_match, bcm2838rng_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "brcm,bcm2838-rng200" }, + DEVICE_COMPAT_EOL +}; + /* ARGSUSED */ static int bcm2838rng_match(device_t parent, cfdata_t match, void *aux) { - const char * const compatible[] = { "brcm,bcm2838-rng200", NULL }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/broadcom/bcm283x_platform.c b/sys/arch/arm/broadcom/bcm283x_platform.c index 9d2766ca6335..8ebdfaaec553 100644 --- a/sys/arch/arm/broadcom/bcm283x_platform.c +++ b/sys/arch/arm/broadcom/bcm283x_platform.c @@ -1,4 +1,4 @@ -/* $NetBSD: bcm283x_platform.c,v 1.45 2020/12/01 04:16:18 rin Exp $ */ +/* $NetBSD: bcm283x_platform.c,v 1.46 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bcm283x_platform.c,v 1.45 2020/12/01 04:16:18 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bcm283x_platform.c,v 1.46 2021/01/27 03:10:19 thorpej Exp $"); #include "opt_arm_debug.h" #include "opt_bcm283x.h" @@ -1485,12 +1485,12 @@ bcm283x_platform_uart_freq(void) */ const int phandle = fdtbus_get_stdout_phandle(); - static const char * const aux_compatible[] = { - "brcm,bcm2835-aux-uart", - NULL + static const struct device_compatible_entry aux_compat_data[] = { + { .compat = "brcm,bcm2835-aux-uart" }, + DEVICE_COMPAT_EOL }; - if (of_match_compatible(phandle, aux_compatible)) + if (of_compatible_match(phandle, aux_compat_data)) return core_clk * 2; return uart_clk; diff --git a/sys/arch/arm/fdt/a9ptmr_fdt.c b/sys/arch/arm/fdt/a9ptmr_fdt.c index 069bba4d0879..1f7ecbd3ffca 100644 --- a/sys/arch/arm/fdt/a9ptmr_fdt.c +++ b/sys/arch/arm/fdt/a9ptmr_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: a9ptmr_fdt.c,v 1.2 2021/01/15 18:42:40 ryo Exp $ */ +/* $NetBSD: a9ptmr_fdt.c,v 1.3 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2019 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: a9ptmr_fdt.c,v 1.2 2021/01/15 18:42:40 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: a9ptmr_fdt.c,v 1.3 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -57,17 +57,18 @@ struct a9ptmr_fdt_softc { CFATTACH_DECL_NEW(a9ptmr_fdt, sizeof(struct a9ptmr_fdt_softc), a9ptmr_fdt_match, a9ptmr_fdt_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "arm,cortex-a9-twd-timer" }, + { .compat = "arm,cortex-a5-twd-timer" }, + DEVICE_COMPAT_EOL +}; + static int a9ptmr_fdt_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "arm,cortex-a9-twd-timer", - "arm,cortex-a5-twd-timer", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_compatible(faa->faa_phandle, compatible) >= 0; + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/fdt/a9tmr_fdt.c b/sys/arch/arm/fdt/a9tmr_fdt.c index f47dc87fd2a1..eef4f66a1a72 100644 --- a/sys/arch/arm/fdt/a9tmr_fdt.c +++ b/sys/arch/arm/fdt/a9tmr_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: a9tmr_fdt.c,v 1.4 2021/01/15 18:42:40 ryo Exp $ */ +/* $NetBSD: a9tmr_fdt.c,v 1.5 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: a9tmr_fdt.c,v 1.4 2021/01/15 18:42:40 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: a9tmr_fdt.c,v 1.5 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -58,17 +58,18 @@ struct a9tmr_fdt_softc { CFATTACH_DECL_NEW(a9tmr_fdt, sizeof(struct a9tmr_fdt_softc), a9tmr_fdt_match, a9tmr_fdt_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "arm,cortex-a5-global-timer" }, + { .compat = "arm,cortex-a9-global-timer" }, + DEVICE_COMPAT_EOL +}; + static int a9tmr_fdt_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "arm,cortex-a5-global-timer", - "arm,cortex-a9-global-timer", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_compatible(faa->faa_phandle, compatible) >= 0; + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/fdt/a9wdt_fdt.c b/sys/arch/arm/fdt/a9wdt_fdt.c index b9299f191189..57b5fc44a300 100644 --- a/sys/arch/arm/fdt/a9wdt_fdt.c +++ b/sys/arch/arm/fdt/a9wdt_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: a9wdt_fdt.c,v 1.1 2019/08/10 17:03:59 skrll Exp $ */ +/* $NetBSD: a9wdt_fdt.c,v 1.2 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2019 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: a9wdt_fdt.c,v 1.1 2019/08/10 17:03:59 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: a9wdt_fdt.c,v 1.2 2021/01/27 03:10:19 thorpej Exp $"); #if 0 #include @@ -67,17 +67,18 @@ struct a9wdt_fdt_softc { CFATTACH_DECL_NEW(a9wdt_fdt, sizeof(struct a9wdt_fdt_softc), a9wdt_fdt_match, a9wdt_fdt_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "arm,cortex-a9-twd-wdt" }, + { .compat = "arm,cortex-a5-twd-wdt" }, + DEVICE_COMPAT_EOL +}; + static int a9wdt_fdt_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "arm,cortex-a9-twd-wdt", - "arm,cortex-a5-twd-wdt", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_compatible(faa->faa_phandle, compatible) >= 0; + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/fdt/aaci_fdt.c b/sys/arch/arm/fdt/aaci_fdt.c index bead1ae877aa..8bc1f0aa8ee9 100644 --- a/sys/arch/arm/fdt/aaci_fdt.c +++ b/sys/arch/arm/fdt/aaci_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: aaci_fdt.c,v 1.2 2021/01/15 18:42:40 ryo Exp $ */ +/* $NetBSD: aaci_fdt.c,v 1.3 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: aaci_fdt.c,v 1.2 2021/01/15 18:42:40 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: aaci_fdt.c,v 1.3 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -42,9 +42,9 @@ __KERNEL_RCSID(0, "$NetBSD: aaci_fdt.c,v 1.2 2021/01/15 18:42:40 ryo Exp $"); static int aaci_fdt_match(device_t, cfdata_t, void *); static void aaci_fdt_attach(device_t, device_t, void *); -static const char * const compatible[] = { - "arm,pl041", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "arm,pl041" }, + DEVICE_COMPAT_EOL }; CFATTACH_DECL_NEW(aaci_fdt, sizeof(struct aaci_softc), @@ -55,7 +55,7 @@ aaci_fdt_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_compatible(faa->faa_phandle, compatible) >= 0; + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/fdt/acpi_fdt.c b/sys/arch/arm/fdt/acpi_fdt.c index 73e55e1c8aba..203638e28d62 100644 --- a/sys/arch/arm/fdt/acpi_fdt.c +++ b/sys/arch/arm/fdt/acpi_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: acpi_fdt.c,v 1.17 2021/01/17 19:53:05 jmcneill Exp $ */ +/* $NetBSD: acpi_fdt.c,v 1.18 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2015-2017 Jared McNeill @@ -30,7 +30,7 @@ #include "opt_efi.h" #include -__KERNEL_RCSID(0, "$NetBSD: acpi_fdt.c,v 1.17 2021/01/17 19:53:05 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: acpi_fdt.c,v 1.18 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -67,9 +67,9 @@ extern struct arm32_bus_dma_tag acpi_coherent_dma_tag; static uint64_t smbios_table = 0; -static const char * const compatible[] = { - "netbsd,acpi", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "netbsd,acpi" }, + DEVICE_COMPAT_EOL }; static const struct fdtbus_power_controller_func acpi_fdt_power_funcs = { @@ -83,7 +83,7 @@ acpi_fdt_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_compatible(faa->faa_phandle, compatible) >= 0; + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/fdt/arm_fdt.c b/sys/arch/arm/fdt/arm_fdt.c index 1df15e27288b..7a98843b8100 100644 --- a/sys/arch/arm/fdt/arm_fdt.c +++ b/sys/arch/arm/fdt/arm_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: arm_fdt.c,v 1.13 2020/12/17 08:47:18 skrll Exp $ */ +/* $NetBSD: arm_fdt.c,v 1.14 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared D. McNeill @@ -31,7 +31,7 @@ #include "opt_modular.h" #include -__KERNEL_RCSID(0, "$NetBSD: arm_fdt.c,v 1.13 2020/12/17 08:47:18 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: arm_fdt.c,v 1.14 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -118,8 +118,12 @@ arm_fdt_platform(void) int match, best_match = 0; __link_set_foreach(info, arm_platforms) { - const char * const compat[] = { (*info)->api_compat, NULL }; - match = of_match_compatible(phandle, compat); + const struct device_compatible_entry compat_data[] = { + { .compat = (*info)->api_compat }, + DEVICE_COMPAT_EOL + }; + + match = of_compatible_match(phandle, compat_data); if (match > best_match) { best_match = match; best_info = *info; diff --git a/sys/arch/arm/fdt/arm_simplefb.c b/sys/arch/arm/fdt/arm_simplefb.c index efcabd8fdb2d..0fa5b7ebad14 100644 --- a/sys/arch/arm/fdt/arm_simplefb.c +++ b/sys/arch/arm/fdt/arm_simplefb.c @@ -1,4 +1,4 @@ -/* $NetBSD: arm_simplefb.c,v 1.7 2021/01/17 19:51:43 jmcneill Exp $ */ +/* $NetBSD: arm_simplefb.c,v 1.8 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2019 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ #include "opt_vcons.h" #include -__KERNEL_RCSID(0, "$NetBSD: arm_simplefb.c,v 1.7 2021/01/17 19:51:43 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: arm_simplefb.c,v 1.8 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -90,12 +90,14 @@ static bus_addr_t arm_simplefb_addr; static bus_size_t arm_simplefb_size; static bus_space_handle_t arm_simplefb_bsh; +static const struct device_compatible_entry compat_data[] = { + { .compat = "simple-framebuffer" }, + DEVICE_COMPAT_EOL +}; + static int arm_simplefb_find_node(void) { - static const char * simplefb_compatible[] = { - "simple-framebuffer", NULL - }; int chosen_phandle, child; chosen_phandle = OF_finddevice("/chosen"); @@ -105,7 +107,7 @@ arm_simplefb_find_node(void) for (child = OF_child(chosen_phandle); child; child = OF_peer(child)) { if (!fdtbus_status_okay(child)) continue; - if (!of_match_compatible(child, simplefb_compatible)) + if (!of_compatible_match(child, compat_data)) continue; return child; diff --git a/sys/arch/arm/fdt/gic_fdt.c b/sys/arch/arm/fdt/gic_fdt.c index 32241e197ffd..6fd1b1da6034 100644 --- a/sys/arch/arm/fdt/gic_fdt.c +++ b/sys/arch/arm/fdt/gic_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: gic_fdt.c,v 1.20 2021/01/15 00:38:22 jmcneill Exp $ */ +/* $NetBSD: gic_fdt.c,v 1.21 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2015-2017 Jared McNeill @@ -29,7 +29,7 @@ #include "pci.h" #include -__KERNEL_RCSID(0, "$NetBSD: gic_fdt.c,v 1.20 2021/01/15 00:38:22 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gic_fdt.c,v 1.21 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -109,19 +109,25 @@ struct gic_fdt_softc { CFATTACH_DECL_NEW(gic_fdt, sizeof(struct gic_fdt_softc), gic_fdt_match, gic_fdt_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "arm,gic-400" }, + { .compat = "arm,cortex-a15-gic" }, + { .compat = "arm,cortex-a9-gic" }, + { .compat = "arm,cortex-a7-gic" }, + DEVICE_COMPAT_EOL +}; + +static const struct device_compatible_entry v2m_compat_data[] = { + { .compat = "arm,gic-v2m-frame" }, + DEVICE_COMPAT_EOL +}; + static int gic_fdt_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "arm,gic-400", - "arm,cortex-a15-gic", - "arm,cortex-a9-gic", - "arm,cortex-a7-gic", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -183,8 +189,7 @@ gic_fdt_attach(device_t parent, device_t self, void *aux) for (int child = OF_child(phandle); child; child = OF_peer(child)) { if (!fdtbus_status_okay(child)) continue; - const char * const v2m_compat[] = { "arm,gic-v2m-frame", NULL }; - if (of_match_compatible(child, v2m_compat)) + if (of_compatible_match(child, v2m_compat_data)) gic_fdt_attach_v2m(sc, faa->faa_bst, child); } #endif diff --git a/sys/arch/arm/fdt/gicv3_fdt.c b/sys/arch/arm/fdt/gicv3_fdt.c index e7822898a3b9..ce6910b9fcb9 100644 --- a/sys/arch/arm/fdt/gicv3_fdt.c +++ b/sys/arch/arm/fdt/gicv3_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: gicv3_fdt.c,v 1.14 2021/01/27 01:54:06 thorpej Exp $ */ +/* $NetBSD: gicv3_fdt.c,v 1.15 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2015-2018 Jared McNeill @@ -31,7 +31,7 @@ #define _INTR_PRIVATE #include -__KERNEL_RCSID(0, "$NetBSD: gicv3_fdt.c,v 1.14 2021/01/27 01:54:06 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gicv3_fdt.c,v 1.15 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -126,7 +126,7 @@ gicv3_fdt_match(device_t parent, cfdata_t cf, void *aux) struct fdt_attach_args * const faa = aux; const int phandle = faa->faa_phandle; - return of_match_compat_data(phandle, compat_data); + return of_compatible_match(phandle, compat_data); } static void @@ -162,7 +162,7 @@ gicv3_fdt_attach(device_t parent, device_t self, void *aux) /* Apply quirks */ const struct device_compatible_entry *dce = - of_search_compatible(OF_finddevice("/"), gicv3_fdt_quirks); + of_compatible_lookup(OF_finddevice("/"), gicv3_fdt_quirks); if (dce != NULL) { sc->sc_gic.sc_quirks |= dce->value; } @@ -188,7 +188,7 @@ gicv3_fdt_attach(device_t parent, device_t self, void *aux) child = OF_peer(child)) { if (!fdtbus_status_okay(child)) continue; - if (of_match_compat_data(child, its_compat)) + if (of_compatible_match(child, its_compat)) gicv3_fdt_attach_its(sc, faa->faa_bst, child); } } diff --git a/sys/arch/arm/fdt/gtmr_fdt.c b/sys/arch/arm/fdt/gtmr_fdt.c index 1a1fdb6e9820..a924c6976e8f 100644 --- a/sys/arch/arm/fdt/gtmr_fdt.c +++ b/sys/arch/arm/fdt/gtmr_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: gtmr_fdt.c,v 1.8 2021/01/15 18:42:40 ryo Exp $ */ +/* $NetBSD: gtmr_fdt.c,v 1.9 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: gtmr_fdt.c,v 1.8 2021/01/15 18:42:40 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gtmr_fdt.c,v 1.9 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -54,17 +54,18 @@ CFATTACH_DECL_NEW(gtmr_fdt, 0, gtmr_fdt_match, gtmr_fdt_attach, NULL, NULL); /* The virtual timer list entry */ #define GTMR_VTIMER 2 +static const struct device_compatible_entry compat_data[] = { + { .compat = "arm,armv7-timer" }, + { .compat = "arm,armv8-timer" }, + DEVICE_COMPAT_EOL +}; + static int gtmr_fdt_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "arm,armv7-timer", - "arm,armv8-timer", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_compatible(faa->faa_phandle, compatible) >= 0; + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/fdt/l2cc_fdt.c b/sys/arch/arm/fdt/l2cc_fdt.c index 1594735c9d65..51278c041d94 100644 --- a/sys/arch/arm/fdt/l2cc_fdt.c +++ b/sys/arch/arm/fdt/l2cc_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: l2cc_fdt.c,v 1.2 2019/01/19 20:56:03 jmcneill Exp $ */ +/* $NetBSD: l2cc_fdt.c,v 1.3 2021/01/27 03:10:19 thorpej Exp $ */ /* * Copyright (c) 2018 Genetec Corporation. All rights reserved. * Written by Hashimoto Kenichi for Genetec Corporation. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: l2cc_fdt.c,v 1.2 2019/01/19 20:56:03 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: l2cc_fdt.c,v 1.3 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -46,16 +46,17 @@ static void l2cc_fdt_attach(device_t, device_t, void *); CFATTACH_DECL_NEW(l2cc_fdt, 0, l2cc_fdt_match, l2cc_fdt_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "arm,pl310-cache" }, + DEVICE_COMPAT_EOL +}; + static int l2cc_fdt_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "arm,pl310-cache", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_compatible(faa->faa_phandle, compatible) >= 0; + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/fdt/pcihost_fdt.c b/sys/arch/arm/fdt/pcihost_fdt.c index d61e8e7699de..6a9995e1e5fe 100644 --- a/sys/arch/arm/fdt/pcihost_fdt.c +++ b/sys/arch/arm/fdt/pcihost_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: pcihost_fdt.c,v 1.22 2021/01/27 01:54:06 thorpej Exp $ */ +/* $NetBSD: pcihost_fdt.c,v 1.23 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2018 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pcihost_fdt.c,v 1.22 2021/01/27 01:54:06 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pcihost_fdt.c,v 1.23 2021/01/27 03:10:19 thorpej Exp $"); #include @@ -106,7 +106,7 @@ pcihost_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -133,7 +133,7 @@ pcihost_attach(device_t parent, device_t self, void *aux) aprint_error(": couldn't map registers: %d\n", error); return; } - sc->sc_type = of_search_compatible(sc->sc_phandle, compat_data)->value; + sc->sc_type = of_compatible_lookup(sc->sc_phandle, compat_data)->value; #ifdef __HAVE_PCI_MSI_MSIX if (sc->sc_type == PCIHOST_ECAM) { diff --git a/sys/arch/arm/fdt/plcom_fdt.c b/sys/arch/arm/fdt/plcom_fdt.c index 81d7d436b17a..cf77a25ee816 100644 --- a/sys/arch/arm/fdt/plcom_fdt.c +++ b/sys/arch/arm/fdt/plcom_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: plcom_fdt.c,v 1.4 2021/01/15 18:42:40 ryo Exp $ */ +/* $NetBSD: plcom_fdt.c,v 1.5 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: plcom_fdt.c,v 1.4 2021/01/15 18:42:40 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: plcom_fdt.c,v 1.5 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -43,7 +43,10 @@ __KERNEL_RCSID(0, "$NetBSD: plcom_fdt.c,v 1.4 2021/01/15 18:42:40 ryo Exp $"); static int plcom_fdt_match(device_t, cfdata_t, void *); static void plcom_fdt_attach(device_t, device_t, void *); -static const char * const compatible[] = { "arm,pl011", NULL }; +static const struct device_compatible_entry compat_data[] = { + { .compat = "arm,pl011" }, + DEVICE_COMPAT_EOL +}; CFATTACH_DECL_NEW(plcom_fdt, sizeof(struct plcom_softc), plcom_fdt_match, plcom_fdt_attach, NULL, NULL); @@ -53,7 +56,7 @@ plcom_fdt_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_compatible(faa->faa_phandle, compatible) >= 0; + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -121,7 +124,7 @@ plcom_fdt_attach(device_t parent, device_t self, void *aux) static int plcom_fdt_console_match(int phandle) { - return of_match_compatible(phandle, compatible); + return of_compatible_match(phandle, compat_data); } static void diff --git a/sys/arch/arm/fdt/plfb_fdt.c b/sys/arch/arm/fdt/plfb_fdt.c index 0b3f56a65517..9d602246ca97 100644 --- a/sys/arch/arm/fdt/plfb_fdt.c +++ b/sys/arch/arm/fdt/plfb_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: plfb_fdt.c,v 1.4 2019/07/23 12:34:05 jmcneill Exp $ */ +/* $NetBSD: plfb_fdt.c,v 1.5 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -33,7 +33,7 @@ #include "opt_wsdisplay_compat.h" #include -__KERNEL_RCSID(0, "$NetBSD: plfb_fdt.c,v 1.4 2019/07/23 12:34:05 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: plfb_fdt.c,v 1.5 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -95,9 +95,9 @@ static bool plfb_shutdown(device_t, int); static void plfb_init(struct plfb_softc *); -static const char * const compatible[] = { - "arm,pl111", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "arm,pl111" }, + DEVICE_COMPAT_EOL }; CFATTACH_DECL_NEW(plfb_fdt, sizeof(struct plfb_softc), @@ -113,7 +113,7 @@ plfb_match(device_t parent, cfdata_t match, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -318,7 +318,7 @@ plfb_init(struct plfb_softc *sc) static int plfb_console_match(int phandle) { - return of_match_compatible(phandle, compatible); + return of_compatible_match(phandle, compat_data); } static void diff --git a/sys/arch/arm/fdt/plkmi_fdt.c b/sys/arch/arm/fdt/plkmi_fdt.c index d6575d073a75..39bcc68f2049 100644 --- a/sys/arch/arm/fdt/plkmi_fdt.c +++ b/sys/arch/arm/fdt/plkmi_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: plkmi_fdt.c,v 1.2 2021/01/15 18:42:41 ryo Exp $ */ +/* $NetBSD: plkmi_fdt.c,v 1.3 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: plkmi_fdt.c,v 1.2 2021/01/15 18:42:41 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: plkmi_fdt.c,v 1.3 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -42,9 +42,9 @@ __KERNEL_RCSID(0, "$NetBSD: plkmi_fdt.c,v 1.2 2021/01/15 18:42:41 ryo Exp $"); static int plkmi_fdt_match(device_t, cfdata_t, void *); static void plkmi_fdt_attach(device_t, device_t, void *); -static const char * const compatible[] = { - "arm,pl050", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "arm,pl050" }, + DEVICE_COMPAT_EOL }; CFATTACH_DECL_NEW(plkmi_fdt, sizeof(struct plkmi_softc), @@ -55,7 +55,7 @@ plkmi_fdt_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_compatible(faa->faa_phandle, compatible) >= 0; + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/fdt/plmmc_fdt.c b/sys/arch/arm/fdt/plmmc_fdt.c index c8ad300457c8..767790806487 100644 --- a/sys/arch/arm/fdt/plmmc_fdt.c +++ b/sys/arch/arm/fdt/plmmc_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: plmmc_fdt.c,v 1.3 2021/01/15 18:42:41 ryo Exp $ */ +/* $NetBSD: plmmc_fdt.c,v 1.4 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: plmmc_fdt.c,v 1.3 2021/01/15 18:42:41 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: plmmc_fdt.c,v 1.4 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -43,10 +43,10 @@ __KERNEL_RCSID(0, "$NetBSD: plmmc_fdt.c,v 1.3 2021/01/15 18:42:41 ryo Exp $"); static int plmmc_fdt_match(device_t, cfdata_t, void *); static void plmmc_fdt_attach(device_t, device_t, void *); -static const char * const compatible[] = { - "arm,pl180", - "arm,pl181", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "arm,pl180" }, + { .compat = "arm,pl181" }, + DEVICE_COMPAT_EOL }; CFATTACH_DECL_NEW(plmmc_fdt, sizeof(struct plmmc_softc), @@ -57,7 +57,7 @@ plmmc_fdt_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_compatible(faa->faa_phandle, compatible) >= 0; + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/fdt/plrtc_fdt.c b/sys/arch/arm/fdt/plrtc_fdt.c index 53ad4536ee11..f6bb996ec9a3 100644 --- a/sys/arch/arm/fdt/plrtc_fdt.c +++ b/sys/arch/arm/fdt/plrtc_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: plrtc_fdt.c,v 1.1 2017/06/08 21:01:06 jmcneill Exp $ */ +/* $NetBSD: plrtc_fdt.c,v 1.2 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: plrtc_fdt.c,v 1.1 2017/06/08 21:01:06 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: plrtc_fdt.c,v 1.2 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -42,9 +42,9 @@ __KERNEL_RCSID(0, "$NetBSD: plrtc_fdt.c,v 1.1 2017/06/08 21:01:06 jmcneill Exp $ static int plrtc_fdt_match(device_t, cfdata_t, void *); static void plrtc_fdt_attach(device_t, device_t, void *); -static const char * const compatible[] = { - "arm,pl031", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "arm,pl031" }, + DEVICE_COMPAT_EOL }; CFATTACH_DECL_NEW(plrtc_fdt, sizeof(struct plrtc_softc), @@ -55,7 +55,7 @@ plrtc_fdt_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_compatible(faa->faa_phandle, compatible) >= 0; + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/fdt/pmu_fdt.c b/sys/arch/arm/fdt/pmu_fdt.c index 507d71cef94d..de6805c178a0 100644 --- a/sys/arch/arm/fdt/pmu_fdt.c +++ b/sys/arch/arm/fdt/pmu_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: pmu_fdt.c,v 1.7 2021/01/15 18:42:41 ryo Exp $ */ +/* $NetBSD: pmu_fdt.c,v 1.8 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2018 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmu_fdt.c,v 1.7 2021/01/15 18:42:41 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmu_fdt.c,v 1.8 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -62,22 +62,22 @@ static void pmu_fdt_attach(device_t, device_t, void *); static void pmu_fdt_init(device_t); static int pmu_fdt_intr_distribute(const int, int, void *); -static const char * const compatible[] = { - "arm,armv8-pmuv3", - "arm,cortex-a73-pmu", - "arm,cortex-a72-pmu", - "arm,cortex-a57-pmu", - "arm,cortex-a53-pmu", +static const struct device_compatible_entry compat_data[] = { + { .compat = "arm,armv8-pmuv3" }, + { .compat = "arm,cortex-a73-pmu" }, + { .compat = "arm,cortex-a72-pmu" }, + { .compat = "arm,cortex-a57-pmu" }, + { .compat = "arm,cortex-a53-pmu" }, - "arm,cortex-a35-pmu", - "arm,cortex-a17-pmu", - "arm,cortex-a12-pmu", - "arm,cortex-a9-pmu", - "arm,cortex-a8-pmu", - "arm,cortex-a7-pmu", - "arm,cortex-a5-pmu", + { .compat = "arm,cortex-a35-pmu" }, + { .compat = "arm,cortex-a17-pmu" }, + { .compat = "arm,cortex-a12-pmu" }, + { .compat = "arm,cortex-a9-pmu" }, + { .compat = "arm,cortex-a8-pmu" }, + { .compat = "arm,cortex-a7-pmu" }, + { .compat = "arm,cortex-a5-pmu" }, - NULL + DEVICE_COMPAT_EOL }; struct pmu_fdt_softc { @@ -93,7 +93,7 @@ pmu_fdt_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/fdt/psci_fdt.c b/sys/arch/arm/fdt/psci_fdt.c index 6fb864ccfe92..c7c224abda2e 100644 --- a/sys/arch/arm/fdt/psci_fdt.c +++ b/sys/arch/arm/fdt/psci_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: psci_fdt.c,v 1.19 2018/10/17 05:30:24 skrll Exp $ */ +/* $NetBSD: psci_fdt.c,v 1.20 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -29,7 +29,7 @@ #include "opt_multiprocessor.h" #include -__KERNEL_RCSID(0, "$NetBSD: psci_fdt.c,v 1.19 2018/10/17 05:30:24 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: psci_fdt.c,v 1.20 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -48,11 +48,11 @@ static void psci_fdt_attach(device_t, device_t, void *); static int psci_fdt_init(const int); -static const char * const compatible[] = { - "arm,psci", - "arm,psci-0.2", - "arm,psci-1.0", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "arm,psci" }, + { .compat = "arm,psci-0.2" }, + { .compat = "arm,psci-1.0" }, + DEVICE_COMPAT_EOL }; CFATTACH_DECL_NEW(psci_fdt, 0, psci_fdt_match, psci_fdt_attach, NULL, NULL); @@ -81,7 +81,7 @@ psci_fdt_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/fdt/smsh_fdt.c b/sys/arch/arm/fdt/smsh_fdt.c index 395ca1f8c076..1609c5dde21e 100644 --- a/sys/arch/arm/fdt/smsh_fdt.c +++ b/sys/arch/arm/fdt/smsh_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: smsh_fdt.c,v 1.3 2021/01/15 18:42:41 ryo Exp $ */ +/* $NetBSD: smsh_fdt.c,v 1.4 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: smsh_fdt.c,v 1.3 2021/01/15 18:42:41 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: smsh_fdt.c,v 1.4 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -49,10 +49,10 @@ __KERNEL_RCSID(0, "$NetBSD: smsh_fdt.c,v 1.3 2021/01/15 18:42:41 ryo Exp $"); static int smsh_fdt_match(device_t, cfdata_t, void *); static void smsh_fdt_attach(device_t, device_t, void *); -static const char * const compatible[] = { - "smsc,lan9118", - "smsc,lan9115", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "smsc,lan9118" }, + { .compat = "smsc,lan9115" }, + DEVICE_COMPAT_EOL }; CFATTACH_DECL_NEW(smsh_fdt, sizeof(struct lan9118_softc), @@ -63,7 +63,7 @@ smsh_fdt_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_compatible(faa->faa_phandle, compatible) >= 0; + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/nvidia/tegra124_car.c b/sys/arch/arm/nvidia/tegra124_car.c index 4b96607f44b3..7fa66154d777 100644 --- a/sys/arch/arm/nvidia/tegra124_car.c +++ b/sys/arch/arm/nvidia/tegra124_car.c @@ -1,4 +1,4 @@ -/* $NetBSD: tegra124_car.c,v 1.21 2020/08/12 10:21:00 jmcneill Exp $ */ +/* $NetBSD: tegra124_car.c,v 1.22 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tegra124_car.c,v 1.21 2020/08/12 10:21:00 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tegra124_car.c,v 1.22 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -724,19 +724,20 @@ static void tegra124_car_rnd_callback(size_t, void *); CFATTACH_DECL_NEW(tegra124_car, sizeof(struct tegra124_car_softc), tegra124_car_match, tegra124_car_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "nvidia,tegra124-car" }, + DEVICE_COMPAT_EOL +}; + static int tegra124_car_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { "nvidia,tegra124-car", NULL }; struct fdt_attach_args * const faa = aux; #if 0 - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); #else - if (of_match_compatible(faa->faa_phandle, compatible) == 0) - return 0; - - return 999; + return of_compatible_match(faa->faa_phandle, compat_data) ? 999 : 0; #endif } diff --git a/sys/arch/arm/nvidia/tegra124_cpu.c b/sys/arch/arm/nvidia/tegra124_cpu.c index 23764ca9784e..3d70aa80b47b 100644 --- a/sys/arch/arm/nvidia/tegra124_cpu.c +++ b/sys/arch/arm/nvidia/tegra124_cpu.c @@ -1,4 +1,4 @@ -/* $NetBSD: tegra124_cpu.c,v 1.5 2020/08/25 13:33:43 skrll Exp $ */ +/* $NetBSD: tegra124_cpu.c,v 1.6 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill @@ -30,7 +30,7 @@ #include "opt_multiprocessor.h" #include -__KERNEL_RCSID(0, "$NetBSD: tegra124_cpu.c,v 1.5 2020/08/25 13:33:43 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tegra124_cpu.c,v 1.6 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -119,16 +119,20 @@ static struct tegra124_speedo { static struct clk *tegra124_clk_pllx = NULL; static struct fdtbus_regulator *tegra124_reg_vddcpu = NULL; +static const struct device_compatible_entry compat_data[] = { + { .compat = "nvidia,tegra124" }, + DEVICE_COMPAT_EOL +}; + static int tegra124_cpu_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { "nvidia,tegra124", NULL }; struct fdt_attach_args *faa = aux; if (OF_finddevice("/cpus/cpu@0") != faa->faa_phandle) return 0; - return of_match_compatible(OF_finddevice("/"), compatible); + return of_compatible_match(OF_finddevice("/"), compat_data); } static void diff --git a/sys/arch/arm/nvidia/tegra124_xusbpad.c b/sys/arch/arm/nvidia/tegra124_xusbpad.c index 97f9c9978b5a..fcc0776aff3a 100644 --- a/sys/arch/arm/nvidia/tegra124_xusbpad.c +++ b/sys/arch/arm/nvidia/tegra124_xusbpad.c @@ -1,4 +1,4 @@ -/* $NetBSD: tegra124_xusbpad.c,v 1.4 2019/10/13 06:11:31 skrll Exp $ */ +/* $NetBSD: tegra124_xusbpad.c,v 1.5 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill @@ -29,7 +29,7 @@ #include "opt_tegra.h" #include -__KERNEL_RCSID(0, "$NetBSD: tegra124_xusbpad.c,v 1.4 2019/10/13 06:11:31 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tegra124_xusbpad.c,v 1.5 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -70,14 +70,17 @@ static void padregdump(void); CFATTACH_DECL_NEW(tegra124_xusbpad, sizeof(struct tegra124_xusbpad_softc), tegra124_xusbpad_match, tegra124_xusbpad_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "nvidia,tegra124-xusb-padctl" }, + DEVICE_COMPAT_EOL +}; + static int tegra124_xusbpad_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = - { "nvidia,tegra124-xusb-padctl", NULL }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/nvidia/tegra210_car.c b/sys/arch/arm/nvidia/tegra210_car.c index 83fd08fa95b0..f81c6c615133 100644 --- a/sys/arch/arm/nvidia/tegra210_car.c +++ b/sys/arch/arm/nvidia/tegra210_car.c @@ -1,4 +1,4 @@ -/* $NetBSD: tegra210_car.c,v 1.26 2020/04/30 03:40:52 riastradh Exp $ */ +/* $NetBSD: tegra210_car.c,v 1.27 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2015-2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tegra210_car.c,v 1.26 2020/04/30 03:40:52 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tegra210_car.c,v 1.27 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -737,19 +737,20 @@ static void tegra210_car_parent_init(struct tegra210_car_softc *); CFATTACH_DECL_NEW(tegra210_car, sizeof(struct tegra210_car_softc), tegra210_car_match, tegra210_car_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "nvidia,tegra210-car" }, + DEVICE_COMPAT_EOL +}; + static int tegra210_car_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { "nvidia,tegra210-car", NULL }; struct fdt_attach_args * const faa = aux; #if 0 - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); #else - if (of_match_compatible(faa->faa_phandle, compatible) == 0) - return 0; - - return 999; + return of_compatible_match(faa->faa_phandle, compat_data) ? 999 : 0; #endif } diff --git a/sys/arch/arm/nvidia/tegra210_xusbpad.c b/sys/arch/arm/nvidia/tegra210_xusbpad.c index afab3d4bf5d6..27bc1e9f0e04 100644 --- a/sys/arch/arm/nvidia/tegra210_xusbpad.c +++ b/sys/arch/arm/nvidia/tegra210_xusbpad.c @@ -1,4 +1,4 @@ -/* $NetBSD: tegra210_xusbpad.c,v 1.13 2019/10/13 06:11:31 skrll Exp $ */ +/* $NetBSD: tegra210_xusbpad.c,v 1.14 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tegra210_xusbpad.c,v 1.13 2019/10/13 06:11:31 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tegra210_xusbpad.c,v 1.14 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -964,16 +964,17 @@ static const struct tegra_xusbpad_ops tegra210_xusbpad_ops = { .xhci_enable = tegra210_xusbpad_xhci_enable, }; +static const struct device_compatible_entry compat_data[] = { + { .compat = "nvidia,tegra210-xusb-padctl" }, + DEVICE_COMPAT_EOL +}; + static int tegra210_xusbpad_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "nvidia,tegra210-xusb-padctl", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/nvidia/tegra_ahcisata.c b/sys/arch/arm/nvidia/tegra_ahcisata.c index 18d20001c3b0..3dfe985c1ef2 100644 --- a/sys/arch/arm/nvidia/tegra_ahcisata.c +++ b/sys/arch/arm/nvidia/tegra_ahcisata.c @@ -1,4 +1,4 @@ -/* $NetBSD: tegra_ahcisata.c,v 1.17 2021/01/27 01:58:15 thorpej Exp $ */ +/* $NetBSD: tegra_ahcisata.c,v 1.18 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tegra_ahcisata.c,v 1.17 2021/01/27 01:58:15 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tegra_ahcisata.c,v 1.18 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -120,7 +120,7 @@ tegra_ahcisata_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -169,7 +169,7 @@ tegra_ahcisata_attach(device_t parent, device_t self, void *aux) return; } - sc->sc_tad = of_search_compatible(faa->faa_phandle, compat_data)->data; + sc->sc_tad = of_compatible_lookup(faa->faa_phandle, compat_data)->data; if (sc->sc_tad->tad_type == TEGRA124) { sc->sc_clk_cml1 = fdtbus_clock_get(phandle, "cml1"); if (sc->sc_clk_cml1 == NULL) { diff --git a/sys/arch/arm/nvidia/tegra_apbdma.c b/sys/arch/arm/nvidia/tegra_apbdma.c index 8874c9762ba9..e93acf25c457 100644 --- a/sys/arch/arm/nvidia/tegra_apbdma.c +++ b/sys/arch/arm/nvidia/tegra_apbdma.c @@ -1,4 +1,4 @@ -/* $NetBSD: tegra_apbdma.c,v 1.8 2021/01/15 23:11:59 jmcneill Exp $ */ +/* $NetBSD: tegra_apbdma.c,v 1.9 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tegra_apbdma.c,v 1.8 2021/01/15 23:11:59 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tegra_apbdma.c,v 1.9 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -91,17 +91,18 @@ CFATTACH_DECL_NEW(tegra_apbdma, sizeof(struct tegra_apbdma_softc), #define APBDMA_WRITE(sc, reg, val) \ bus_space_write_4((sc)->sc_bst, (sc)->sc_bsh, (reg), (val)) +static const struct device_compatible_entry compat_data[] = { + { .compat = "nvidia,tegra210-apbdma" }, + { .compat = "nvidia,tegra124-apbdma" }, + DEVICE_COMPAT_EOL +}; + static int tegra_apbdma_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "nvidia,tegra210-apbdma", - "nvidia,tegra124-apbdma", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/nvidia/tegra_cec.c b/sys/arch/arm/nvidia/tegra_cec.c index 5c75ae99d272..48f1ba709487 100644 --- a/sys/arch/arm/nvidia/tegra_cec.c +++ b/sys/arch/arm/nvidia/tegra_cec.c @@ -1,4 +1,4 @@ -/* $NetBSD: tegra_cec.c,v 1.7 2021/01/15 23:11:59 jmcneill Exp $ */ +/* $NetBSD: tegra_cec.c,v 1.8 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tegra_cec.c,v 1.7 2021/01/15 23:11:59 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tegra_cec.c,v 1.8 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -111,13 +111,17 @@ CFATTACH_DECL_NEW(tegra_cec, sizeof(struct tegra_cec_softc), #define CEC_SET_CLEAR(sc, reg, set, clr) \ tegra_reg_set_clear((sc)->sc_bst, (sc)->sc_bsh, (reg), (set), (clr)) +static const struct device_compatible_entry compat_data[] = { + { .compat = "nvidia,tegra124-cec" }, + DEVICE_COMPAT_EOL +}; + static int tegra_cec_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { "nvidia,tegra124-cec", NULL }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/nvidia/tegra_com.c b/sys/arch/arm/nvidia/tegra_com.c index 6b57624d3e54..7a624463cb26 100644 --- a/sys/arch/arm/nvidia/tegra_com.c +++ b/sys/arch/arm/nvidia/tegra_com.c @@ -1,4 +1,4 @@ -/* $NetBSD: tegra_com.c,v 1.14 2021/01/15 23:11:59 jmcneill Exp $ */ +/* $NetBSD: tegra_com.c,v 1.15 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: tegra_com.c,v 1.14 2021/01/15 23:11:59 jmcneill Exp $"); +__KERNEL_RCSID(1, "$NetBSD: tegra_com.c,v 1.15 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -51,11 +51,11 @@ __KERNEL_RCSID(1, "$NetBSD: tegra_com.c,v 1.14 2021/01/15 23:11:59 jmcneill Exp static int tegra_com_match(device_t, cfdata_t, void *); static void tegra_com_attach(device_t, device_t, void *); -static const char * const compatible[] = { - "nvidia,tegra210-uart", - "nvidia,tegra124-uart", - "nvidia,tegra20-uart", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "nvidia,tegra210-uart" }, + { .compat = "nvidia,tegra124-uart" }, + { .compat = "nvidia,tegra20-uart" }, + DEVICE_COMPAT_EOL }; struct tegra_com_softc { @@ -74,7 +74,7 @@ tegra_com_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -146,7 +146,7 @@ tegra_com_attach(device_t parent, device_t self, void *aux) static int tegra_com_console_match(int phandle) { - return of_match_compatible(phandle, compatible); + return of_compatible_match(phandle, compat_data); } static void diff --git a/sys/arch/arm/nvidia/tegra_drm.c b/sys/arch/arm/nvidia/tegra_drm.c index 30be18bf6cf2..312a51f9c1d2 100644 --- a/sys/arch/arm/nvidia/tegra_drm.c +++ b/sys/arch/arm/nvidia/tegra_drm.c @@ -1,4 +1,4 @@ -/* $NetBSD: tegra_drm.c,v 1.10 2018/08/27 15:31:51 riastradh Exp $ */ +/* $NetBSD: tegra_drm.c,v 1.11 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tegra_drm.c,v 1.10 2018/08/27 15:31:51 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tegra_drm.c,v 1.11 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -87,15 +87,29 @@ static struct drm_driver tegra_drm_driver = { CFATTACH_DECL_NEW(tegra_drm, sizeof(struct tegra_drm_softc), tegra_drm_match, tegra_drm_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "nvidia,tegra124-host1x" }, + DEVICE_COMPAT_EOL +}; + static int tegra_drm_match(device_t parent, cfdata_t cf, void *aux) { - const char * compatible[] = { "nvidia,tegra124-host1x", NULL }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } +static const struct device_compatible_entry hdmi_compat[] = { + { .compat = "nvidia,tegra124-hdmi" }, + DEVICE_COMPAT_EOL +}; + +static const struct device_compatible_entry dc_compat[] = { + { .compat = "nvidia,tegra124-dc" }, + DEVICE_COMPAT_EOL +}; + static void tegra_drm_attach(device_t parent, device_t self, void *aux) { @@ -104,9 +118,7 @@ tegra_drm_attach(device_t parent, device_t self, void *aux) struct drm_driver * const driver = &tegra_drm_driver; prop_dictionary_t prop = device_properties(self); int error, node, hdmi_phandle, ddc_phandle; - const char * const hdmi_compat[] = { "nvidia,tegra124-hdmi", NULL }; - const char * const dc_compat[] = { "nvidia,tegra124-dc", NULL }; - const char * const hdmi_supplies[] = { + static const char * const hdmi_supplies[] = { "hdmi-supply", "pll-supply", "vdd-supply" }; struct fdtbus_regulator *reg; @@ -134,13 +146,13 @@ tegra_drm_attach(device_t parent, device_t self, void *aux) ndc = 0; hdmi_phandle = -1; for (node = OF_child(faa->faa_phandle); node; node = OF_peer(node)) { - if (of_match_compatible(node, hdmi_compat)) { + if (of_compatible_match(node, hdmi_compat)) { sc->sc_clk_hdmi = fdtbus_clock_get(node, "hdmi"); sc->sc_clk_hdmi_parent = fdtbus_clock_get(node, "parent"); sc->sc_rst_hdmi = fdtbus_reset_get(node, "hdmi"); hdmi_phandle = node; - } else if (of_match_compatible(node, dc_compat) && + } else if (of_compatible_match(node, dc_compat) && ndc < __arraycount(sc->sc_clk_dc)) { sc->sc_clk_dc[ndc] = fdtbus_clock_get(node, "dc"); sc->sc_clk_dc_parent[ndc] = fdtbus_clock_get(node, diff --git a/sys/arch/arm/nvidia/tegra_ehci.c b/sys/arch/arm/nvidia/tegra_ehci.c index ee619f7dd51c..66ae612ce015 100644 --- a/sys/arch/arm/nvidia/tegra_ehci.c +++ b/sys/arch/arm/nvidia/tegra_ehci.c @@ -1,4 +1,4 @@ -/* $NetBSD: tegra_ehci.c,v 1.17 2021/01/15 23:11:59 jmcneill Exp $ */ +/* $NetBSD: tegra_ehci.c,v 1.18 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tegra_ehci.c,v 1.17 2021/01/15 23:11:59 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tegra_ehci.c,v 1.18 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -70,18 +70,19 @@ CFATTACH_DECL2_NEW(tegra_ehci, sizeof(struct tegra_ehci_softc), tegra_ehci_match, tegra_ehci_attach, NULL, ehci_activate, NULL, ehci_childdet); +static const struct device_compatible_entry compat_data[] = { + { .compat = "nvidia,tegra210-ehci" }, + { .compat = "nvidia,tegra124-ehci" }, + { .compat = "nvidia,tegra30-ehci" }, + DEVICE_COMPAT_EOL +}; + static int tegra_ehci_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "nvidia,tegra210-ehci", - "nvidia,tegra124-ehci", - "nvidia,tegra30-ehci", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/nvidia/tegra_fuse.c b/sys/arch/arm/nvidia/tegra_fuse.c index 4f5f4d20f605..30f01e77d32a 100644 --- a/sys/arch/arm/nvidia/tegra_fuse.c +++ b/sys/arch/arm/nvidia/tegra_fuse.c @@ -1,4 +1,4 @@ -/* $NetBSD: tegra_fuse.c,v 1.8 2019/10/13 06:11:31 skrll Exp $ */ +/* $NetBSD: tegra_fuse.c,v 1.9 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tegra_fuse.c,v 1.8 2019/10/13 06:11:31 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tegra_fuse.c,v 1.9 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -58,17 +58,18 @@ static struct tegra_fuse_softc *fuse_softc = NULL; CFATTACH_DECL_NEW(tegra_fuse, sizeof(struct tegra_fuse_softc), tegra_fuse_match, tegra_fuse_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "nvidia,tegra210-efuse" }, + { .compat = "nvidia,tegra124-efuse" }, + DEVICE_COMPAT_EOL +}; + static int tegra_fuse_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "nvidia,tegra210-efuse", - "nvidia,tegra124-efuse", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/nvidia/tegra_gpio.c b/sys/arch/arm/nvidia/tegra_gpio.c index 3ffcf3709874..104f4a2c20dd 100644 --- a/sys/arch/arm/nvidia/tegra_gpio.c +++ b/sys/arch/arm/nvidia/tegra_gpio.c @@ -1,4 +1,4 @@ -/* $NetBSD: tegra_gpio.c,v 1.11 2019/10/13 06:11:31 skrll Exp $ */ +/* $NetBSD: tegra_gpio.c,v 1.12 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tegra_gpio.c,v 1.11 2019/10/13 06:11:31 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tegra_gpio.c,v 1.12 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -145,18 +145,19 @@ CFATTACH_DECL_NEW(tegra_gpio, sizeof(struct tegra_gpio_softc), (bank)->bank_sc->sc_bsh, \ (bank)->bank_pb->base + (reg)) +static const struct device_compatible_entry compat_data[] = { + { .compat = "nvidia,tegra210-gpio" }, + { .compat = "nvidia,tegra124-gpio" }, + { .compat = "nvidia,tegra30-gpio" }, + DEVICE_COMPAT_EOL +}; + static int tegra_gpio_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "nvidia,tegra210-gpio", - "nvidia,tegra124-gpio", - "nvidia,tegra30-gpio", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/nvidia/tegra_hdaudio.c b/sys/arch/arm/nvidia/tegra_hdaudio.c index 29df6153006e..7e547a4030ec 100644 --- a/sys/arch/arm/nvidia/tegra_hdaudio.c +++ b/sys/arch/arm/nvidia/tegra_hdaudio.c @@ -1,4 +1,4 @@ -/* $NetBSD: tegra_hdaudio.c,v 1.14 2021/01/15 23:11:59 jmcneill Exp $ */ +/* $NetBSD: tegra_hdaudio.c,v 1.15 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tegra_hdaudio.c,v 1.14 2021/01/15 23:11:59 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tegra_hdaudio.c,v 1.15 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -82,17 +82,18 @@ CFATTACH_DECL2_NEW(tegra_hdaudio, sizeof(struct tegra_hdaudio_softc), tegra_hdaudio_match, tegra_hdaudio_attach, tegra_hdaudio_detach, NULL, tegra_hdaudio_rescan, tegra_hdaudio_childdet); +static const struct device_compatible_entry compat_data[] = { + { .compat = "nvidia,tegra210-hda" }, + { .compat = "nvidia,tegra124-hda" }, + DEVICE_COMPAT_EOL +}; + static int tegra_hdaudio_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "nvidia,tegra210-hda", - "nvidia,tegra124-hda", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/nvidia/tegra_i2c.c b/sys/arch/arm/nvidia/tegra_i2c.c index 2d719783ece6..c77232a04c95 100644 --- a/sys/arch/arm/nvidia/tegra_i2c.c +++ b/sys/arch/arm/nvidia/tegra_i2c.c @@ -1,4 +1,4 @@ -/* $NetBSD: tegra_i2c.c,v 1.25 2021/01/15 23:11:59 jmcneill Exp $ */ +/* $NetBSD: tegra_i2c.c,v 1.26 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tegra_i2c.c,v 1.25 2021/01/15 23:11:59 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tegra_i2c.c,v 1.26 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -83,18 +83,19 @@ CFATTACH_DECL_NEW(tegra_i2c, sizeof(struct tegra_i2c_softc), #define I2C_SET_CLEAR(sc, reg, setval, clrval) \ tegra_reg_set_clear((sc)->sc_bst, (sc)->sc_bsh, (reg), (setval), (clrval)) +static const struct device_compatible_entry compat_data[] = { + { .compat = "nvidia,tegra210-i2c" }, + { .compat = "nvidia,tegra124-i2c" }, + { .compat = "nvidia,tegra114-i2c" }, + DEVICE_COMPAT_EOL +}; + static int tegra_i2c_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "nvidia,tegra210-i2c", - "nvidia,tegra124-i2c", - "nvidia,tegra114-i2c", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/nvidia/tegra_lic.c b/sys/arch/arm/nvidia/tegra_lic.c index 2adb9ca207bc..b27ebcf72354 100644 --- a/sys/arch/arm/nvidia/tegra_lic.c +++ b/sys/arch/arm/nvidia/tegra_lic.c @@ -1,4 +1,4 @@ -/* $NetBSD: tegra_lic.c,v 1.7 2021/01/15 00:38:22 jmcneill Exp $ */ +/* $NetBSD: tegra_lic.c,v 1.8 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tegra_lic.c,v 1.7 2021/01/15 00:38:22 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tegra_lic.c,v 1.8 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -69,17 +69,18 @@ struct tegra_lic_softc { CFATTACH_DECL_NEW(tegra_lic, sizeof(struct tegra_lic_softc), tegra_lic_match, tegra_lic_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "nvidia,tegra210-ictlr" }, + { .compat = "nvidia,tegra124-ictlr" }, + DEVICE_COMPAT_EOL +}; + static int tegra_lic_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "nvidia,tegra210-ictlr", - "nvidia,tegra124-ictlr", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/nvidia/tegra_mc.c b/sys/arch/arm/nvidia/tegra_mc.c index 3fca27a9587f..ed43e8433152 100644 --- a/sys/arch/arm/nvidia/tegra_mc.c +++ b/sys/arch/arm/nvidia/tegra_mc.c @@ -1,4 +1,4 @@ -/* $NetBSD: tegra_mc.c,v 1.11 2021/01/15 23:11:59 jmcneill Exp $ */ +/* $NetBSD: tegra_mc.c,v 1.12 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill @@ -29,7 +29,7 @@ #include "locators.h" #include -__KERNEL_RCSID(0, "$NetBSD: tegra_mc.c,v 1.11 2021/01/15 23:11:59 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tegra_mc.c,v 1.12 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -68,13 +68,17 @@ CFATTACH_DECL_NEW(tegra_mc, sizeof(struct tegra_mc_softc), #define MC_SET_CLEAR(sc, reg, set, clr) \ tegra_reg_set_clear((sc)->sc_bst, (sc)->sc_bsh, (reg), (set), (clr)) +static const struct device_compatible_entry compat_data[] = { + { .compat = "nvidia,tegra124-mc" }, + DEVICE_COMPAT_EOL +}; + static int tegra_mc_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { "nvidia,tegra124-mc", NULL }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/nvidia/tegra_nouveau.c b/sys/arch/arm/nvidia/tegra_nouveau.c index 4b2083222894..7a2017144f64 100644 --- a/sys/arch/arm/nvidia/tegra_nouveau.c +++ b/sys/arch/arm/nvidia/tegra_nouveau.c @@ -1,4 +1,4 @@ -/* $NetBSD: tegra_nouveau.c,v 1.15 2021/01/25 14:20:38 thorpej Exp $ */ +/* $NetBSD: tegra_nouveau.c,v 1.16 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tegra_nouveau.c,v 1.15 2021/01/25 14:20:38 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tegra_nouveau.c,v 1.16 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -113,7 +113,7 @@ static const struct nvkm_device_tegra_func gk20a_platform_data = { static const struct device_compatible_entry compat_data[] = { { .compat = "nvidia,gk20a", .data = &gk20a_platform_data }, { .compat = "nvidia,gm20b", .data = &gk20a_platform_data }, - { } + DEVICE_COMPAT_EOL }; static int @@ -121,7 +121,7 @@ tegra_nouveau_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -131,7 +131,7 @@ tegra_nouveau_attach(device_t parent, device_t self, void *aux) struct fdt_attach_args * const faa = aux; prop_dictionary_t prop = device_properties(self); const struct device_compatible_entry *data = - of_search_compatible(faa->faa_phandle, compat_data); + of_compatible_lookup(faa->faa_phandle, compat_data); const struct nvkm_device_tegra_func *tegra_func __diagused = data->data; int error; diff --git a/sys/arch/arm/nvidia/tegra_pcie.c b/sys/arch/arm/nvidia/tegra_pcie.c index d78fcd0cca78..d8e4a9275240 100644 --- a/sys/arch/arm/nvidia/tegra_pcie.c +++ b/sys/arch/arm/nvidia/tegra_pcie.c @@ -1,4 +1,4 @@ -/* $NetBSD: tegra_pcie.c,v 1.35 2021/01/27 01:58:15 thorpej Exp $ */ +/* $NetBSD: tegra_pcie.c,v 1.36 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tegra_pcie.c,v 1.35 2021/01/27 01:58:15 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tegra_pcie.c,v 1.36 2021/01/27 03:10:19 thorpej Exp $"); #include @@ -147,7 +147,7 @@ tegra_pcie_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -204,7 +204,7 @@ tegra_pcie_attach(device_t parent, device_t self, void *aux) return; } - dce = of_search_compatible(faa->faa_phandle, compat_data); + dce = of_compatible_lookup(faa->faa_phandle, compat_data); KASSERT(dce != NULL); sc->sc_type = dce->value; diff --git a/sys/arch/arm/nvidia/tegra_pinmux.c b/sys/arch/arm/nvidia/tegra_pinmux.c index 44f0ac342e1c..79889615f93e 100644 --- a/sys/arch/arm/nvidia/tegra_pinmux.c +++ b/sys/arch/arm/nvidia/tegra_pinmux.c @@ -1,4 +1,4 @@ -/* $NetBSD: tegra_pinmux.c,v 1.8 2021/01/25 14:20:38 thorpej Exp $ */ +/* $NetBSD: tegra_pinmux.c,v 1.9 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2015-2017 Jared McNeill @@ -29,7 +29,7 @@ #include "opt_tegra.h" #include -__KERNEL_RCSID(0, "$NetBSD: tegra_pinmux.c,v 1.8 2021/01/25 14:20:38 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tegra_pinmux.c,v 1.9 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -79,7 +79,7 @@ static const struct device_compatible_entry compat_data[] = { #ifdef SOC_TEGRA210 { .compat = "nvidia,tegra210-pinmux", .data = &tegra210_pinmux_conf }, #endif - { } + DEVICE_COMPAT_EOL }; static const struct tegra_pinmux_pins * @@ -249,7 +249,7 @@ tegra_pinmux_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -277,7 +277,7 @@ tegra_pinmux_attach(device_t parent, device_t self, void *aux) return; } } - sc->sc_conf = of_search_compatible(phandle, compat_data)->data; + sc->sc_conf = of_compatible_lookup(phandle, compat_data)->data; aprint_naive("\n"); aprint_normal(": Pinmux\n"); diff --git a/sys/arch/arm/nvidia/tegra_platform.c b/sys/arch/arm/nvidia/tegra_platform.c index 75a0b82b3f7c..65d75e2e97d2 100644 --- a/sys/arch/arm/nvidia/tegra_platform.c +++ b/sys/arch/arm/nvidia/tegra_platform.c @@ -1,4 +1,4 @@ -/* $NetBSD: tegra_platform.c,v 1.24 2020/09/28 11:54:23 jmcneill Exp $ */ +/* $NetBSD: tegra_platform.c,v 1.25 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared D. McNeill @@ -34,7 +34,7 @@ #include "ukbd.h" #include -__KERNEL_RCSID(0, "$NetBSD: tegra_platform.c,v 1.24 2020/09/28 11:54:23 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tegra_platform.c,v 1.25 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -182,11 +182,12 @@ tegra_platform_device_register(device_t self, void *aux) } if (device_is_a(self, "tegrapcie")) { - const char * const jetsontk1_compat[] = { - "nvidia,jetson-tk1", NULL + static const struct device_compatible_entry jetsontk1[] = { + { .compat = "nvidia,jetson-tk1" }, + DEVICE_COMPAT_EOL }; const int phandle = OF_peer(0); - if (of_match_compatible(phandle, jetsontk1_compat)) { + if (of_compatible_match(phandle, jetsontk1)) { /* rfkill GPIO at GPIO X7 */ struct tegra_gpio_pin *pin = tegra_gpio_acquire("X7", GPIO_PIN_OUTPUT); diff --git a/sys/arch/arm/nvidia/tegra_pmc.c b/sys/arch/arm/nvidia/tegra_pmc.c index 4bba7a9fde46..e4beba7131d6 100644 --- a/sys/arch/arm/nvidia/tegra_pmc.c +++ b/sys/arch/arm/nvidia/tegra_pmc.c @@ -1,4 +1,4 @@ -/* $NetBSD: tegra_pmc.c,v 1.15 2019/10/13 06:11:31 skrll Exp $ */ +/* $NetBSD: tegra_pmc.c,v 1.16 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tegra_pmc.c,v 1.15 2019/10/13 06:11:31 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tegra_pmc.c,v 1.16 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -56,17 +56,18 @@ static struct tegra_pmc_softc *pmc_softc = NULL; CFATTACH_DECL_NEW(tegra_pmc, sizeof(struct tegra_pmc_softc), tegra_pmc_match, tegra_pmc_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "nvidia,tegra210-pmc" }, + { .compat = "nvidia,tegra124-pmc" }, + DEVICE_COMPAT_EOL +}; + static int tegra_pmc_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "nvidia,tegra210-pmc", - "nvidia,tegra124-pmc", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/nvidia/tegra_rtc.c b/sys/arch/arm/nvidia/tegra_rtc.c index c6d42258c657..bfe6caff15aa 100644 --- a/sys/arch/arm/nvidia/tegra_rtc.c +++ b/sys/arch/arm/nvidia/tegra_rtc.c @@ -1,4 +1,4 @@ -/* $NetBSD: tegra_rtc.c,v 1.7 2019/10/13 06:11:31 skrll Exp $ */ +/* $NetBSD: tegra_rtc.c,v 1.8 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tegra_rtc.c,v 1.7 2019/10/13 06:11:31 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tegra_rtc.c,v 1.8 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -67,18 +67,19 @@ CFATTACH_DECL_NEW(tegra_rtc, sizeof(struct tegra_rtc_softc), #define RTC_WRITE(sc, reg, val) \ bus_space_write_4((sc)->sc_bst, (sc)->sc_bsh, (reg), (val)) +static const struct device_compatible_entry compat_data[] = { + { .compat = "nvidia,tegra210-rtc" }, + { .compat = "nvidia,tegra124-rtc" }, + { .compat = "nvidia,tegra20-rtc" }, + DEVICE_COMPAT_EOL +}; + static int tegra_rtc_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "nvidia,tegra210-rtc", - "nvidia,tegra124-rtc", - "nvidia,tegra20-rtc", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/nvidia/tegra_sdhc.c b/sys/arch/arm/nvidia/tegra_sdhc.c index 2687cbc58006..293787307fa3 100644 --- a/sys/arch/arm/nvidia/tegra_sdhc.c +++ b/sys/arch/arm/nvidia/tegra_sdhc.c @@ -1,4 +1,4 @@ -/* $NetBSD: tegra_sdhc.c,v 1.28 2021/01/15 23:11:59 jmcneill Exp $ */ +/* $NetBSD: tegra_sdhc.c,v 1.29 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill @@ -31,7 +31,7 @@ #include "locators.h" #include -__KERNEL_RCSID(0, "$NetBSD: tegra_sdhc.c,v 1.28 2021/01/15 23:11:59 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tegra_sdhc.c,v 1.29 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -78,17 +78,18 @@ struct tegra_sdhc_softc { CFATTACH_DECL_NEW(tegra_sdhc, sizeof(struct tegra_sdhc_softc), tegra_sdhc_match, tegra_sdhc_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "nvidia,tegra210-sdhci" }, + { .compat = "nvidia,tegra124-sdhci" }, + DEVICE_COMPAT_EOL +}; + static int tegra_sdhc_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "nvidia,tegra210-sdhci", - "nvidia,tegra124-sdhci", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/nvidia/tegra_soctherm.c b/sys/arch/arm/nvidia/tegra_soctherm.c index b30762bfa1c1..ab470675e55f 100644 --- a/sys/arch/arm/nvidia/tegra_soctherm.c +++ b/sys/arch/arm/nvidia/tegra_soctherm.c @@ -1,4 +1,4 @@ -/* $NetBSD: tegra_soctherm.c,v 1.12 2021/01/27 01:58:15 thorpej Exp $ */ +/* $NetBSD: tegra_soctherm.c,v 1.13 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tegra_soctherm.c,v 1.12 2021/01/27 01:58:15 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tegra_soctherm.c,v 1.13 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -171,7 +171,7 @@ tegra_soctherm_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -215,7 +215,7 @@ tegra_soctherm_attach(device_t parent, device_t self, void *aux) aprint_naive("\n"); aprint_normal(": SOC_THERM\n"); - sc->sc_config = of_search_compatible(phandle, compat_data)->data; + sc->sc_config = of_compatible_lookup(phandle, compat_data)->data; if (sc->sc_config == NULL) { aprint_error_dev(self, "unsupported SoC\n"); return; diff --git a/sys/arch/arm/nvidia/tegra_timer.c b/sys/arch/arm/nvidia/tegra_timer.c index 614d98d02faf..7ee8141eaa10 100644 --- a/sys/arch/arm/nvidia/tegra_timer.c +++ b/sys/arch/arm/nvidia/tegra_timer.c @@ -1,4 +1,4 @@ -/* $NetBSD: tegra_timer.c,v 1.11 2019/10/13 06:11:31 skrll Exp $ */ +/* $NetBSD: tegra_timer.c,v 1.12 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tegra_timer.c,v 1.11 2019/10/13 06:11:31 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tegra_timer.c,v 1.12 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -71,18 +71,19 @@ CFATTACH_DECL_NEW(tegra_timer, sizeof(struct tegra_timer_softc), #define TIMER_SET_CLEAR(sc, reg, set, clr) \ tegra_reg_set_clear((sc)->sc_bst, (sc)->sc_bsh, (reg), (set), (clr)) +static const struct device_compatible_entry compat_data[] = { + { .compat = "nvidia,tegra210-timer" }, + { .compat = "nvidia,tegra124-timer" }, + { .compat = "nvidia,tegra20-timer" }, + DEVICE_COMPAT_EOL +}; + static int tegra_timer_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "nvidia,tegra210-timer", - "nvidia,tegra124-timer", - "nvidia,tegra20-timer", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/nvidia/tegra_usbphy.c b/sys/arch/arm/nvidia/tegra_usbphy.c index 252bd3d93ab4..4908cf805ed7 100644 --- a/sys/arch/arm/nvidia/tegra_usbphy.c +++ b/sys/arch/arm/nvidia/tegra_usbphy.c @@ -1,4 +1,4 @@ -/* $NetBSD: tegra_usbphy.c,v 1.10 2019/10/13 06:11:31 skrll Exp $ */ +/* $NetBSD: tegra_usbphy.c,v 1.11 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tegra_usbphy.c,v 1.10 2019/10/13 06:11:31 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tegra_usbphy.c,v 1.11 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -76,18 +76,19 @@ static void tegra_usbphy_utmip_init(struct tegra_usbphy_softc *); CFATTACH_DECL_NEW(tegra_usbphy, sizeof(struct tegra_usbphy_softc), tegra_usbphy_match, tegra_usbphy_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "nvidia,tegra210-usb-phy" }, + { .compat = "nvidia,tegra124-usb-phy" }, + { .compat = "nvidia,tegra30-usb-phy" }, + DEVICE_COMPAT_EOL +}; + static int tegra_usbphy_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "nvidia,tegra210-usb-phy", - "nvidia,tegra124-usb-phy", - "nvidia,tegra30-usb-phy", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/nvidia/tegra_xusb.c b/sys/arch/arm/nvidia/tegra_xusb.c index 5071cef5d7af..c7499f3b4f5e 100644 --- a/sys/arch/arm/nvidia/tegra_xusb.c +++ b/sys/arch/arm/nvidia/tegra_xusb.c @@ -1,4 +1,4 @@ -/* $NetBSD: tegra_xusb.c,v 1.25 2021/01/27 01:58:15 thorpej Exp $ */ +/* $NetBSD: tegra_xusb.c,v 1.26 2021/01/27 03:10:19 thorpej Exp $ */ /* * Copyright (c) 2016 Jonathan A. Kollasch @@ -30,7 +30,7 @@ #include "opt_tegra.h" #include -__KERNEL_RCSID(0, "$NetBSD: tegra_xusb.c,v 1.25 2021/01/27 01:58:15 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tegra_xusb.c,v 1.26 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -193,7 +193,7 @@ tegra_xusb_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } #define tegra_xusb_attach_check(sc, cond, fmt, ...) \ @@ -230,7 +230,7 @@ tegra_xusb_attach(device_t parent, device_t self, void *aux) sc->sc_quirks = XHCI_DEFERRED_START; psc->sc_phandle = faa->faa_phandle; - psc->sc_txd = of_search_compatible(faa->faa_phandle, compat_data)->data; + psc->sc_txd = of_compatible_lookup(faa->faa_phandle, compat_data)->data; if (fdtbus_get_reg_byname(faa->faa_phandle, "hcd", &addr, &size) != 0) { aprint_error(": couldn't get registers\n"); diff --git a/sys/arch/arm/nxp/if_enet_imx.c b/sys/arch/arm/nxp/if_enet_imx.c index a300036dd49e..3bf02afe566a 100644 --- a/sys/arch/arm/nxp/if_enet_imx.c +++ b/sys/arch/arm/nxp/if_enet_imx.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_enet_imx.c,v 1.5 2021/01/27 02:14:49 thorpej Exp $ */ +/* $NetBSD: if_enet_imx.c,v 1.6 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2019 Genetec Corporation. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_enet_imx.c,v 1.5 2021/01/27 02:14:49 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_enet_imx.c,v 1.6 2021/01/27 03:10:20 thorpej Exp $"); #include "opt_fdt.h" @@ -66,7 +66,7 @@ enet_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } void @@ -127,7 +127,7 @@ enet_attach(device_t parent, device_t self, void *aux) sc->sc_ioh = bsh; sc->sc_dmat = faa->faa_dmat; - sc->sc_imxtype = of_search_compatible(phandle, compat_data)->value; + sc->sc_imxtype = of_compatible_lookup(phandle, compat_data)->value; sc->sc_unit = 0; sc->sc_phyid = enet_phy_id(sc, phandle); diff --git a/sys/arch/arm/nxp/imx6_clk.c b/sys/arch/arm/nxp/imx6_clk.c index ab622fdc074c..49a4c8e251e8 100644 --- a/sys/arch/arm/nxp/imx6_clk.c +++ b/sys/arch/arm/nxp/imx6_clk.c @@ -1,4 +1,4 @@ -/* $NetBSD: imx6_clk.c,v 1.1 2020/12/23 14:42:38 skrll Exp $ */ +/* $NetBSD: imx6_clk.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2019 Genetec Corporation. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: imx6_clk.c,v 1.1 2020/12/23 14:42:38 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: imx6_clk.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $"); #include "opt_fdt.h" @@ -91,13 +91,17 @@ static void imx6ccm_attach(device_t, device_t, void *); CFATTACH_DECL_NEW(imx6ccm, sizeof(struct imx6ccm_softc), imx6ccm_match, imx6ccm_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "fsl,imx6q-ccm" }, + DEVICE_COMPAT_EOL +}; + static int imx6ccm_match(device_t parent, cfdata_t cfdata, void *aux) { - const char * const compatible[] = { "fsl,imx6q-ccm", NULL }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/nxp/imx6_dwhdmi.c b/sys/arch/arm/nxp/imx6_dwhdmi.c index 0295578ab7d1..9ad1f35fe539 100644 --- a/sys/arch/arm/nxp/imx6_dwhdmi.c +++ b/sys/arch/arm/nxp/imx6_dwhdmi.c @@ -1,4 +1,4 @@ -/* $NetBSD: imx6_dwhdmi.c,v 1.1 2020/12/23 14:42:38 skrll Exp $ */ +/* $NetBSD: imx6_dwhdmi.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2020 Genetec Corporation. All rights reserved. * Written by Hashimoto Kenichi for Genetec Corporation. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: imx6_dwhdmi.c,v 1.1 2020/12/23 14:42:38 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: imx6_dwhdmi.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -63,10 +63,10 @@ enum { DWHDMI_PORT_OUTPUT = 1, }; -static const char * const compatible[] = { - "fsl,imx6dl-hdmi", - "fsl,imx6q-hdmi", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "fsl,imx6dl-hdmi" }, + { .compat = "fsl,imx6q-hdmi" }, + DEVICE_COMPAT_EOL }; struct imx6_dwhdmi_softc { @@ -214,7 +214,7 @@ imx6_dwhdmi_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/nxp/imx6_gpc.c b/sys/arch/arm/nxp/imx6_gpc.c index 6be8502ddef8..e36c1530b635 100644 --- a/sys/arch/arm/nxp/imx6_gpc.c +++ b/sys/arch/arm/nxp/imx6_gpc.c @@ -1,4 +1,4 @@ -/* $NetBSD: imx6_gpc.c,v 1.2 2021/01/15 00:38:22 jmcneill Exp $ */ +/* $NetBSD: imx6_gpc.c,v 1.3 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2019 Genetec Corporation. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: imx6_gpc.c,v 1.2 2021/01/15 00:38:22 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: imx6_gpc.c,v 1.3 2021/01/27 03:10:20 thorpej Exp $"); #include "opt_fdt.h" @@ -64,13 +64,17 @@ struct fdtbus_interrupt_controller_func imxgpc_funcs = { CFATTACH_DECL_NEW(imxgpc, sizeof(struct imxgpc_softc), imxgpc_match, imxgpc_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "fsl,imx6q-gpc" }, + DEVICE_COMPAT_EOL +}; + static int imxgpc_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { "fsl,imx6q-gpc", NULL }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/nxp/imx6_iomux.c b/sys/arch/arm/nxp/imx6_iomux.c index 502bfaef873f..d0a73da887ab 100644 --- a/sys/arch/arm/nxp/imx6_iomux.c +++ b/sys/arch/arm/nxp/imx6_iomux.c @@ -1,4 +1,4 @@ -/* $NetBSD: imx6_iomux.c,v 1.1 2020/12/23 14:42:38 skrll Exp $ */ +/* $NetBSD: imx6_iomux.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2019 Genetec Corporation. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: imx6_iomux.c,v 1.1 2020/12/23 14:42:38 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: imx6_iomux.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $"); #include "opt_fdt.h" @@ -129,18 +129,19 @@ static void imxiomux_attach(device_t, device_t, void *); CFATTACH_DECL_NEW(imxiomux, sizeof(struct imxiomux_softc), imxiomux_match, imxiomux_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "fsl,imx6q-iomuxc" }, + { .compat = "fsl,imx7d-iomuxc" }, + { .compat = "fsl,imx8mq-iomuxc" }, + DEVICE_COMPAT_EOL +}; + static int imxiomux_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "fsl,imx6q-iomuxc", - "fsl,imx7d-iomuxc", - "fsl,imx8mq-iomuxc", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/nxp/imx6_ocotp.c b/sys/arch/arm/nxp/imx6_ocotp.c index 2ffe83f80f7c..ea4755d612b5 100644 --- a/sys/arch/arm/nxp/imx6_ocotp.c +++ b/sys/arch/arm/nxp/imx6_ocotp.c @@ -1,4 +1,4 @@ -/* $NetBSD: imx6_ocotp.c,v 1.1 2020/12/23 14:42:38 skrll Exp $ */ +/* $NetBSD: imx6_ocotp.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $ */ /* * Copyright (c) 2014 Ryo Shimizu @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: imx6_ocotp.c,v 1.1 2020/12/23 14:42:38 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: imx6_ocotp.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -62,24 +62,25 @@ static void imxocotp_attach(device_t, device_t, void *); CFATTACH_DECL_NEW(imxocotp, sizeof(struct imxocotp_softc), imxocotp_match, imxocotp_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "fsl,imx6q-ocotp" }, + { .compat = "fsl,imx6sl-ocotp" }, + { .compat = "fsl,imx6sll-ocotp" }, + { .compat = "fsl,imx6sx-ocotp" }, + { .compat = "fsl,imx6ul-ocotp" }, + { .compat = "fsl,imx6ull-ocotp" }, + DEVICE_COMPAT_EOL +}; + int imxocotp_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "fsl,imx6q-ocotp", - "fsl,imx6sl-ocotp", - "fsl,imx6sll-ocotp", - "fsl,imx6sx-ocotp", - "fsl,imx6ul-ocotp", - "fsl,imx6ull-ocotp", - NULL - }; struct fdt_attach_args * const faa = aux; if (ocotp_softc != NULL) return 0; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } /* ARGSUSED */ diff --git a/sys/arch/arm/nxp/imx6_pcie.c b/sys/arch/arm/nxp/imx6_pcie.c index 034ccf887b4f..42a6774bb1c8 100644 --- a/sys/arch/arm/nxp/imx6_pcie.c +++ b/sys/arch/arm/nxp/imx6_pcie.c @@ -1,4 +1,4 @@ -/* $NetBSD: imx6_pcie.c,v 1.5 2021/01/27 02:14:49 thorpej Exp $ */ +/* $NetBSD: imx6_pcie.c,v 1.6 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2019 Genetec Corporation. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: imx6_pcie.c,v 1.5 2021/01/27 02:14:49 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: imx6_pcie.c,v 1.6 2021/01/27 03:10:20 thorpej Exp $"); #include "opt_pci.h" #include "opt_fdt.h" @@ -100,7 +100,7 @@ imx6_pcie_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -127,7 +127,7 @@ imx6_pcie_attach(device_t parent, device_t self, void *aux) sc->sc_gpr_write = imx6_pcie_gpr_write; sc->sc_reset = imx6_pcie_reset; sc->sc_have_sw_reset = - (bool)of_search_compatible(phandle, compat_data)->value; + (bool)of_compatible_lookup(phandle, compat_data)->value; if (fdtbus_get_reg_byname(phandle, "dbi", &addr, &size) != 0) { aprint_error(": couldn't get registers\n"); diff --git a/sys/arch/arm/nxp/imx6_platform.c b/sys/arch/arm/nxp/imx6_platform.c index eda7797391db..a2f8029ba4b2 100644 --- a/sys/arch/arm/nxp/imx6_platform.c +++ b/sys/arch/arm/nxp/imx6_platform.c @@ -1,4 +1,4 @@ -/* $NetBSD: imx6_platform.c,v 1.1 2020/12/23 14:42:38 skrll Exp $ */ +/* $NetBSD: imx6_platform.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2019 Genetec Corporation. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: imx6_platform.c,v 1.1 2020/12/23 14:42:38 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: imx6_platform.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $"); #include "arml2cc.h" #include "opt_console.h" @@ -120,15 +120,15 @@ imx_platform_device_register(device_t self, void *aux) prop_dictionary_t prop = device_properties(self); if (device_is_a(self, "atphy")) { - const char * compat[] = { - "fsl,imx6dl-sabresd", - "fsl,imx6q-sabresd", - "fsl,imx6qp-sabresd", - "solidrun,hummingboard2/q", - "solidrun,hummingboard2/dl", - NULL + static const struct device_compatible_entry compat_data[] = { + { .compat = "fsl,imx6dl-sabresd" }, + { .compat = "fsl,imx6q-sabresd" }, + { .compat = "fsl,imx6qp-sabresd" }, + { .compat = "solidrun,hummingboard2/q" }, + { .compat = "solidrun,hummingboard2/dl" }, + DEVICE_COMPAT_EOL }; - if (of_match_compatible(OF_finddevice("/"), compat)) + if (of_compatible_match(OF_finddevice("/"), compat_data)) prop_dictionary_set_uint32(prop, "clk_25m", 125000000); } } diff --git a/sys/arch/arm/nxp/imx6_pwm.c b/sys/arch/arm/nxp/imx6_pwm.c index 2f66b3b48a0e..1498e453bbc5 100644 --- a/sys/arch/arm/nxp/imx6_pwm.c +++ b/sys/arch/arm/nxp/imx6_pwm.c @@ -1,4 +1,4 @@ -/* $NetBSD: imx6_pwm.c,v 1.2 2021/01/15 23:58:18 jmcneill Exp $ */ +/* $NetBSD: imx6_pwm.c,v 1.3 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2019 Genetec Corporation. All rights reserved. * Written by Hashimoto Kenichi for Genetec Corporation. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: imx6_pwm.c,v 1.2 2021/01/15 23:58:18 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: imx6_pwm.c,v 1.3 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -75,13 +75,17 @@ static struct fdtbus_pwm_controller_func imxpwm_funcs = { .get_tag = imxpwm_get_tag }; +static const struct device_compatible_entry compat_data[] = { + { .compat = "fsl,imx6q-pwm" }, + DEVICE_COMPAT_EOL +}; + static int imx6_pwm_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { "fsl,imx6q-pwm", NULL }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } void diff --git a/sys/arch/arm/nxp/imx6_spi.c b/sys/arch/arm/nxp/imx6_spi.c index 80ef68308621..978df440d8a8 100644 --- a/sys/arch/arm/nxp/imx6_spi.c +++ b/sys/arch/arm/nxp/imx6_spi.c @@ -1,4 +1,4 @@ -/* $NetBSD: imx6_spi.c,v 1.6 2021/01/27 02:14:49 thorpej Exp $ */ +/* $NetBSD: imx6_spi.c,v 1.7 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2019 Genetec Corporation. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: imx6_spi.c,v 1.6 2021/01/27 02:14:49 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: imx6_spi.c,v 1.7 2021/01/27 03:10:20 thorpej Exp $"); #include "opt_imxspi.h" @@ -89,7 +89,7 @@ imxspi_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } void @@ -139,7 +139,7 @@ imxspi_attach(device_t parent, device_t self, void *aux) sc->sc_iot = faa->faa_bst; const struct imx_spi_config *config = - of_search_compatible(phandle, compat_data)->data; + of_compatible_lookup(phandle, compat_data)->data; sc->sc_enhanced = config->enhanced; sc->sc_type = config->type; diff --git a/sys/arch/arm/nxp/imx6_usb.c b/sys/arch/arm/nxp/imx6_usb.c index 268418d735b5..75f1d435f443 100644 --- a/sys/arch/arm/nxp/imx6_usb.c +++ b/sys/arch/arm/nxp/imx6_usb.c @@ -1,4 +1,4 @@ -/* $NetBSD: imx6_usb.c,v 1.2 2021/01/15 23:58:18 jmcneill Exp $ */ +/* $NetBSD: imx6_usb.c,v 1.3 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2019 Genetec Corporation. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: imx6_usb.c,v 1.2 2021/01/15 23:58:18 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: imx6_usb.c,v 1.3 2021/01/27 03:10:20 thorpej Exp $"); #include "opt_fdt.h" @@ -73,10 +73,10 @@ static void *imx6_usb_intr_establish(struct imxehci_softc *); CFATTACH_DECL_NEW(imxusbc_fdt, sizeof(struct imxusbc_fdt_softc), imx6_usb_match, imx6_usb_attach, NULL, NULL); -static const char * const compatible[] = { - "fsl,imx6q-usb", - "fsl,imx7d-usb", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "fsl,imx6q-usb" }, + { .compat = "fsl,imx7d-usb" }, + DEVICE_COMPAT_EOL }; static int @@ -84,7 +84,7 @@ imx6_usb_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/nxp/imx6_usbphy.c b/sys/arch/arm/nxp/imx6_usbphy.c index 0ef9e33f9433..3081ba8adce0 100644 --- a/sys/arch/arm/nxp/imx6_usbphy.c +++ b/sys/arch/arm/nxp/imx6_usbphy.c @@ -1,4 +1,4 @@ -/* $NetBSD: imx6_usbphy.c,v 1.1 2020/12/23 14:42:38 skrll Exp $ */ +/* $NetBSD: imx6_usbphy.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2019 Genetec Corporation. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(1, "$NetBSD: imx6_usbphy.c,v 1.1 2020/12/23 14:42:38 skrll Exp $"); +__KERNEL_RCSID(1, "$NetBSD: imx6_usbphy.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $"); #include "opt_fdt.h" @@ -61,9 +61,9 @@ static int imx6_usbphy_enable(device_t, void *, bool); CFATTACH_DECL_NEW(imxusbphy, sizeof(struct imx6_usbphy_softc), imx6_usbphy_match, imx6_usbphy_attach, NULL, NULL); -static const char * const compatible[] = { - "fsl,imx6q-usbphy", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "fsl,imx6q-usbphy" }, + DEVICE_COMPAT_EOL }; static int @@ -71,7 +71,7 @@ imx6_usbphy_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/nxp/imx7_gpc.c b/sys/arch/arm/nxp/imx7_gpc.c index b25903d2bfcc..7f3848f97f6a 100644 --- a/sys/arch/arm/nxp/imx7_gpc.c +++ b/sys/arch/arm/nxp/imx7_gpc.c @@ -1,4 +1,4 @@ -/* $NetBSD: imx7_gpc.c,v 1.2 2021/01/15 00:38:22 jmcneill Exp $ */ +/* $NetBSD: imx7_gpc.c,v 1.3 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2019 Genetec Corporation. All rights reserved. * Written by Hashimoto Kenichi for Genetec Corporation. @@ -25,7 +25,7 @@ * SUCH DAMAGE. */ #include -__KERNEL_RCSID(0, "$NetBSD: imx7_gpc.c,v 1.2 2021/01/15 00:38:22 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: imx7_gpc.c,v 1.3 2021/01/27 03:10:20 thorpej Exp $"); #include "opt_fdt.h" @@ -91,17 +91,18 @@ struct fdtbus_interrupt_controller_func imx7gpc_funcs = { CFATTACH_DECL_NEW(imx7gpc, sizeof(struct imx7gpc_softc), imx7gpc_match, imx7gpc_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "fsl,imx7d-gpc" }, + { .compat = "fsl,imx8mq-gpc" }, + DEVICE_COMPAT_EOL +}; + static int imx7gpc_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "fsl,imx7d-gpc", - "fsl,imx8mq-gpc", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/nxp/imx7d_ccm.c b/sys/arch/arm/nxp/imx7d_ccm.c index 403ac1151774..61efc5bd615e 100644 --- a/sys/arch/arm/nxp/imx7d_ccm.c +++ b/sys/arch/arm/nxp/imx7d_ccm.c @@ -1,4 +1,4 @@ -/* $NetBSD: imx7d_ccm.c,v 1.1 2020/12/23 14:42:38 skrll Exp $ */ +/* $NetBSD: imx7d_ccm.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2020 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: imx7d_ccm.c,v 1.1 2020/12/23 14:42:38 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: imx7d_ccm.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -43,14 +43,14 @@ __KERNEL_RCSID(0, "$NetBSD: imx7d_ccm.c,v 1.1 2020/12/23 14:42:38 skrll Exp $"); static int imx7d_ccm_match(device_t, cfdata_t, void *); static void imx7d_ccm_attach(device_t, device_t, void *); -static const char * const compatible[] = { - "fsl,imx7d-ccm", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "fsl,imx7d-ccm" }, + DEVICE_COMPAT_EOL }; -static const char * const anatop_compatible[] = { - "fsl,imx7d-anatop", - NULL +static const struct device_compatible_entry anatop_compat_data[] = { + { .compat = "fsl,imx7d-anatop" }, + DEVICE_COMPAT_EOL }; static const char *pll_bypass_p[] = { @@ -280,7 +280,7 @@ imx7d_ccm_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -301,7 +301,7 @@ imx7d_ccm_attach(device_t parent, device_t self, void *aux) sc->sc_nclks = __arraycount(imx7d_ccm_clks); for (child = OF_child(OF_parent(phandle)); child; child = OF_peer(child)) { - if (of_match_compatible(child, anatop_compatible) > 0) { + if (of_compatible_match(child, anatop_compat_data)) { anatop = child; break; } diff --git a/sys/arch/arm/nxp/imx8mq_ccm.c b/sys/arch/arm/nxp/imx8mq_ccm.c index 3a8b92e6a0ed..d47d360e355f 100644 --- a/sys/arch/arm/nxp/imx8mq_ccm.c +++ b/sys/arch/arm/nxp/imx8mq_ccm.c @@ -1,4 +1,4 @@ -/* $NetBSD: imx8mq_ccm.c,v 1.1 2020/12/23 14:42:38 skrll Exp $ */ +/* $NetBSD: imx8mq_ccm.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2020 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: imx8mq_ccm.c,v 1.1 2020/12/23 14:42:38 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: imx8mq_ccm.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -43,9 +43,9 @@ __KERNEL_RCSID(0, "$NetBSD: imx8mq_ccm.c,v 1.1 2020/12/23 14:42:38 skrll Exp $") static int imx8mq_ccm_match(device_t, cfdata_t, void *); static void imx8mq_ccm_attach(device_t, device_t, void *); -static const char * const compatible[] = { - "fsl,imx8mq-ccm", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "fsl,imx8mq-ccm" }, + DEVICE_COMPAT_EOL }; static const char *uart_p[] = { @@ -181,7 +181,7 @@ imx8mq_ccm_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/nxp/imx8mq_usbphy.c b/sys/arch/arm/nxp/imx8mq_usbphy.c index 2fb345fd1c2c..2127c32a6f70 100644 --- a/sys/arch/arm/nxp/imx8mq_usbphy.c +++ b/sys/arch/arm/nxp/imx8mq_usbphy.c @@ -1,4 +1,4 @@ -/* $NetBSD: imx8mq_usbphy.c,v 1.4 2021/01/27 02:14:49 thorpej Exp $ */ +/* $NetBSD: imx8mq_usbphy.c,v 1.5 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2020 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: imx8mq_usbphy.c,v 1.4 2021/01/27 02:14:49 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: imx8mq_usbphy.c,v 1.5 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -145,7 +145,7 @@ imx8mq_usbphy_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/nxp/imx_ahcisata.c b/sys/arch/arm/nxp/imx_ahcisata.c index e5978020cd15..eff6e7c32288 100644 --- a/sys/arch/arm/nxp/imx_ahcisata.c +++ b/sys/arch/arm/nxp/imx_ahcisata.c @@ -1,4 +1,4 @@ -/* $NetBSD: imx_ahcisata.c,v 1.2 2021/01/15 23:58:18 jmcneill Exp $ */ +/* $NetBSD: imx_ahcisata.c,v 1.3 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2019 Genetec Corporation. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: imx_ahcisata.c,v 1.2 2021/01/15 23:58:18 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: imx_ahcisata.c,v 1.3 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -79,13 +79,17 @@ static int imx_ahcisata_init_clocks(struct imx_ahcisata_softc *); CFATTACH_DECL_NEW(imx_ahcisata, sizeof(struct imx_ahcisata_softc), imx_ahcisata_match, imx_ahcisata_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "fsl,imx6q-ahci" }, + DEVICE_COMPAT_EOL +}; + static int imx_ahcisata_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { "fsl,imx6q-ahci", NULL }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/nxp/imx_com.c b/sys/arch/arm/nxp/imx_com.c index 991335354f6a..eba3b28748c5 100644 --- a/sys/arch/arm/nxp/imx_com.c +++ b/sys/arch/arm/nxp/imx_com.c @@ -1,4 +1,4 @@ -/* $NetBSD: imx_com.c,v 1.2 2021/01/15 23:58:18 jmcneill Exp $ */ +/* $NetBSD: imx_com.c,v 1.3 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2019 Genetec Corporation. All rights reserved. * Written by Hashimoto Kenichi for Genetec Corporation. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: imx_com.c,v 1.2 2021/01/15 23:58:18 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: imx_com.c,v 1.3 2021/01/27 03:10:20 thorpej Exp $"); #include "opt_fdt.h" #include "opt_imxuart.h" @@ -46,9 +46,9 @@ static void imx_com_attach(device_t, device_t, void *); CFATTACH_DECL_NEW(imx_com, sizeof(struct imxuart_softc), imx_com_match, imx_com_attach, NULL, NULL); -static const char * const compatible[] = { - "fsl,imx6q-uart", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "fsl,imx6q-uart" }, + DEVICE_COMPAT_EOL }; static int @@ -56,7 +56,7 @@ imx_com_match(device_t parent, struct cfdata *cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -134,7 +134,7 @@ imx_com_attach(device_t parent, device_t self, void *aux) static int imx_com_console_match(int phandle) { - return of_match_compatible(phandle, compatible); + return of_compatible_match(phandle, compat_data); } static void diff --git a/sys/arch/arm/nxp/imx_gpio.c b/sys/arch/arm/nxp/imx_gpio.c index 19f68146729c..d45dd10a7e11 100644 --- a/sys/arch/arm/nxp/imx_gpio.c +++ b/sys/arch/arm/nxp/imx_gpio.c @@ -1,4 +1,4 @@ -/* $NetBSD: imx_gpio.c,v 1.3 2021/01/15 23:58:18 jmcneill Exp $ */ +/* $NetBSD: imx_gpio.c,v 1.4 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2019 Genetec Corporation. All rights reserved. * Written by Hashimoto Kenichi for Genetec Corporation. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: imx_gpio.c,v 1.3 2021/01/15 23:58:18 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: imx_gpio.c,v 1.4 2021/01/27 03:10:20 thorpej Exp $"); #include "opt_fdt.h" #include "gpio.h" @@ -77,16 +77,17 @@ static struct fdtbus_gpio_controller_func imx6_gpio_funcs = { const int imxgpio_ngroups = GPIO_NGROUPS; +static const struct device_compatible_entry compat_data[] = { + { .compat = "fsl,imx35-gpio" }, + DEVICE_COMPAT_EOL +}; + int imxgpio_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "fsl,imx35-gpio", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } void diff --git a/sys/arch/arm/nxp/imx_i2c.c b/sys/arch/arm/nxp/imx_i2c.c index 38b81898da16..1b5d1f97a3e6 100644 --- a/sys/arch/arm/nxp/imx_i2c.c +++ b/sys/arch/arm/nxp/imx_i2c.c @@ -1,4 +1,4 @@ -/* $NetBSD: imx_i2c.c,v 1.1 2020/12/23 14:42:38 skrll Exp $ */ +/* $NetBSD: imx_i2c.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2019 Genetec Corporation. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: imx_i2c.c,v 1.1 2020/12/23 14:42:38 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: imx_i2c.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $"); #include @@ -35,13 +35,17 @@ __KERNEL_RCSID(0, "$NetBSD: imx_i2c.c,v 1.1 2020/12/23 14:42:38 skrll Exp $"); #include +static const struct device_compatible_entry compat_data[] = { + { .compat = "fsl,imx21-i2c" }, + DEVICE_COMPAT_EOL +}; + int imxi2c_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { "fsl,imx21-i2c", NULL }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } void diff --git a/sys/arch/arm/nxp/imx_sdhc.c b/sys/arch/arm/nxp/imx_sdhc.c index 48c21a2ed555..8577dfd3d71e 100644 --- a/sys/arch/arm/nxp/imx_sdhc.c +++ b/sys/arch/arm/nxp/imx_sdhc.c @@ -1,4 +1,4 @@ -/* $NetBSD: imx_sdhc.c,v 1.5 2021/01/27 02:14:49 thorpej Exp $ */ +/* $NetBSD: imx_sdhc.c,v 1.6 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2019 Genetec Corporation. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: imx_sdhc.c,v 1.5 2021/01/27 02:14:49 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: imx_sdhc.c,v 1.6 2021/01/27 03:10:20 thorpej Exp $"); #include "opt_fdt.h" @@ -95,7 +95,7 @@ imx_sdhc_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -129,7 +129,7 @@ imx_sdhc_attach(device_t parent, device_t self, void *aux) sc->sc_vmmc_supply = fdtbus_regulator_acquire(phandle, "vmmc-supply"); - conf = of_search_compatible(phandle, compat_data)->data; + conf = of_compatible_lookup(phandle, compat_data)->data; sc->sc_sdhc.sc_dev = self; sc->sc_sdhc.sc_dmat = faa->faa_dmat; diff --git a/sys/arch/arm/nxp/imx_snvs.c b/sys/arch/arm/nxp/imx_snvs.c index c7a62be50987..967352f38127 100644 --- a/sys/arch/arm/nxp/imx_snvs.c +++ b/sys/arch/arm/nxp/imx_snvs.c @@ -1,4 +1,4 @@ -/* $NetBSD: imx_snvs.c,v 1.1 2020/12/23 14:42:38 skrll Exp $ */ +/* $NetBSD: imx_snvs.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $ */ /* * Copyright (c) 2014 Ryo Shimizu @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: imx_snvs.c,v 1.1 2020/12/23 14:42:38 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: imx_snvs.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -41,16 +41,17 @@ __KERNEL_RCSID(0, "$NetBSD: imx_snvs.c,v 1.1 2020/12/23 14:42:38 skrll Exp $"); #include +static const struct device_compatible_entry compat_data[] = { + { .compat = "fsl,sec-v4.0-mon" }, + DEVICE_COMPAT_EOL +}; + int imxsnvs_match(device_t parent, struct cfdata *match, void *aux) { - const char * const compatible[] = { - "fsl,sec-v4.0-mon", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } void diff --git a/sys/arch/arm/nxp/imxwdog.c b/sys/arch/arm/nxp/imxwdog.c index 6f320b02b02c..64dbcfe5454f 100644 --- a/sys/arch/arm/nxp/imxwdog.c +++ b/sys/arch/arm/nxp/imxwdog.c @@ -1,4 +1,4 @@ -/* $NetBSD: imxwdog.c,v 1.2 2021/01/15 23:58:18 jmcneill Exp $ */ +/* $NetBSD: imxwdog.c,v 1.3 2021/01/27 03:10:20 thorpej Exp $ */ /* * Copyright (c) 2010 Genetec Corporation. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: imxwdog.c,v 1.2 2021/01/15 23:58:18 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: imxwdog.c,v 1.3 2021/01/27 03:10:20 thorpej Exp $"); #include "opt_imx.h" @@ -65,17 +65,18 @@ void imxwdog_attach(device_t, device_t, void *); CFATTACH_DECL_NEW(imxwdog, sizeof(struct imxwdog_softc), imxwdog_match, imxwdog_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "fsl,imx21-wdt" }, + { .compat = "fsl,imx6q-wdt" }, + DEVICE_COMPAT_EOL +}; + int imxwdog_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "fsl,imx21-wdt", - "fsl,imx6q-wdt", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } diff --git a/sys/arch/arm/rockchip/rk3328_cru.c b/sys/arch/arm/rockchip/rk3328_cru.c index b2240ecf6388..0bee95034f94 100644 --- a/sys/arch/arm/rockchip/rk3328_cru.c +++ b/sys/arch/arm/rockchip/rk3328_cru.c @@ -1,4 +1,4 @@ -/* $NetBSD: rk3328_cru.c,v 1.6 2020/12/31 20:47:06 mrg Exp $ */ +/* $NetBSD: rk3328_cru.c,v 1.7 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2018 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: rk3328_cru.c,v 1.6 2020/12/31 20:47:06 mrg Exp $"); +__KERNEL_RCSID(1, "$NetBSD: rk3328_cru.c,v 1.7 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -52,9 +52,9 @@ __KERNEL_RCSID(1, "$NetBSD: rk3328_cru.c,v 1.6 2020/12/31 20:47:06 mrg Exp $"); static int rk3328_cru_match(device_t, cfdata_t, void *); static void rk3328_cru_attach(device_t, device_t, void *); -static const char * const compatible[] = { - "rockchip,rk3328-cru", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "rockchip,rk3328-cru" }, + DEVICE_COMPAT_EOL }; CFATTACH_DECL_NEW(rk3328_cru, sizeof(struct rk_cru_softc), @@ -469,7 +469,7 @@ rk3328_cru_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/rockchip/rk3328_iomux.c b/sys/arch/arm/rockchip/rk3328_iomux.c index 9f54590deb0e..d1f92b2771d5 100644 --- a/sys/arch/arm/rockchip/rk3328_iomux.c +++ b/sys/arch/arm/rockchip/rk3328_iomux.c @@ -1,4 +1,4 @@ -/* $NetBSD: rk3328_iomux.c,v 1.5 2021/01/25 14:20:38 thorpej Exp $ */ +/* $NetBSD: rk3328_iomux.c,v 1.6 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2018 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rk3328_iomux.c,v 1.5 2021/01/25 14:20:38 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rk3328_iomux.c,v 1.6 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -116,7 +116,7 @@ static const struct rk3328_iomux_conf rk3328_iomux_conf = { static const struct device_compatible_entry compat_data[] = { { .compat = "rockchip,rk3328-pinctrl", .data = &rk3328_iomux_conf }, - { } + DEVICE_COMPAT_EOL }; struct rk3328_iomux_softc { @@ -278,7 +278,7 @@ rk3328_iomux_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -295,7 +295,7 @@ rk3328_iomux_attach(device_t parent, device_t self, void *aux) aprint_error(": couldn't acquire grf syscon\n"); return; } - sc->sc_conf = of_search_compatible(phandle, compat_data)->data; + sc->sc_conf = of_compatible_lookup(phandle, compat_data)->data; aprint_naive("\n"); aprint_normal(": RK3328 IOMUX control\n"); diff --git a/sys/arch/arm/rockchip/rk3399_cru.c b/sys/arch/arm/rockchip/rk3399_cru.c index 98803afad304..6bf50c5c8492 100644 --- a/sys/arch/arm/rockchip/rk3399_cru.c +++ b/sys/arch/arm/rockchip/rk3399_cru.c @@ -1,4 +1,4 @@ -/* $NetBSD: rk3399_cru.c,v 1.20 2020/05/17 19:57:25 riastradh Exp $ */ +/* $NetBSD: rk3399_cru.c,v 1.21 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2018 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: rk3399_cru.c,v 1.20 2020/05/17 19:57:25 riastradh Exp $"); +__KERNEL_RCSID(1, "$NetBSD: rk3399_cru.c,v 1.21 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -48,9 +48,9 @@ __KERNEL_RCSID(1, "$NetBSD: rk3399_cru.c,v 1.20 2020/05/17 19:57:25 riastradh Ex static int rk3399_cru_match(device_t, cfdata_t, void *); static void rk3399_cru_attach(device_t, device_t, void *); -static const char * const compatible[] = { - "rockchip,rk3399-cru", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "rockchip,rk3399-cru" }, + DEVICE_COMPAT_EOL }; CFATTACH_DECL_NEW(rk3399_cru, sizeof(struct rk_cru_softc), @@ -1105,7 +1105,7 @@ rk3399_cru_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/rockchip/rk3399_iomux.c b/sys/arch/arm/rockchip/rk3399_iomux.c index 0d101298cd2f..f126a9873093 100644 --- a/sys/arch/arm/rockchip/rk3399_iomux.c +++ b/sys/arch/arm/rockchip/rk3399_iomux.c @@ -1,4 +1,4 @@ -/* $NetBSD: rk3399_iomux.c,v 1.9 2021/01/27 02:00:02 thorpej Exp $ */ +/* $NetBSD: rk3399_iomux.c,v 1.10 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2018 Jared McNeill @@ -29,7 +29,7 @@ //#define RK3399_IOMUX_DEBUG #include -__KERNEL_RCSID(0, "$NetBSD: rk3399_iomux.c,v 1.9 2021/01/27 02:00:02 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rk3399_iomux.c,v 1.10 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -447,7 +447,7 @@ rk3399_iomux_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } #ifdef RK3399_IOMUX_FORCE_ENABLE_SWJ_DP @@ -499,7 +499,7 @@ rk3399_iomux_attach(device_t parent, device_t self, void *aux) aprint_error(": couldn't acquire pmu syscon\n"); return; } - sc->sc_conf = of_search_compatible(phandle, compat_data)->data; + sc->sc_conf = of_compatible_lookup(phandle, compat_data)->data; aprint_naive("\n"); aprint_normal(": RK3399 IOMUX control\n"); diff --git a/sys/arch/arm/rockchip/rk3399_pcie.c b/sys/arch/arm/rockchip/rk3399_pcie.c index 571df44f11b2..2d9d0ebd5bc0 100644 --- a/sys/arch/arm/rockchip/rk3399_pcie.c +++ b/sys/arch/arm/rockchip/rk3399_pcie.c @@ -1,4 +1,4 @@ -/* $NetBSD: rk3399_pcie.c,v 1.14 2021/01/15 22:59:50 jmcneill Exp $ */ +/* $NetBSD: rk3399_pcie.c,v 1.15 2021/01/27 03:10:19 thorpej Exp $ */ /* * Copyright (c) 2018 Mark Kettenis * @@ -17,7 +17,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: rk3399_pcie.c,v 1.14 2021/01/15 22:59:50 jmcneill Exp $"); +__KERNEL_RCSID(1, "$NetBSD: rk3399_pcie.c,v 1.15 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -143,16 +143,17 @@ static void rkpcie_attach(device_t, device_t, void *); CFATTACH_DECL_NEW(rkpcie, sizeof(struct rkpcie_softc), rkpcie_match, rkpcie_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "rockchip,rk3399-pcie" }, + DEVICE_COMPAT_EOL +}; + static int rkpcie_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "rockchip,rk3399-pcie", - NULL - }; struct fdt_attach_args *faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void rkpcie_atr_init(struct rkpcie_softc *); diff --git a/sys/arch/arm/rockchip/rk3399_pcie_phy.c b/sys/arch/arm/rockchip/rk3399_pcie_phy.c index 68a2398ee632..17e3959bdb61 100644 --- a/sys/arch/arm/rockchip/rk3399_pcie_phy.c +++ b/sys/arch/arm/rockchip/rk3399_pcie_phy.c @@ -1,4 +1,4 @@ -/* $NetBSD: rk3399_pcie_phy.c,v 1.3 2020/11/17 18:01:09 ryo Exp $ */ +/* $NetBSD: rk3399_pcie_phy.c,v 1.4 2021/01/27 03:10:19 thorpej Exp $ */ /* $OpenBSD: rkpcie.c,v 1.6 2018/08/28 09:33:18 jsg Exp $ */ /* * Copyright (c) 2018 Mark Kettenis @@ -18,7 +18,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: rk3399_pcie_phy.c,v 1.3 2020/11/17 18:01:09 ryo Exp $"); +__KERNEL_RCSID(1, "$NetBSD: rk3399_pcie_phy.c,v 1.4 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -47,9 +47,9 @@ static void rkpciephy_attach(device_t, device_t, void *); CFATTACH_DECL_NEW(rkpciephy, sizeof(struct rkpciephy_softc), rkpciephy_match, rkpciephy_attach, NULL, NULL); -static const char * const compatible[] = { - "rockchip,rk3399-pcie-phy", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "rockchip,rk3399-pcie-phy" }, + DEVICE_COMPAT_EOL }; static int @@ -57,7 +57,7 @@ rkpciephy_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args *faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void rkpcie_phy_poweron(struct rkpciephy_softc *, u_int); diff --git a/sys/arch/arm/rockchip/rk3399_pmucru.c b/sys/arch/arm/rockchip/rk3399_pmucru.c index ec14c90463d5..2d274a3c0024 100644 --- a/sys/arch/arm/rockchip/rk3399_pmucru.c +++ b/sys/arch/arm/rockchip/rk3399_pmucru.c @@ -1,4 +1,4 @@ -/* $NetBSD: rk3399_pmucru.c,v 1.3 2019/05/01 10:41:33 jmcneill Exp $ */ +/* $NetBSD: rk3399_pmucru.c,v 1.4 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2018 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: rk3399_pmucru.c,v 1.3 2019/05/01 10:41:33 jmcneill Exp $"); +__KERNEL_RCSID(1, "$NetBSD: rk3399_pmucru.c,v 1.4 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -48,9 +48,9 @@ __KERNEL_RCSID(1, "$NetBSD: rk3399_pmucru.c,v 1.3 2019/05/01 10:41:33 jmcneill E static int rk3399_pmucru_match(device_t, cfdata_t, void *); static void rk3399_pmucru_attach(device_t, device_t, void *); -static const char * const compatible[] = { - "rockchip,rk3399-pmucru", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "rockchip,rk3399-pmucru" }, + DEVICE_COMPAT_EOL }; CFATTACH_DECL_NEW(rk3399_pmucru, sizeof(struct rk_cru_softc), @@ -328,7 +328,7 @@ rk3399_pmucru_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/rockchip/rk_anxdp.c b/sys/arch/arm/rockchip/rk_anxdp.c index dc34cb1ed65c..49cd9318e82e 100644 --- a/sys/arch/arm/rockchip/rk_anxdp.c +++ b/sys/arch/arm/rockchip/rk_anxdp.c @@ -1,4 +1,4 @@ -/* $NetBSD: rk_anxdp.c,v 1.2 2020/01/04 12:08:32 jmcneill Exp $ */ +/* $NetBSD: rk_anxdp.c,v 1.3 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2019 Jonathan A. Kollasch @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rk_anxdp.c,v 1.2 2020/01/04 12:08:32 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rk_anxdp.c,v 1.3 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -54,9 +54,9 @@ enum { ANXDP_PORT_OUTPUT = 1, }; -static const char * const compatible[] = { - "rockchip,rk3399-edp", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "rockchip,rk3399-edp" }, + DEVICE_COMPAT_EOL }; struct rk_anxdp_softc { @@ -232,7 +232,7 @@ rk_anxdp_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/rockchip/rk_drm.c b/sys/arch/arm/rockchip/rk_drm.c index 395d8f14983c..0f19cf61e3f9 100644 --- a/sys/arch/arm/rockchip/rk_drm.c +++ b/sys/arch/arm/rockchip/rk_drm.c @@ -1,4 +1,4 @@ -/* $NetBSD: rk_drm.c,v 1.3 2019/12/15 01:00:58 mrg Exp $ */ +/* $NetBSD: rk_drm.c,v 1.4 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rk_drm.c,v 1.3 2019/12/15 01:00:58 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rk_drm.c,v 1.4 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -56,9 +56,9 @@ __KERNEL_RCSID(0, "$NetBSD: rk_drm.c,v 1.3 2019/12/15 01:00:58 mrg Exp $"); static TAILQ_HEAD(, rk_drm_ports) rk_drm_ports = TAILQ_HEAD_INITIALIZER(rk_drm_ports); -static const char * const compatible[] = { - "rockchip,display-subsystem", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "rockchip,display-subsystem" }, + DEVICE_COMPAT_EOL }; static const char * fb_compatible[] = { @@ -117,7 +117,7 @@ rk_drm_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/rockchip/rk_dwhdmi.c b/sys/arch/arm/rockchip/rk_dwhdmi.c index ce36c5af6c9c..016970f9ec98 100644 --- a/sys/arch/arm/rockchip/rk_dwhdmi.c +++ b/sys/arch/arm/rockchip/rk_dwhdmi.c @@ -1,4 +1,4 @@ -/* $NetBSD: rk_dwhdmi.c,v 1.4 2019/12/17 18:26:36 jakllsch Exp $ */ +/* $NetBSD: rk_dwhdmi.c,v 1.5 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rk_dwhdmi.c,v 1.4 2019/12/17 18:26:36 jakllsch Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rk_dwhdmi.c,v 1.5 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -74,9 +74,9 @@ enum { DWHDMI_PORT_OUTPUT = 1, }; -static const char * const compatible[] = { - "rockchip,rk3399-dw-hdmi", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "rockchip,rk3399-dw-hdmi" }, + DEVICE_COMPAT_EOL }; struct rk_dwhdmi_softc { @@ -265,7 +265,7 @@ rk_dwhdmi_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/rockchip/rk_emmcphy.c b/sys/arch/arm/rockchip/rk_emmcphy.c index 7daec2ad2642..309b8a045959 100644 --- a/sys/arch/arm/rockchip/rk_emmcphy.c +++ b/sys/arch/arm/rockchip/rk_emmcphy.c @@ -1,4 +1,4 @@ -/* $NetBSD: rk_emmcphy.c,v 1.3 2019/03/13 10:28:37 jmcneill Exp $ */ +/* $NetBSD: rk_emmcphy.c,v 1.4 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rk_emmcphy.c,v 1.3 2019/03/13 10:28:37 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rk_emmcphy.c,v 1.4 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -87,9 +87,9 @@ __KERNEL_RCSID(0, "$NetBSD: rk_emmcphy.c,v 1.3 2019/03/13 10:28:37 jmcneill Exp #define PHYCTRL_RTRIM __BITS(4,1) #define PHYCTRL_EXR_NINST __BIT(0) -static const char * const compatible[] = { - "rockchip,rk3399-emmc-phy", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "rockchip,rk3399-emmc-phy" }, + DEVICE_COMPAT_EOL }; struct rk_emmcphy_softc { @@ -229,7 +229,7 @@ rk_emmcphy_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/rockchip/rk_gmac.c b/sys/arch/arm/rockchip/rk_gmac.c index 59dbb65a2fec..a26d51173cf0 100644 --- a/sys/arch/arm/rockchip/rk_gmac.c +++ b/sys/arch/arm/rockchip/rk_gmac.c @@ -1,4 +1,4 @@ -/* $NetBSD: rk_gmac.c,v 1.18 2021/01/25 14:20:38 thorpej Exp $ */ +/* $NetBSD: rk_gmac.c,v 1.19 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2018 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: rk_gmac.c,v 1.18 2021/01/25 14:20:38 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rk_gmac.c,v 1.19 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -61,7 +61,7 @@ enum rk_gmac_type { static const struct device_compatible_entry compat_data[] = { { .compat = "rockchip,rk3328-gmac", .value = GMAC_RK3328 }, { .compat = "rockchip,rk3399-gmac", .value = GMAC_RK3399 }, - { } + DEVICE_COMPAT_EOL }; struct rk_gmac_softc { @@ -337,7 +337,7 @@ rk_gmac_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -363,7 +363,7 @@ rk_gmac_attach(device_t parent, device_t self, void *aux) return; } - rk_sc->sc_type = of_search_compatible(phandle, compat_data)->value; + rk_sc->sc_type = of_compatible_lookup(phandle, compat_data)->value; rk_sc->sc_syscon = fdtbus_syscon_acquire(phandle, "rockchip,grf"); if (rk_sc->sc_syscon == NULL) { diff --git a/sys/arch/arm/rockchip/rk_gpio.c b/sys/arch/arm/rockchip/rk_gpio.c index 31e79190c12a..6ec2909179f9 100644 --- a/sys/arch/arm/rockchip/rk_gpio.c +++ b/sys/arch/arm/rockchip/rk_gpio.c @@ -1,4 +1,4 @@ -/* $NetBSD: rk_gpio.c,v 1.2 2018/06/16 12:49:46 jmcneill Exp $ */ +/* $NetBSD: rk_gpio.c,v 1.3 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2018 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rk_gpio.c,v 1.2 2018/06/16 12:49:46 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rk_gpio.c,v 1.3 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -56,9 +56,9 @@ __KERNEL_RCSID(0, "$NetBSD: rk_gpio.c,v 1.2 2018/06/16 12:49:46 jmcneill Exp $") #define GPIO_EXT_PORTA_REG 0x0050 #define GPIO_LS_SYNC_REG 0x0060 -static const char * const compatible[] = { - "rockchip,gpio-bank", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "rockchip,gpio-bank" }, + DEVICE_COMPAT_EOL }; struct rk_gpio_softc { @@ -285,7 +285,7 @@ rk_gpio_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/rockchip/rk_i2c.c b/sys/arch/arm/rockchip/rk_i2c.c index 71ce6b3e9591..ab09da99560e 100644 --- a/sys/arch/arm/rockchip/rk_i2c.c +++ b/sys/arch/arm/rockchip/rk_i2c.c @@ -1,4 +1,4 @@ -/* $NetBSD: rk_i2c.c,v 1.9 2020/12/23 16:02:11 thorpej Exp $ */ +/* $NetBSD: rk_i2c.c,v 1.10 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2018 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: rk_i2c.c,v 1.9 2020/12/23 16:02:11 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rk_i2c.c,v 1.10 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -100,9 +100,9 @@ __KERNEL_RCSID(0, "$NetBSD: rk_i2c.c,v 1.9 2020/12/23 16:02:11 thorpej Exp $"); #define RKI2C_TXDATA(n) (0x100 + (n) * 4) #define RKI2C_RXDATA(n) (0x200 + (n) * 4) -static const char * const compatible[] = { - "rockchip,rk3399-i2c", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "rockchip,rk3399-i2c" }, + DEVICE_COMPAT_EOL }; struct rk_i2c_softc { @@ -366,7 +366,7 @@ rk_i2c_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/rockchip/rk_i2s.c b/sys/arch/arm/rockchip/rk_i2s.c index f2f43f3cf747..74db4c792dc0 100644 --- a/sys/arch/arm/rockchip/rk_i2s.c +++ b/sys/arch/arm/rockchip/rk_i2s.c @@ -1,4 +1,4 @@ -/* $NetBSD: rk_i2s.c,v 1.9 2021/01/25 14:20:38 thorpej Exp $ */ +/* $NetBSD: rk_i2s.c,v 1.10 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rk_i2s.c,v 1.9 2021/01/25 14:20:38 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rk_i2s.c,v 1.10 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -122,7 +122,7 @@ static const struct device_compatible_entry compat_data[] = { { .compat = "rockchip,rk3188-i2s", }, { .compat = "rockchip,rk3288-i2s", }, { .compat = "rockchip,rk3399-i2s", .data = &rk3399_i2s_config }, - { } + DEVICE_COMPAT_EOL }; struct rk_i2s_softc; @@ -553,7 +553,7 @@ rk_i2s_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -586,7 +586,7 @@ rk_i2s_attach(device_t parent, device_t self, void *aux) mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_NONE); mutex_init(&sc->sc_intr_lock, MUTEX_DEFAULT, IPL_SCHED); - sc->sc_conf = of_search_compatible(phandle, compat_data)->data; + sc->sc_conf = of_compatible_lookup(phandle, compat_data)->data; if (sc->sc_conf != NULL && sc->sc_conf->oe_mask != 0) { sc->sc_grf = fdtbus_syscon_acquire(phandle, "rockchip,grf"); if (sc->sc_grf == NULL) { diff --git a/sys/arch/arm/rockchip/rk_pwm.c b/sys/arch/arm/rockchip/rk_pwm.c index 7cda963b7b2d..39d068ff332b 100644 --- a/sys/arch/arm/rockchip/rk_pwm.c +++ b/sys/arch/arm/rockchip/rk_pwm.c @@ -1,4 +1,4 @@ -/* $NetBSD: rk_pwm.c,v 1.6 2021/01/27 02:00:02 thorpej Exp $ */ +/* $NetBSD: rk_pwm.c,v 1.7 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: rk_pwm.c,v 1.6 2021/01/27 02:00:02 thorpej Exp $"); +__KERNEL_RCSID(1, "$NetBSD: rk_pwm.c,v 1.7 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -198,7 +198,7 @@ rk_pwm_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/rockchip/rk_spi.c b/sys/arch/arm/rockchip/rk_spi.c index b0f5ff5e8c42..9b560c165595 100644 --- a/sys/arch/arm/rockchip/rk_spi.c +++ b/sys/arch/arm/rockchip/rk_spi.c @@ -1,4 +1,4 @@ -/* $NetBSD: rk_spi.c,v 1.5 2021/01/15 18:42:41 ryo Exp $ */ +/* $NetBSD: rk_spi.c,v 1.6 2021/01/27 03:10:19 thorpej Exp $ */ /* * Copyright (c) 2019 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rk_spi.c,v 1.5 2021/01/15 18:42:41 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rk_spi.c,v 1.6 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -143,13 +143,13 @@ __KERNEL_RCSID(0, "$NetBSD: rk_spi.c,v 1.5 2021/01/15 18:42:41 ryo Exp $"); #define SPI_FIFOLEN 32 -static const char * const compatible[] = { +static const struct device_compatible_entry compat_data[] = { #if 0 /* should work on RK3328 but untested */ - "rockchip,rk3066-spi", - "rockchip,rk3328-spi", + { .compat = "rockchip,rk3066-spi" }, + { .compat = "rockchip,rk3328-spi" }, #endif - "rockchip,rk3399-spi", - NULL + { .compat = "rockchip,rk3399-spi" }, + DEVICE_COMPAT_EOL }; struct rk_spi_softc { @@ -204,7 +204,7 @@ rk_spi_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/rockchip/rk_tsadc.c b/sys/arch/arm/rockchip/rk_tsadc.c index c04147dd035d..5d1a06acc1c0 100644 --- a/sys/arch/arm/rockchip/rk_tsadc.c +++ b/sys/arch/arm/rockchip/rk_tsadc.c @@ -1,4 +1,4 @@ -/* $NetBSD: rk_tsadc.c,v 1.11 2021/01/27 02:00:02 thorpej Exp $ */ +/* $NetBSD: rk_tsadc.c,v 1.12 2021/01/27 03:10:19 thorpej Exp $ */ /* * Copyright (c) 2019 Matthew R. Green @@ -30,7 +30,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: rk_tsadc.c,v 1.11 2021/01/27 02:00:02 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rk_tsadc.c,v 1.12 2021/01/27 03:10:19 thorpej Exp $"); /* * Driver for the TSADC temperature sensor monitor in RK3328 and RK3399. @@ -395,7 +395,7 @@ rk_tsadc_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -425,7 +425,7 @@ rk_tsadc_attach(device_t parent, device_t self, void *aux) pmf_device_register(self, NULL, NULL); - sc->sc_rd = of_search_compatible(faa->faa_phandle, compat_data)->data; + sc->sc_rd = of_compatible_lookup(faa->faa_phandle, compat_data)->data; /* Default to tshut via gpio and tshut low is active */ if (of_getprop_uint32(phandle, "rockchip,hw-tshut-mode", diff --git a/sys/arch/arm/rockchip/rk_usb.c b/sys/arch/arm/rockchip/rk_usb.c index a8c3b56a1d86..f77968d5040d 100644 --- a/sys/arch/arm/rockchip/rk_usb.c +++ b/sys/arch/arm/rockchip/rk_usb.c @@ -1,4 +1,4 @@ -/* $NetBSD: rk_usb.c,v 1.10 2021/01/27 02:00:02 thorpej Exp $ */ +/* $NetBSD: rk_usb.c,v 1.11 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2018 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: rk_usb.c,v 1.10 2021/01/27 02:00:02 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rk_usb.c,v 1.11 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -202,7 +202,7 @@ rk_usb_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -227,7 +227,7 @@ rk_usb_attach(device_t parent, device_t self, void *aux) } sc->sc_dev = self; - sc->sc_type = of_search_compatible(phandle, compat_data)->value; + sc->sc_type = of_compatible_lookup(phandle, compat_data)->value; sc->sc_syscon = fdtbus_syscon_lookup(OF_parent(phandle)); if (sc->sc_syscon == NULL) { aprint_error(": couldn't get grf syscon\n"); diff --git a/sys/arch/arm/rockchip/rk_v1crypto.c b/sys/arch/arm/rockchip/rk_v1crypto.c index c0e17a2c679e..b58e750737c1 100644 --- a/sys/arch/arm/rockchip/rk_v1crypto.c +++ b/sys/arch/arm/rockchip/rk_v1crypto.c @@ -1,4 +1,4 @@ -/* $NetBSD: rk_v1crypto.c,v 1.6 2021/01/27 02:00:02 thorpej Exp $ */ +/* $NetBSD: rk_v1crypto.c,v 1.7 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(1, "$NetBSD: rk_v1crypto.c,v 1.6 2021/01/27 02:00:02 thorpej Exp $"); +__KERNEL_RCSID(1, "$NetBSD: rk_v1crypto.c,v 1.7 2021/01/27 03:10:19 thorpej Exp $"); #include @@ -108,7 +108,7 @@ rk_v1crypto_match(device_t parent, cfdata_t cf, void *aux) { const struct fdt_attach_args *const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/rockchip/rk_vop.c b/sys/arch/arm/rockchip/rk_vop.c index ac2a4b072b6b..d38dfb055aee 100644 --- a/sys/arch/arm/rockchip/rk_vop.c +++ b/sys/arch/arm/rockchip/rk_vop.c @@ -1,4 +1,4 @@ -/* $NetBSD: rk_vop.c,v 1.9 2021/01/27 02:00:02 thorpej Exp $ */ +/* $NetBSD: rk_vop.c,v 1.10 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rk_vop.c,v 1.9 2021/01/27 02:00:02 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rk_vop.c,v 1.10 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -535,7 +535,7 @@ rk_vop_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -584,7 +584,7 @@ rk_vop_attach(device_t parent, device_t self, void *aux) return; } sc->sc_phandle = faa->faa_phandle; - sc->sc_conf = of_search_compatible(phandle, compat_data)->data; + sc->sc_conf = of_compatible_lookup(phandle, compat_data)->data; aprint_naive("\n"); aprint_normal(": %s\n", sc->sc_conf->descr); diff --git a/sys/arch/arm/samsung/exynos5410_clock.c b/sys/arch/arm/samsung/exynos5410_clock.c index e7a3cfcc97a7..f33b8a091150 100644 --- a/sys/arch/arm/samsung/exynos5410_clock.c +++ b/sys/arch/arm/samsung/exynos5410_clock.c @@ -1,4 +1,4 @@ -/* $NetBSD: exynos5410_clock.c,v 1.6 2020/03/17 21:24:30 skrll Exp $ */ +/* $NetBSD: exynos5410_clock.c,v 1.7 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2015-2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: exynos5410_clock.c,v 1.6 2020/03/17 21:24:30 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: exynos5410_clock.c,v 1.7 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -423,13 +423,17 @@ CFATTACH_DECL_NEW(exynos5410_clock, sizeof(struct exynos5410_clock_softc), #define CLOCK_WRITE(sc, reg, val) \ bus_space_write_4((sc)->sc_bst, (sc)->sc_bsh, (reg), (val)) +static const struct device_compatible_entry compat_data[] = { + { .compat = "samsung,exynos5410-clock" }, + DEVICE_COMPAT_EOL +}; + static int exynos5410_clock_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { "samsung,exynos5410-clock", NULL }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/samsung/exynos5422_clock.c b/sys/arch/arm/samsung/exynos5422_clock.c index 1d4798ee6d00..1738208f2918 100644 --- a/sys/arch/arm/samsung/exynos5422_clock.c +++ b/sys/arch/arm/samsung/exynos5422_clock.c @@ -1,4 +1,4 @@ -/* $NetBSD: exynos5422_clock.c,v 1.15 2020/03/17 21:24:30 skrll Exp $ */ +/* $NetBSD: exynos5422_clock.c,v 1.16 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill @@ -29,7 +29,7 @@ #include "locators.h" #include -__KERNEL_RCSID(0, "$NetBSD: exynos5422_clock.c,v 1.15 2020/03/17 21:24:30 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: exynos5422_clock.c,v 1.16 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -600,13 +600,17 @@ CFATTACH_DECL_NEW(exynos5422_clock, sizeof(struct exynos5422_clock_softc), #define CLOCK_WRITE(sc, reg, val) \ bus_space_write_4((sc)->sc_bst, (sc)->sc_bsh, (reg), (val)) +static const struct device_compatible_entry compat_data[] = { + { .compat = "samsung,exynos5800-clock" }, + DEVICE_COMPAT_EOL +}; + static int exynos5422_clock_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { "samsung,exynos5800-clock", NULL }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/samsung/exynos_combiner.c b/sys/arch/arm/samsung/exynos_combiner.c index eb6e13b93a86..0d6fb2fff22a 100644 --- a/sys/arch/arm/samsung/exynos_combiner.c +++ b/sys/arch/arm/samsung/exynos_combiner.c @@ -1,4 +1,4 @@ -/* $NetBSD: exynos_combiner.c,v 1.12 2021/01/15 00:38:23 jmcneill Exp $ */ +/* $NetBSD: exynos_combiner.c,v 1.13 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2015 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ #include "gpio.h" #include -__KERNEL_RCSID(1, "$NetBSD: exynos_combiner.c,v 1.12 2021/01/15 00:38:23 jmcneill Exp $"); +__KERNEL_RCSID(1, "$NetBSD: exynos_combiner.c,v 1.13 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -105,13 +105,17 @@ struct fdtbus_interrupt_controller_func exynos_combiner_funcs = { CFATTACH_DECL_NEW(exynos_intr, sizeof(struct exynos_combiner_softc), exynos_combiner_match, exynos_combiner_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "samsung,exynos4210-combiner" }, + DEVICE_COMPAT_EOL +}; + static int exynos_combiner_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { "samsung,exynos4210-combiner", - NULL }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/samsung/exynos_dwcmmc.c b/sys/arch/arm/samsung/exynos_dwcmmc.c index fda690a41019..61e2744bf4d9 100644 --- a/sys/arch/arm/samsung/exynos_dwcmmc.c +++ b/sys/arch/arm/samsung/exynos_dwcmmc.c @@ -1,4 +1,4 @@ -/* $NetBSD: exynos_dwcmmc.c,v 1.13 2021/01/27 02:01:53 thorpej Exp $ */ +/* $NetBSD: exynos_dwcmmc.c,v 1.14 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: exynos_dwcmmc.c,v 1.13 2021/01/27 02:01:53 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: exynos_dwcmmc.c,v 1.14 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -82,7 +82,7 @@ exynos_dwcmmc_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -130,7 +130,7 @@ exynos_dwcmmc_attach(device_t parent, device_t self, void *aux) return; } - dce = of_search_compatible(faa->faa_phandle, compat_data); + dce = of_compatible_lookup(faa->faa_phandle, compat_data); KASSERT(dce != NULL); sc->sc_dev = self; diff --git a/sys/arch/arm/samsung/exynos_ehci.c b/sys/arch/arm/samsung/exynos_ehci.c index 5819e8f04360..ad5c53fd4669 100644 --- a/sys/arch/arm/samsung/exynos_ehci.c +++ b/sys/arch/arm/samsung/exynos_ehci.c @@ -1,4 +1,4 @@ -/* $NetBSD: exynos_ehci.c,v 1.4 2018/07/03 16:09:04 jmcneill Exp $ */ +/* $NetBSD: exynos_ehci.c,v 1.5 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2015-2018 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: exynos_ehci.c,v 1.4 2018/07/03 16:09:04 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: exynos_ehci.c,v 1.5 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -52,16 +52,17 @@ CFATTACH_DECL2_NEW(exynos_ehci, sizeof(struct ehci_softc), exynos_ehci_match, exynos_ehci_attach, NULL, ehci_activate, NULL, ehci_childdet); +static const struct device_compatible_entry compat_data[] = { + { .compat = "samsung,exynos4210-ehci" }, + DEVICE_COMPAT_EOL +}; + static int exynos_ehci_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "samsung,exynos4210-ehci", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/samsung/exynos_i2c.c b/sys/arch/arm/samsung/exynos_i2c.c index a262ac57167d..7c15b9f76a40 100644 --- a/sys/arch/arm/samsung/exynos_i2c.c +++ b/sys/arch/arm/samsung/exynos_i2c.c @@ -1,4 +1,4 @@ -/* $NetBSD: exynos_i2c.c,v 1.20 2020/12/23 16:02:11 thorpej Exp $ */ +/* $NetBSD: exynos_i2c.c,v 1.21 2021/01/27 03:10:19 thorpej Exp $ */ /* * Copyright (c) 2015 Jared D. McNeill @@ -31,7 +31,7 @@ #include "opt_arm_debug.h" #include -__KERNEL_RCSID(0, "$NetBSD: exynos_i2c.c,v 1.20 2020/12/23 16:02:11 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: exynos_i2c.c,v 1.21 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -112,13 +112,17 @@ CFATTACH_DECL_NEW(exynos_i2c, sizeof(struct exynos_i2c_softc), #define READBIT (1<<7) +static const struct device_compatible_entry compat_data[] = { + { .compat = "samsung,s3c2440-i2c" }, + DEVICE_COMPAT_EOL +}; + static int exynos_i2c_match(device_t self, cfdata_t cf, void *aux) { - const char * const compatible[] = { "samsung,s3c2440-i2c", NULL }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/samsung/exynos_ohci.c b/sys/arch/arm/samsung/exynos_ohci.c index a8306f65a982..5d7f98efb409 100644 --- a/sys/arch/arm/samsung/exynos_ohci.c +++ b/sys/arch/arm/samsung/exynos_ohci.c @@ -1,4 +1,4 @@ -/* $NetBSD: exynos_ohci.c,v 1.3 2018/07/03 16:09:04 jmcneill Exp $ */ +/* $NetBSD: exynos_ohci.c,v 1.4 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2015-2018 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: exynos_ohci.c,v 1.3 2018/07/03 16:09:04 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: exynos_ohci.c,v 1.4 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -52,16 +52,17 @@ CFATTACH_DECL2_NEW(exynos_ohci, sizeof(struct ohci_softc), exynos_ohci_match, exynos_ohci_attach, NULL, ohci_activate, NULL, ohci_childdet); +static const struct device_compatible_entry compat_data[] = { + { .compat = "samsung,exynos4210-ohci" }, + DEVICE_COMPAT_EOL +}; + static int exynos_ohci_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "samsung,exynos4210-ohci", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/samsung/exynos_pinctrl.c b/sys/arch/arm/samsung/exynos_pinctrl.c index 3593fe396334..9349fbf6dcf6 100644 --- a/sys/arch/arm/samsung/exynos_pinctrl.c +++ b/sys/arch/arm/samsung/exynos_pinctrl.c @@ -1,4 +1,4 @@ -/* $NetBSD: exynos_pinctrl.c,v 1.20 2021/01/27 02:01:53 thorpej Exp $ */ +/* $NetBSD: exynos_pinctrl.c,v 1.21 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2015, 2020 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ #include "gpio.h" #include -__KERNEL_RCSID(1, "$NetBSD: exynos_pinctrl.c,v 1.20 2021/01/27 02:01:53 thorpej Exp $"); +__KERNEL_RCSID(1, "$NetBSD: exynos_pinctrl.c,v 1.21 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -87,7 +87,7 @@ exynos_pinctrl_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -110,7 +110,7 @@ exynos_pinctrl_attach(device_t parent, device_t self, void *aux) self->dv_private = sc; sc->sc_dev = self; sc->sc_bst = faa->faa_bst; - sc->sc_epb = of_search_compatible(faa->faa_phandle, compat_data)->data; + sc->sc_epb = of_compatible_lookup(faa->faa_phandle, compat_data)->data; error = bus_space_map(sc->sc_bst, addr, size, 0, &sc->sc_bsh); if (error) { diff --git a/sys/arch/arm/samsung/exynos_platform.c b/sys/arch/arm/samsung/exynos_platform.c index 464d278d4ccc..3d82c8af9d8a 100644 --- a/sys/arch/arm/samsung/exynos_platform.c +++ b/sys/arch/arm/samsung/exynos_platform.c @@ -1,4 +1,4 @@ -/* $NetBSD: exynos_platform.c,v 1.35 2021/01/27 02:01:53 thorpej Exp $ */ +/* $NetBSD: exynos_platform.c,v 1.36 2021/01/27 03:16:37 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared D. McNeill @@ -35,7 +35,7 @@ #include "ukbd.h" #include -__KERNEL_RCSID(0, "$NetBSD: exynos_platform.c,v 1.35 2021/01/27 02:01:53 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: exynos_platform.c,v 1.36 2021/01/27 03:16:37 thorpej Exp $"); /* @@ -208,7 +208,7 @@ exynos_platform_mpstart(void) int (*mp_start)(void) = NULL; const struct device_compatible_entry *cd = - of_search_compatible(OF_finddevice("/"), mp_compat_data); + of_compatible_lookup(OF_finddevice("/"), mp_compat_data); if (cd) mp_start = cd->data; @@ -339,7 +339,7 @@ exynos5_platform_bootstrap(void) #if defined(MULTIPROCESSOR) && defined(EXYNOS5422_DISABLE_CA7_CLUSTER) const struct device_compatible_entry *cd = - of_search_compatible(OF_finddevice("/"), mp_compat_data); + of_compatible_lookup(OF_finddevice("/"), mp_compat_data); if (cd && cd->data == exynos5800_mpstart) { void *fdt_data = __UNCONST(fdtbus_get_data()); int cpu_off, cpus_off, len; diff --git a/sys/arch/arm/samsung/exynos_pwm.c b/sys/arch/arm/samsung/exynos_pwm.c index 0b5d7110b8ab..7cb4e7ef4e69 100644 --- a/sys/arch/arm/samsung/exynos_pwm.c +++ b/sys/arch/arm/samsung/exynos_pwm.c @@ -1,4 +1,4 @@ -/* $NetBSD: exynos_pwm.c,v 1.2 2019/10/18 06:13:38 skrll Exp $ */ +/* $NetBSD: exynos_pwm.c,v 1.3 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2018 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: exynos_pwm.c,v 1.2 2019/10/18 06:13:38 skrll Exp $"); +__KERNEL_RCSID(1, "$NetBSD: exynos_pwm.c,v 1.3 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -57,9 +57,9 @@ __KERNEL_RCSID(1, "$NetBSD: exynos_pwm.c,v 1.2 2019/10/18 06:13:38 skrll Exp $") #define PWM_NTIMERS 5 -static const char * const compatible[] = { - "samsung,exynos4210-pwm", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "samsung,exynos4210-pwm" }, + DEVICE_COMPAT_EOL }; struct exynos_pwm_softc; @@ -200,7 +200,7 @@ exynos_pwm_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/samsung/exynos_rtc.c b/sys/arch/arm/samsung/exynos_rtc.c index 81f811bad08c..0fdbafabab7d 100644 --- a/sys/arch/arm/samsung/exynos_rtc.c +++ b/sys/arch/arm/samsung/exynos_rtc.c @@ -1,4 +1,4 @@ -/* $NetBSD: exynos_rtc.c,v 1.3 2019/10/18 06:13:38 skrll Exp $ */ +/* $NetBSD: exynos_rtc.c,v 1.4 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2015 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ #include "gpio.h" #include -__KERNEL_RCSID(1, "$NetBSD: exynos_rtc.c,v 1.3 2019/10/18 06:13:38 skrll Exp $"); +__KERNEL_RCSID(1, "$NetBSD: exynos_rtc.c,v 1.4 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -73,13 +73,17 @@ CFATTACH_DECL_NEW(exynos_rtc, sizeof(struct exynos_rtc_softc), #define RTC_WRITE(sc, reg, val) \ bus_space_write_4((sc)->sc_bst, (sc)->sc_bsh, (reg), (val)) +static const struct device_compatible_entry compat_data[] = { + { .compat = "samsung,s3c6410-rtc" }, + DEVICE_COMPAT_EOL +}; + static int exynos_rtc_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { "samsung,s3c6410-rtc", - NULL }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/samsung/exynos_uart.c b/sys/arch/arm/samsung/exynos_uart.c index c49430c44a7c..77b89d22c5af 100644 --- a/sys/arch/arm/samsung/exynos_uart.c +++ b/sys/arch/arm/samsung/exynos_uart.c @@ -1,4 +1,4 @@ -/* $NetBSD: exynos_uart.c,v 1.3 2020/03/17 21:24:30 skrll Exp $ */ +/* $NetBSD: exynos_uart.c,v 1.4 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2013-2018 The NetBSD Foundation, Inc. @@ -33,7 +33,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: exynos_uart.c,v 1.3 2020/03/17 21:24:30 skrll Exp $"); +__KERNEL_RCSID(1, "$NetBSD: exynos_uart.c,v 1.4 2021/01/27 03:10:19 thorpej Exp $"); #define cn_trap() \ do { \ @@ -135,9 +135,9 @@ const struct cdevsw exuart_cdevsw = { static int exynos_uart_cmajor = -1; -static const char * const compatible[] = { - "samsung,exynos4210-uart", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "samsung,exynos4210-uart" }, + DEVICE_COMPAT_EOL }; CFATTACH_DECL_NEW(exynos_uart, sizeof(struct exynos_uart_softc), @@ -148,7 +148,7 @@ exynos_uart_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -576,7 +576,7 @@ exynos_uart_intr(void *priv) static int exynos_uart_console_match(int phandle) { - return of_match_compatible(phandle, compatible); + return of_compatible_match(phandle, compat_data); } static void diff --git a/sys/arch/arm/samsung/exynos_usbdrdphy.c b/sys/arch/arm/samsung/exynos_usbdrdphy.c index 687240bfacd6..de79b1befba4 100644 --- a/sys/arch/arm/samsung/exynos_usbdrdphy.c +++ b/sys/arch/arm/samsung/exynos_usbdrdphy.c @@ -1,4 +1,4 @@ -/* $NetBSD: exynos_usbdrdphy.c,v 1.5 2021/01/27 02:01:53 thorpej Exp $ */ +/* $NetBSD: exynos_usbdrdphy.c,v 1.6 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2018 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: exynos_usbdrdphy.c,v 1.5 2021/01/27 02:01:53 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: exynos_usbdrdphy.c,v 1.6 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -227,7 +227,7 @@ exynos_usbdrdphy_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/samsung/exynos_usbphy.c b/sys/arch/arm/samsung/exynos_usbphy.c index 2e4a89555c94..ea7d2dab0a4b 100644 --- a/sys/arch/arm/samsung/exynos_usbphy.c +++ b/sys/arch/arm/samsung/exynos_usbphy.c @@ -1,4 +1,4 @@ -/* $NetBSD: exynos_usbphy.c,v 1.5 2021/01/27 02:01:53 thorpej Exp $ */ +/* $NetBSD: exynos_usbphy.c,v 1.6 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2018 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: exynos_usbphy.c,v 1.5 2021/01/27 02:01:53 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: exynos_usbphy.c,v 1.6 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -230,7 +230,7 @@ exynos_usbphy_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/samsung/exynos_wdt.c b/sys/arch/arm/samsung/exynos_wdt.c index aa70a54647e8..429a7db9c159 100644 --- a/sys/arch/arm/samsung/exynos_wdt.c +++ b/sys/arch/arm/samsung/exynos_wdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: exynos_wdt.c,v 1.11 2019/10/18 06:13:38 skrll Exp $ */ +/* $NetBSD: exynos_wdt.c,v 1.12 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #include "exynos_wdt.h" #include -__KERNEL_RCSID(0, "$NetBSD: exynos_wdt.c,v 1.11 2019/10/18 06:13:38 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: exynos_wdt.c,v 1.12 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -86,14 +86,18 @@ exynos_wdt_wdog_write(struct exynos_wdt_softc *sc, bus_size_t o, uint32_t v) bus_space_write_4(sc->sc_bst, sc->sc_wdog_bsh, o, v); } +static const struct device_compatible_entry compat_data[] = { + { .compat = "samsung,exynos5420-wdt" }, + DEVICE_COMPAT_EOL +}; + /* ARGSUSED */ static int exynos_wdt_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { "samsung,exynos5420-wdt", NULL }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static int diff --git a/sys/arch/arm/samsung/mct.c b/sys/arch/arm/samsung/mct.c index 5a1276946d22..01b829930060 100644 --- a/sys/arch/arm/samsung/mct.c +++ b/sys/arch/arm/samsung/mct.c @@ -1,4 +1,4 @@ -/* $NetBSD: mct.c,v 1.16 2019/10/18 06:13:38 skrll Exp $ */ +/* $NetBSD: mct.c,v 1.17 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2014-2018 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: mct.c,v 1.16 2019/10/18 06:13:38 skrll Exp $"); +__KERNEL_RCSID(1, "$NetBSD: mct.c,v 1.17 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -225,14 +225,17 @@ mct_fdt_cpu_hatch(void *priv, struct cpu_info *ci) #endif } +static const struct device_compatible_entry compat_data[] = { + { .compat = "samsung,exynos4210-mct" }, + DEVICE_COMPAT_EOL +}; + static int mct_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { "samsung,exynos4210-mct", - NULL }; - struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sociox/if_ave.c b/sys/arch/arm/sociox/if_ave.c index cf3401dede0b..afde8ca26ea4 100644 --- a/sys/arch/arm/sociox/if_ave.c +++ b/sys/arch/arm/sociox/if_ave.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_ave.c,v 1.20 2021/01/27 02:03:10 thorpej Exp $ */ +/* $NetBSD: if_ave.c,v 1.21 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_ave.c,v 1.20 2021/01/27 02:03:10 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_ave.c,v 1.21 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -335,7 +335,7 @@ ave_fdt_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -382,7 +382,7 @@ ave_fdt_attach(device_t parent, device_t self, void *aux) hwimp = CSR_READ(sc, AVEID); hwver = CSR_READ(sc, AVEHWVER); - sc->sc_model = of_search_compatible(phandle, compat_data)->value; + sc->sc_model = of_compatible_lookup(phandle, compat_data)->value; phy_mode = fdtbus_get_string(phandle, "phy-mode"); if (phy_mode == NULL) diff --git a/sys/arch/arm/sociox/if_scx.c b/sys/arch/arm/sociox/if_scx.c index 23accd7c4e10..c9f1435527c0 100644 --- a/sys/arch/arm/sociox/if_scx.c +++ b/sys/arch/arm/sociox/if_scx.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_scx.c,v 1.23 2020/10/10 03:29:48 nisimura Exp $ */ +/* $NetBSD: if_scx.c,v 1.24 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -46,7 +46,7 @@ #define NOT_MP_SAFE 0 #include -__KERNEL_RCSID(0, "$NetBSD: if_scx.c,v 1.23 2020/10/10 03:29:48 nisimura Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_scx.c,v 1.24 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -521,16 +521,17 @@ mac_write(struct scx_softc *sc, int reg, int val) (void)WAIT_FOR_CLR(sc, MACCMD, CMD_BUSY, 0); } +static const struct device_compatible_entry compat_data[] = { + { .compat = "socionext,synquacer-netsec" }, + DEVICE_COMPAT_EOL +}; + static int scx_fdt_match(device_t parent, cfdata_t cf, void *aux) { - static const char * compatible[] = { - "socionext,synquacer-netsec", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sociox/sni_emmc.c b/sys/arch/arm/sociox/sni_emmc.c index 41b1c218c325..ec4711e348af 100644 --- a/sys/arch/arm/sociox/sni_emmc.c +++ b/sys/arch/arm/sociox/sni_emmc.c @@ -1,4 +1,4 @@ -/* $NetBSD: sni_emmc.c,v 1.7 2020/05/31 23:55:18 thorpej Exp $ */ +/* $NetBSD: sni_emmc.c,v 1.8 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sni_emmc.c,v 1.7 2020/05/31 23:55:18 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sni_emmc.c,v 1.8 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -82,17 +82,18 @@ CFATTACH_DECL_NEW(sniemmc_acpi, sizeof(struct sniemmc_softc), static void sniemmc_attach_i(device_t); +static const struct device_compatible_entry compat_data[] = { + { .compat = "socionext,synquacer-sdhci" }, + { .compat = "fujitsu,mb86s70-sdhci-3.0" }, + DEVICE_COMPAT_EOL +}; + static int sniemmc_fdt_match(device_t parent, struct cfdata *match, void *aux) { - static const char * compatible[] = { - "socionext,synquacer-sdhci", - "fujitsu,mb86s70-sdhci-3.0", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sociox/sni_exiu.c b/sys/arch/arm/sociox/sni_exiu.c index a6bfd67781ad..1bb8575c5a7c 100644 --- a/sys/arch/arm/sociox/sni_exiu.c +++ b/sys/arch/arm/sociox/sni_exiu.c @@ -1,4 +1,4 @@ -/* $NetBSD: sni_exiu.c,v 1.4 2020/05/31 23:55:18 thorpej Exp $ */ +/* $NetBSD: sni_exiu.c,v 1.5 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sni_exiu.c,v 1.4 2020/05/31 23:55:18 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sni_exiu.c,v 1.5 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -74,16 +74,17 @@ CFATTACH_DECL_NEW(sniexiu_acpi, sizeof(struct sniexiu_softc), static void sniexiu_attach_i(struct sniexiu_softc *); static int sniexiu_intr(void *); +static const struct device_compatible_entry compat_data[] = { + { .compat = "socionext,synquacer-exiu" }, + DEVICE_COMPAT_EOL +}; + static int sniexiu_fdt_match(device_t parent, struct cfdata *match, void *aux) { - static const char * compatible[] = { - "socionext,synquacer-exiu", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sociox/sni_gpio.c b/sys/arch/arm/sociox/sni_gpio.c index 7eb6beeaaf2b..0773b185058a 100644 --- a/sys/arch/arm/sociox/sni_gpio.c +++ b/sys/arch/arm/sociox/sni_gpio.c @@ -1,4 +1,4 @@ -/* $NetBSD: sni_gpio.c,v 1.8 2020/05/31 23:55:18 thorpej Exp $ */ +/* $NetBSD: sni_gpio.c,v 1.9 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sni_gpio.c,v 1.8 2020/05/31 23:55:18 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sni_gpio.c,v 1.9 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -101,17 +101,18 @@ CFATTACH_DECL_NEW(snigpio_acpi, sizeof(struct snigpio_softc), static void snigpio_attach_i(struct snigpio_softc *); static int snigpio_intr(void *); +static const struct device_compatible_entry compat_data[] = { + { .compat = "socionext,synquacer-gpio" }, + { .compat = "fujitsu,mb86s70-gpio" }, + DEVICE_COMPAT_EOL +}; + static int snigpio_fdt_match(device_t parent, struct cfdata *match, void *aux) { - static const char * compatible[] = { - "socionext,synquacer-gpio", - "fujitsu,mb86s70-gpio", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sociox/sni_i2c.c b/sys/arch/arm/sociox/sni_i2c.c index 7c951a127470..8db1ab26b95e 100644 --- a/sys/arch/arm/sociox/sni_i2c.c +++ b/sys/arch/arm/sociox/sni_i2c.c @@ -1,4 +1,4 @@ -/* $NetBSD: sni_i2c.c,v 1.9 2020/12/23 16:02:11 thorpej Exp $ */ +/* $NetBSD: sni_i2c.c,v 1.10 2021/01/27 03:10:19 thorpej Exp $ */ /*- * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sni_i2c.c,v 1.9 2020/12/23 16:02:11 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sni_i2c.c,v 1.10 2021/01/27 03:10:19 thorpej Exp $"); #include #include @@ -95,16 +95,17 @@ static void sni_i2c_flush(struct sniiic_softc *); #define I2C_WRITE(sc, reg, val) \ bus_space_write_4((sc)->sc_ioh,(sc)->sc_ioh,(reg),(val)) +static const struct device_compatible_entry compat_data[] = { + { .compat = "socionext,synquacer-i2c" }, + DEVICE_COMPAT_EOL +}; + static int sniiic_fdt_match(device_t parent, struct cfdata *match, void *aux) { - static const char * compatible[] = { - "socionext,synquacer-i2c", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sunxi/sun4i_a10_ccu.c b/sys/arch/arm/sunxi/sun4i_a10_ccu.c index 3d4f64584cdd..645cb25d2a3b 100644 --- a/sys/arch/arm/sunxi/sun4i_a10_ccu.c +++ b/sys/arch/arm/sunxi/sun4i_a10_ccu.c @@ -1,4 +1,4 @@ -/* $NetBSD: sun4i_a10_ccu.c,v 1.15 2021/01/27 02:09:39 thorpej Exp $ */ +/* $NetBSD: sun4i_a10_ccu.c,v 1.16 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: sun4i_a10_ccu.c,v 1.15 2021/01/27 02:09:39 thorpej Exp $"); +__KERNEL_RCSID(1, "$NetBSD: sun4i_a10_ccu.c,v 1.16 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -847,7 +847,7 @@ sun4i_a10_ccu_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static struct sunxi_ccu_softc *sc0; @@ -875,7 +875,7 @@ sun4i_a10_ccu_attach(device_t parent, device_t self, void *aux) aprint_naive("\n"); - type = of_search_compatible(faa->faa_phandle, compat_data)->value; + type = of_compatible_lookup(faa->faa_phandle, compat_data)->value; switch (type) { case CCU_A10: diff --git a/sys/arch/arm/sunxi/sun4i_dma.c b/sys/arch/arm/sunxi/sun4i_dma.c index 5f4939a20528..35f49c28e0de 100644 --- a/sys/arch/arm/sunxi/sun4i_dma.c +++ b/sys/arch/arm/sunxi/sun4i_dma.c @@ -1,4 +1,4 @@ -/* $NetBSD: sun4i_dma.c,v 1.7 2021/01/27 02:09:39 thorpej Exp $ */ +/* $NetBSD: sun4i_dma.c,v 1.8 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -29,7 +29,7 @@ #include "opt_ddb.h" #include -__KERNEL_RCSID(0, "$NetBSD: sun4i_dma.c,v 1.7 2021/01/27 02:09:39 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sun4i_dma.c,v 1.8 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -345,7 +345,7 @@ sun4idma_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sunxi/sun4i_emac.c b/sys/arch/arm/sunxi/sun4i_emac.c index 5397c65efc0a..c4887f752e76 100644 --- a/sys/arch/arm/sunxi/sun4i_emac.c +++ b/sys/arch/arm/sunxi/sun4i_emac.c @@ -1,4 +1,4 @@ -/* $NetBSD: sun4i_emac.c,v 1.13 2021/01/15 22:47:32 jmcneill Exp $ */ +/* $NetBSD: sun4i_emac.c,v 1.14 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2013-2017 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: sun4i_emac.c,v 1.13 2021/01/15 22:47:32 jmcneill Exp $"); +__KERNEL_RCSID(1, "$NetBSD: sun4i_emac.c,v 1.14 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -198,9 +198,9 @@ struct sun4i_emac_softc { uint32_t sc_txbuf[EMAC_TXBUF_SIZE/4]; }; -static const char * compatible[] = { - "allwinner,sun4i-a10-emac", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "allwinner,sun4i-a10-emac" }, + DEVICE_COMPAT_EOL }; CFATTACH_DECL_NEW(sun4i_emac, sizeof(struct sun4i_emac_softc), @@ -231,7 +231,7 @@ sun4i_emac_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sunxi/sun4i_spi.c b/sys/arch/arm/sunxi/sun4i_spi.c index e0cbcf3eccdb..85467cf6b2f8 100644 --- a/sys/arch/arm/sunxi/sun4i_spi.c +++ b/sys/arch/arm/sunxi/sun4i_spi.c @@ -1,4 +1,4 @@ -/* $NetBSD: sun4i_spi.c,v 1.6 2021/01/15 22:47:32 jmcneill Exp $ */ +/* $NetBSD: sun4i_spi.c,v 1.7 2021/01/27 03:10:20 thorpej Exp $ */ /* * Copyright (c) 2019 Tobias Nygren @@ -28,7 +28,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sun4i_spi.c,v 1.6 2021/01/15 22:47:32 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sun4i_spi.c,v 1.7 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -41,9 +41,9 @@ __KERNEL_RCSID(0, "$NetBSD: sun4i_spi.c,v 1.6 2021/01/15 22:47:32 jmcneill Exp $ #include #include -static const char * const compatible[] = { - "allwinner,sun4i-a10-spi", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "allwinner,sun4i-a10-spi" }, + DEVICE_COMPAT_EOL }; struct sun4ispi_softc { @@ -99,7 +99,7 @@ sun4ispi_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sunxi/sun50i_a64_acodec.c b/sys/arch/arm/sunxi/sun50i_a64_acodec.c index 83b03df334de..50751377d8b6 100644 --- a/sys/arch/arm/sunxi/sun50i_a64_acodec.c +++ b/sys/arch/arm/sunxi/sun50i_a64_acodec.c @@ -1,4 +1,4 @@ -/* $NetBSD: sun50i_a64_acodec.c,v 1.9 2019/05/08 13:40:14 isaki Exp $ */ +/* $NetBSD: sun50i_a64_acodec.c,v 1.10 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2018 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sun50i_a64_acodec.c,v 1.9 2019/05/08 13:40:14 isaki Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sun50i_a64_acodec.c,v 1.10 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -606,9 +606,9 @@ a64_acodec_dai_jack_detect(audio_dai_tag_t dai, u_int jack, int present) return 0; } -static const char * compatible[] = { - "allwinner,sun50i-a64-codec-analog", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "allwinner,sun50i-a64-codec-analog" }, + DEVICE_COMPAT_EOL }; static int @@ -616,7 +616,7 @@ a64_acodec_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sunxi/sun50i_a64_ccu.c b/sys/arch/arm/sunxi/sun50i_a64_ccu.c index ecdadcd82c97..b2b3fa2f02d5 100644 --- a/sys/arch/arm/sunxi/sun50i_a64_ccu.c +++ b/sys/arch/arm/sunxi/sun50i_a64_ccu.c @@ -1,4 +1,4 @@ -/* $NetBSD: sun50i_a64_ccu.c,v 1.22 2019/12/08 18:13:24 jmcneill Exp $ */ +/* $NetBSD: sun50i_a64_ccu.c,v 1.23 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: sun50i_a64_ccu.c,v 1.22 2019/12/08 18:13:24 jmcneill Exp $"); +__KERNEL_RCSID(1, "$NetBSD: sun50i_a64_ccu.c,v 1.23 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -85,9 +85,9 @@ __KERNEL_RCSID(1, "$NetBSD: sun50i_a64_ccu.c,v 1.22 2019/12/08 18:13:24 jmcneill static int sun50i_a64_ccu_match(device_t, cfdata_t, void *); static void sun50i_a64_ccu_attach(device_t, device_t, void *); -static const char * const compatible[] = { - "allwinner,sun50i-a64-ccu", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "allwinner,sun50i-a64-ccu" }, + DEVICE_COMPAT_EOL }; CFATTACH_DECL_NEW(sunxi_a64_ccu, sizeof(struct sunxi_ccu_softc), @@ -603,7 +603,7 @@ sun50i_a64_ccu_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sunxi/sun50i_a64_r_ccu.c b/sys/arch/arm/sunxi/sun50i_a64_r_ccu.c index 35a7e76a258a..fa8c2947ca5b 100644 --- a/sys/arch/arm/sunxi/sun50i_a64_r_ccu.c +++ b/sys/arch/arm/sunxi/sun50i_a64_r_ccu.c @@ -1,4 +1,4 @@ -/* $NetBSD: sun50i_a64_r_ccu.c,v 1.1 2018/05/05 09:54:53 jmcneill Exp $ */ +/* $NetBSD: sun50i_a64_r_ccu.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2017-2018 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: sun50i_a64_r_ccu.c,v 1.1 2018/05/05 09:54:53 jmcneill Exp $"); +__KERNEL_RCSID(1, "$NetBSD: sun50i_a64_r_ccu.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -49,9 +49,9 @@ __KERNEL_RCSID(1, "$NetBSD: sun50i_a64_r_ccu.c,v 1.1 2018/05/05 09:54:53 jmcneil static int sun50i_a64_r_ccu_match(device_t, cfdata_t, void *); static void sun50i_a64_r_ccu_attach(device_t, device_t, void *); -static const char * const compatible[] = { - "allwinner,sun50i-a64-r-ccu", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "allwinner,sun50i-a64-r-ccu" }, + DEVICE_COMPAT_EOL }; CFATTACH_DECL_NEW(sunxi_a64_r_ccu, sizeof(struct sunxi_ccu_softc), @@ -114,7 +114,7 @@ sun50i_a64_r_ccu_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sunxi/sun50i_h6_ccu.c b/sys/arch/arm/sunxi/sun50i_h6_ccu.c index eb1b0060c728..729182d189c5 100644 --- a/sys/arch/arm/sunxi/sun50i_h6_ccu.c +++ b/sys/arch/arm/sunxi/sun50i_h6_ccu.c @@ -1,4 +1,4 @@ -/* $NetBSD: sun50i_h6_ccu.c,v 1.3 2019/02/13 18:31:11 jakllsch Exp $ */ +/* $NetBSD: sun50i_h6_ccu.c,v 1.4 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2018 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: sun50i_h6_ccu.c,v 1.3 2019/02/13 18:31:11 jakllsch Exp $"); +__KERNEL_RCSID(1, "$NetBSD: sun50i_h6_ccu.c,v 1.4 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -96,9 +96,9 @@ __KERNEL_RCSID(1, "$NetBSD: sun50i_h6_ccu.c,v 1.3 2019/02/13 18:31:11 jakllsch E static int sun50i_h6_ccu_match(device_t, cfdata_t, void *); static void sun50i_h6_ccu_attach(device_t, device_t, void *); -static const char * const compatible[] = { - "allwinner,sun50i-h6-ccu", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "allwinner,sun50i-h6-ccu" }, + DEVICE_COMPAT_EOL }; CFATTACH_DECL_NEW(sunxi_h6_ccu, sizeof(struct sunxi_ccu_softc), @@ -375,7 +375,7 @@ sun50i_h6_ccu_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sunxi/sun50i_h6_r_ccu.c b/sys/arch/arm/sunxi/sun50i_h6_r_ccu.c index 202eb2bc0f1d..24150e98ee5f 100644 --- a/sys/arch/arm/sunxi/sun50i_h6_r_ccu.c +++ b/sys/arch/arm/sunxi/sun50i_h6_r_ccu.c @@ -1,4 +1,4 @@ -/* $NetBSD: sun50i_h6_r_ccu.c,v 1.1 2018/05/02 11:02:21 jmcneill Exp $ */ +/* $NetBSD: sun50i_h6_r_ccu.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2018 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: sun50i_h6_r_ccu.c,v 1.1 2018/05/02 11:02:21 jmcneill Exp $"); +__KERNEL_RCSID(1, "$NetBSD: sun50i_h6_r_ccu.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -49,9 +49,9 @@ __KERNEL_RCSID(1, "$NetBSD: sun50i_h6_r_ccu.c,v 1.1 2018/05/02 11:02:21 jmcneill static int sun50i_h6_r_ccu_match(device_t, cfdata_t, void *); static void sun50i_h6_r_ccu_attach(device_t, device_t, void *); -static const char * const compatible[] = { - "allwinner,sun50i-h6-r-ccu", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "allwinner,sun50i-h6-r-ccu" }, + DEVICE_COMPAT_EOL }; CFATTACH_DECL_NEW(sunxi_h6_r_ccu, sizeof(struct sunxi_ccu_softc), @@ -127,7 +127,7 @@ sun50i_h6_r_ccu_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sunxi/sun5i_a13_ccu.c b/sys/arch/arm/sunxi/sun5i_a13_ccu.c index ec1baaf8d857..ac357bc982d2 100644 --- a/sys/arch/arm/sunxi/sun5i_a13_ccu.c +++ b/sys/arch/arm/sunxi/sun5i_a13_ccu.c @@ -1,4 +1,4 @@ -/* $NetBSD: sun5i_a13_ccu.c,v 1.5 2017/11/09 21:52:32 jmcneill Exp $ */ +/* $NetBSD: sun5i_a13_ccu.c,v 1.6 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: sun5i_a13_ccu.c,v 1.5 2017/11/09 21:52:32 jmcneill Exp $"); +__KERNEL_RCSID(1, "$NetBSD: sun5i_a13_ccu.c,v 1.6 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -66,10 +66,10 @@ __KERNEL_RCSID(1, "$NetBSD: sun5i_a13_ccu.c,v 1.5 2017/11/09 21:52:32 jmcneill E static int sun5i_a13_ccu_match(device_t, cfdata_t, void *); static void sun5i_a13_ccu_attach(device_t, device_t, void *); -static const char * const compatible[] = { - "allwinner,sun5i-a13-ccu", - "nextthing,gr8-ccu", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "allwinner,sun5i-a13-ccu" }, + { .compat = "nextthing,gr8-ccu" }, + DEVICE_COMPAT_EOL }; CFATTACH_DECL_NEW(sunxi_a13_ccu, sizeof(struct sunxi_ccu_softc), @@ -292,7 +292,7 @@ sun5i_a13_ccu_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sunxi/sun6i_a31_ccu.c b/sys/arch/arm/sunxi/sun6i_a31_ccu.c index 9ee3fe2ad4ae..c7bddb0f25f2 100644 --- a/sys/arch/arm/sunxi/sun6i_a31_ccu.c +++ b/sys/arch/arm/sunxi/sun6i_a31_ccu.c @@ -1,4 +1,4 @@ -/* $NetBSD: sun6i_a31_ccu.c,v 1.4 2017/10/07 21:52:53 jmcneill Exp $ */ +/* $NetBSD: sun6i_a31_ccu.c,v 1.5 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -29,7 +29,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: sun6i_a31_ccu.c,v 1.4 2017/10/07 21:52:53 jmcneill Exp $"); +__KERNEL_RCSID(1, "$NetBSD: sun6i_a31_ccu.c,v 1.5 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -64,9 +64,9 @@ __KERNEL_RCSID(1, "$NetBSD: sun6i_a31_ccu.c,v 1.4 2017/10/07 21:52:53 jmcneill E static int sun6i_a31_ccu_match(device_t, cfdata_t, void *); static void sun6i_a31_ccu_attach(device_t, device_t, void *); -static const char * const compatible[] = { - "allwinner,sun6i-a31-ccu", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "allwinner,sun6i-a31-ccu" }, + DEVICE_COMPAT_EOL }; CFATTACH_DECL_NEW(sunxi_a31_ccu, sizeof(struct sunxi_ccu_softc), @@ -276,7 +276,7 @@ sun6i_a31_ccu_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sunxi/sun6i_dma.c b/sys/arch/arm/sunxi/sun6i_dma.c index 876a3ac399a6..48002abb95db 100644 --- a/sys/arch/arm/sunxi/sun6i_dma.c +++ b/sys/arch/arm/sunxi/sun6i_dma.c @@ -1,4 +1,4 @@ -/* $NetBSD: sun6i_dma.c,v 1.13 2021/01/27 02:09:39 thorpej Exp $ */ +/* $NetBSD: sun6i_dma.c,v 1.14 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2014-2017 Jared McNeill @@ -29,7 +29,7 @@ #include "opt_ddb.h" #include -__KERNEL_RCSID(0, "$NetBSD: sun6i_dma.c,v 1.13 2021/01/27 02:09:39 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sun6i_dma.c,v 1.14 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -414,7 +414,7 @@ sun6idma_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -464,7 +464,7 @@ sun6idma_attach(device_t parent, device_t self, void *aux) return; } - conf = of_search_compatible(phandle, compat_data)->data; + conf = of_compatible_lookup(phandle, compat_data)->data; sc->sc_burst_mask = conf->burst_mask; sc->sc_nchan = conf->num_channels; diff --git a/sys/arch/arm/sunxi/sun6i_spi.c b/sys/arch/arm/sunxi/sun6i_spi.c index 544cf38ad4f8..af450ffdf269 100644 --- a/sys/arch/arm/sunxi/sun6i_spi.c +++ b/sys/arch/arm/sunxi/sun6i_spi.c @@ -1,4 +1,4 @@ -/* $NetBSD: sun6i_spi.c,v 1.7 2021/01/15 23:02:38 jmcneill Exp $ */ +/* $NetBSD: sun6i_spi.c,v 1.8 2021/01/27 03:10:20 thorpej Exp $ */ /* * Copyright (c) 2019 Tobias Nygren @@ -28,7 +28,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sun6i_spi.c,v 1.7 2021/01/15 23:02:38 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sun6i_spi.c,v 1.8 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -84,16 +84,17 @@ static void sun6ispi_recv(struct sun6ispi_softc * const); CFATTACH_DECL_NEW(sun6i_spi, sizeof(struct sun6ispi_softc), sun6ispi_match, sun6ispi_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "allwinner,sun8i-h3-spi" }, + DEVICE_COMPAT_EOL +}; + static int sun6ispi_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "allwinner,sun8i-h3-spi", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sunxi/sun8i_a23_apbclk.c b/sys/arch/arm/sunxi/sun8i_a23_apbclk.c index 015438092fa0..232daec25f5b 100644 --- a/sys/arch/arm/sunxi/sun8i_a23_apbclk.c +++ b/sys/arch/arm/sunxi/sun8i_a23_apbclk.c @@ -1,4 +1,4 @@ -/* $NetBSD: sun8i_a23_apbclk.c,v 1.1 2019/05/27 21:12:54 jmcneill Exp $ */ +/* $NetBSD: sun8i_a23_apbclk.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sun8i_a23_apbclk.c,v 1.1 2019/05/27 21:12:54 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sun8i_a23_apbclk.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -83,13 +83,17 @@ struct sun8i_a23_apbclk_softc { CFATTACH_DECL_NEW(sunxi_a23_apbclk, sizeof(struct sun8i_a23_apbclk_softc), sun8i_a23_apbclk_match, sun8i_a23_apbclk_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "allwinner,sun8i-a23-apb0-clk" }, + DEVICE_COMPAT_EOL +}; + static int sun8i_a23_apbclk_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { "allwinner,sun8i-a23-apb0-clk", NULL }; const struct fdt_attach_args *faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sunxi/sun8i_a83t_ccu.c b/sys/arch/arm/sunxi/sun8i_a83t_ccu.c index da6898a7495e..2642dd0def05 100644 --- a/sys/arch/arm/sunxi/sun8i_a83t_ccu.c +++ b/sys/arch/arm/sunxi/sun8i_a83t_ccu.c @@ -1,4 +1,4 @@ -/* $NetBSD: sun8i_a83t_ccu.c,v 1.6 2019/01/02 17:29:58 jmcneill Exp $ */ +/* $NetBSD: sun8i_a83t_ccu.c,v 1.7 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -29,7 +29,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: sun8i_a83t_ccu.c,v 1.6 2019/01/02 17:29:58 jmcneill Exp $"); +__KERNEL_RCSID(1, "$NetBSD: sun8i_a83t_ccu.c,v 1.7 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -69,9 +69,9 @@ __KERNEL_RCSID(1, "$NetBSD: sun8i_a83t_ccu.c,v 1.6 2019/01/02 17:29:58 jmcneill static int sun8i_a83t_ccu_match(device_t, cfdata_t, void *); static void sun8i_a83t_ccu_attach(device_t, device_t, void *); -static const char * const compatible[] = { - "allwinner,sun8i-a83t-ccu", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "allwinner,sun8i-a83t-ccu" }, + DEVICE_COMPAT_EOL }; CFATTACH_DECL_NEW(sunxi_a83t_ccu, sizeof(struct sunxi_ccu_softc), @@ -369,7 +369,7 @@ sun8i_a83t_ccu_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sunxi/sun8i_codec.c b/sys/arch/arm/sunxi/sun8i_codec.c index 5d7860f3750e..a5a201daa2b6 100644 --- a/sys/arch/arm/sunxi/sun8i_codec.c +++ b/sys/arch/arm/sunxi/sun8i_codec.c @@ -1,4 +1,4 @@ -/* $NetBSD: sun8i_codec.c,v 1.8 2021/01/15 22:47:32 jmcneill Exp $ */ +/* $NetBSD: sun8i_codec.c,v 1.9 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2018 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sun8i_codec.c,v 1.8 2021/01/15 22:47:32 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sun8i_codec.c,v 1.9 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -332,9 +332,9 @@ sun8i_codec_thread(struct work *wk, void *priv) sun8i_codec_set_jackdet(sc, true); } -static const char * compatible[] = { - "allwinner,sun8i-a33-codec", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "allwinner,sun8i-a33-codec" }, + DEVICE_COMPAT_EOL }; static int @@ -342,7 +342,7 @@ sun8i_codec_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sunxi/sun8i_crypto.c b/sys/arch/arm/sunxi/sun8i_crypto.c index e0e7fd3c1f12..7428dc649fad 100644 --- a/sys/arch/arm/sunxi/sun8i_crypto.c +++ b/sys/arch/arm/sunxi/sun8i_crypto.c @@ -1,4 +1,4 @@ -/* $NetBSD: sun8i_crypto.c,v 1.22 2021/01/27 02:09:39 thorpej Exp $ */ +/* $NetBSD: sun8i_crypto.c,v 1.23 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2019 The NetBSD Foundation, Inc. @@ -43,7 +43,7 @@ */ #include -__KERNEL_RCSID(1, "$NetBSD: sun8i_crypto.c,v 1.22 2021/01/27 02:09:39 thorpej Exp $"); +__KERNEL_RCSID(1, "$NetBSD: sun8i_crypto.c,v 1.23 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -328,7 +328,7 @@ sun8i_crypto_match(device_t parent, cfdata_t cf, void *aux) { const struct fdt_attach_args *const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sunxi/sun8i_h3_ccu.c b/sys/arch/arm/sunxi/sun8i_h3_ccu.c index fae29c5ecf77..292c90e0f48e 100644 --- a/sys/arch/arm/sunxi/sun8i_h3_ccu.c +++ b/sys/arch/arm/sunxi/sun8i_h3_ccu.c @@ -1,4 +1,4 @@ -/* $NetBSD: sun8i_h3_ccu.c,v 1.16 2019/01/31 01:49:28 jmcneill Exp $ */ +/* $NetBSD: sun8i_h3_ccu.c,v 1.17 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -29,7 +29,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: sun8i_h3_ccu.c,v 1.16 2019/01/31 01:49:28 jmcneill Exp $"); +__KERNEL_RCSID(1, "$NetBSD: sun8i_h3_ccu.c,v 1.17 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -78,10 +78,10 @@ __KERNEL_RCSID(1, "$NetBSD: sun8i_h3_ccu.c,v 1.16 2019/01/31 01:49:28 jmcneill E static int sun8i_h3_ccu_match(device_t, cfdata_t, void *); static void sun8i_h3_ccu_attach(device_t, device_t, void *); -static const char * const compatible[] = { - "allwinner,sun8i-h3-ccu", - "allwinner,sun50i-h5-ccu", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "allwinner,sun8i-h3-ccu" }, + { .compat = "allwinner,sun50i-h5-ccu" }, + DEVICE_COMPAT_EOL }; CFATTACH_DECL_NEW(sunxi_h3_ccu, sizeof(struct sunxi_ccu_softc), @@ -508,7 +508,7 @@ sun8i_h3_ccu_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sunxi/sun8i_h3_codec.c b/sys/arch/arm/sunxi/sun8i_h3_codec.c index 441055056f39..12aea08fcddc 100644 --- a/sys/arch/arm/sunxi/sun8i_h3_codec.c +++ b/sys/arch/arm/sunxi/sun8i_h3_codec.c @@ -1,4 +1,4 @@ -/* $NetBSD: sun8i_h3_codec.c,v 1.4 2019/05/08 13:40:14 isaki Exp $ */ +/* $NetBSD: sun8i_h3_codec.c,v 1.5 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2014-2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sun8i_h3_codec.c,v 1.4 2019/05/08 13:40:14 isaki Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sun8i_h3_codec.c,v 1.5 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -432,9 +432,9 @@ const struct sunxi_codec_conf sun8i_h3_codecconf = { * Device glue, only here to claim resources on behalf of the sunxi_codec driver. */ -static const char * compatible[] = { - "allwinner,sun8i-h3-codec-analog", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "allwinner,sun8i-h3-codec-analog" }, + DEVICE_COMPAT_EOL }; static int @@ -442,7 +442,7 @@ h3_codec_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sunxi/sun8i_h3_r_ccu.c b/sys/arch/arm/sunxi/sun8i_h3_r_ccu.c index cb3f29692976..2186202f3e5f 100644 --- a/sys/arch/arm/sunxi/sun8i_h3_r_ccu.c +++ b/sys/arch/arm/sunxi/sun8i_h3_r_ccu.c @@ -1,4 +1,4 @@ -/* $NetBSD: sun8i_h3_r_ccu.c,v 1.1 2017/09/30 12:48:58 jmcneill Exp $ */ +/* $NetBSD: sun8i_h3_r_ccu.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: sun8i_h3_r_ccu.c,v 1.1 2017/09/30 12:48:58 jmcneill Exp $"); +__KERNEL_RCSID(1, "$NetBSD: sun8i_h3_r_ccu.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -48,9 +48,9 @@ __KERNEL_RCSID(1, "$NetBSD: sun8i_h3_r_ccu.c,v 1.1 2017/09/30 12:48:58 jmcneill static int sun8i_h3_r_ccu_match(device_t, cfdata_t, void *); static void sun8i_h3_r_ccu_attach(device_t, device_t, void *); -static const char * const compatible[] = { - "allwinner,sun8i-h3-r-ccu", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "allwinner,sun8i-h3-r-ccu" }, + DEVICE_COMPAT_EOL }; CFATTACH_DECL_NEW(sunxi_h3_r_ccu, sizeof(struct sunxi_ccu_softc), @@ -100,7 +100,7 @@ sun8i_h3_r_ccu_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sunxi/sun9i_a80_ccu.c b/sys/arch/arm/sunxi/sun9i_a80_ccu.c index ec48a3c9dbf1..3041beb1bee7 100644 --- a/sys/arch/arm/sunxi/sun9i_a80_ccu.c +++ b/sys/arch/arm/sunxi/sun9i_a80_ccu.c @@ -1,4 +1,4 @@ -/* $NetBSD: sun9i_a80_ccu.c,v 1.3 2019/05/26 13:56:46 jmcneill Exp $ */ +/* $NetBSD: sun9i_a80_ccu.c,v 1.4 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: sun9i_a80_ccu.c,v 1.3 2019/05/26 13:56:46 jmcneill Exp $"); +__KERNEL_RCSID(1, "$NetBSD: sun9i_a80_ccu.c,v 1.4 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -73,9 +73,9 @@ __KERNEL_RCSID(1, "$NetBSD: sun9i_a80_ccu.c,v 1.3 2019/05/26 13:56:46 jmcneill E static int sun9i_a80_ccu_match(device_t, cfdata_t, void *); static void sun9i_a80_ccu_attach(device_t, device_t, void *); -static const char * compatible[] = { - "allwinner,sun9i-a80-ccu", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "allwinner,sun9i-a80-ccu" }, + DEVICE_COMPAT_EOL }; CFATTACH_DECL_NEW(sunxi_a80_ccu, sizeof(struct sunxi_ccu_softc), @@ -388,7 +388,7 @@ sun9i_a80_ccu_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sunxi/sun9i_a80_cpusclk.c b/sys/arch/arm/sunxi/sun9i_a80_cpusclk.c index 44a4869e1ede..7fb51788ed6f 100644 --- a/sys/arch/arm/sunxi/sun9i_a80_cpusclk.c +++ b/sys/arch/arm/sunxi/sun9i_a80_cpusclk.c @@ -1,4 +1,4 @@ -/* $NetBSD: sun9i_a80_cpusclk.c,v 1.1 2019/05/27 21:12:54 jmcneill Exp $ */ +/* $NetBSD: sun9i_a80_cpusclk.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sun9i_a80_cpusclk.c,v 1.1 2019/05/27 21:12:54 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sun9i_a80_cpusclk.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -85,13 +85,17 @@ struct sun9i_a80_cpusclk_softc { CFATTACH_DECL_NEW(sunxi_a80_cpusclk, sizeof(struct sun9i_a80_cpusclk_softc), sun9i_a80_cpusclk_match, sun9i_a80_cpusclk_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "allwinner,sun9i-a80-cpus-clk" }, + DEVICE_COMPAT_EOL +}; + static int sun9i_a80_cpusclk_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { "allwinner,sun9i-a80-cpus-clk", NULL }; const struct fdt_attach_args *faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sunxi/sun9i_a80_mmcclk.c b/sys/arch/arm/sunxi/sun9i_a80_mmcclk.c index 7da9fb80ef32..a79b6aadda08 100644 --- a/sys/arch/arm/sunxi/sun9i_a80_mmcclk.c +++ b/sys/arch/arm/sunxi/sun9i_a80_mmcclk.c @@ -1,4 +1,4 @@ -/* $NetBSD: sun9i_a80_mmcclk.c,v 1.2 2019/05/28 00:02:32 jmcneill Exp $ */ +/* $NetBSD: sun9i_a80_mmcclk.c,v 1.3 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: sun9i_a80_mmcclk.c,v 1.2 2019/05/28 00:02:32 jmcneill Exp $"); +__KERNEL_RCSID(1, "$NetBSD: sun9i_a80_mmcclk.c,v 1.3 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -44,9 +44,9 @@ __KERNEL_RCSID(1, "$NetBSD: sun9i_a80_mmcclk.c,v 1.2 2019/05/28 00:02:32 jmcneil static int sun9i_a80_mmcclk_match(device_t, cfdata_t, void *); static void sun9i_a80_mmcclk_attach(device_t, device_t, void *); -static const char * compatible[] = { - "allwinner,sun9i-a80-mmc-config-clk", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "allwinner,sun9i-a80-mmc-config-clk" }, + DEVICE_COMPAT_EOL }; CFATTACH_DECL_NEW(sunxi_a80_mmcclk, sizeof(struct sunxi_ccu_softc), @@ -71,7 +71,7 @@ sun9i_a80_mmcclk_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sunxi/sun9i_a80_usbclk.c b/sys/arch/arm/sunxi/sun9i_a80_usbclk.c index 3c85f8fe82ea..713c54beae6a 100644 --- a/sys/arch/arm/sunxi/sun9i_a80_usbclk.c +++ b/sys/arch/arm/sunxi/sun9i_a80_usbclk.c @@ -1,4 +1,4 @@ -/* $NetBSD: sun9i_a80_usbclk.c,v 1.1 2019/05/28 21:56:03 jmcneill Exp $ */ +/* $NetBSD: sun9i_a80_usbclk.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: sun9i_a80_usbclk.c,v 1.1 2019/05/28 21:56:03 jmcneill Exp $"); +__KERNEL_RCSID(1, "$NetBSD: sun9i_a80_usbclk.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -70,9 +70,9 @@ enum { static int sun9i_a80_usbclk_match(device_t, cfdata_t, void *); static void sun9i_a80_usbclk_attach(device_t, device_t, void *); -static const char * compatible[] = { - "allwinner,sun9i-a80-usb-clks", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "allwinner,sun9i-a80-usb-clks" }, + DEVICE_COMPAT_EOL }; CFATTACH_DECL_NEW(sunxi_a80_usbclk, sizeof(struct sunxi_ccu_softc), @@ -110,7 +110,7 @@ sun9i_a80_usbclk_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sunxi/sun9i_a80_usbphy.c b/sys/arch/arm/sunxi/sun9i_a80_usbphy.c index 23e9177a8221..a7fc3b57e6f9 100644 --- a/sys/arch/arm/sunxi/sun9i_a80_usbphy.c +++ b/sys/arch/arm/sunxi/sun9i_a80_usbphy.c @@ -1,4 +1,4 @@ -/* $NetBSD: sun9i_a80_usbphy.c,v 1.1 2019/05/28 21:56:04 jmcneill Exp $ */ +/* $NetBSD: sun9i_a80_usbphy.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: sun9i_a80_usbphy.c,v 1.1 2019/05/28 21:56:04 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sun9i_a80_usbphy.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -54,9 +54,9 @@ __KERNEL_RCSID(0, "$NetBSD: sun9i_a80_usbphy.c,v 1.1 2019/05/28 21:56:04 jmcneil static int sun9i_usbphy_match(device_t, cfdata_t, void *); static void sun9i_usbphy_attach(device_t, device_t, void *); -static const char * compatible[] = { - "allwinner,sun9i-a80-usb-phy", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "allwinner,sun9i-a80-usb-phy" }, + DEVICE_COMPAT_EOL }; struct sun9i_usbphy_softc { @@ -157,7 +157,7 @@ sun9i_usbphy_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sunxi/sunxi_can.c b/sys/arch/arm/sunxi/sunxi_can.c index 97e4ede640b9..f7f6f740efb4 100644 --- a/sys/arch/arm/sunxi/sunxi_can.c +++ b/sys/arch/arm/sunxi/sunxi_can.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_can.c,v 1.7 2021/01/27 02:09:39 thorpej Exp $ */ +/* $NetBSD: sunxi_can.c,v 1.8 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2017,2018 The NetBSD Foundation, Inc. @@ -36,7 +36,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: sunxi_can.c,v 1.7 2021/01/27 02:09:39 thorpej Exp $"); +__KERNEL_RCSID(1, "$NetBSD: sunxi_can.c,v 1.8 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -122,7 +122,7 @@ sunxi_can_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sunxi/sunxi_codec.c b/sys/arch/arm/sunxi/sunxi_codec.c index 184c06941a46..9703b2a22eda 100644 --- a/sys/arch/arm/sunxi/sunxi_codec.c +++ b/sys/arch/arm/sunxi/sunxi_codec.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_codec.c,v 1.11 2021/01/27 02:09:39 thorpej Exp $ */ +/* $NetBSD: sunxi_codec.c,v 1.12 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2014-2017 Jared McNeill @@ -29,7 +29,7 @@ #include "opt_ddb.h" #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_codec.c,v 1.11 2021/01/27 02:09:39 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_codec.c,v 1.12 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -574,7 +574,7 @@ sunxi_codec_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -605,7 +605,7 @@ sunxi_codec_attach(device_t parent, device_t self, void *aux) } sc->sc_dmat = faa->faa_dmat; LIST_INIT(&sc->sc_dmalist); - sc->sc_cfg = of_search_compatible(phandle, compat_data)->data; + sc->sc_cfg = of_compatible_lookup(phandle, compat_data)->data; mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_NONE); mutex_init(&sc->sc_intr_lock, MUTEX_DEFAULT, IPL_SCHED); diff --git a/sys/arch/arm/sunxi/sunxi_de2.c b/sys/arch/arm/sunxi/sunxi_de2.c index 18a43e00951a..db1fb8534b88 100644 --- a/sys/arch/arm/sunxi/sunxi_de2.c +++ b/sys/arch/arm/sunxi/sunxi_de2.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_de2.c,v 1.1 2019/01/22 20:17:36 jmcneill Exp $ */ +/* $NetBSD: sunxi_de2.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_de2.c,v 1.1 2019/01/22 20:17:36 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_de2.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -39,9 +39,9 @@ __KERNEL_RCSID(0, "$NetBSD: sunxi_de2.c,v 1.1 2019/01/22 20:17:36 jmcneill Exp $ #include -static const char * compatible[] = { - "allwinner,sun50i-a64-de2", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "allwinner,sun50i-a64-de2" }, + DEVICE_COMPAT_EOL }; static int @@ -49,7 +49,7 @@ sunxi_de2_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sunxi/sunxi_de2_ccu.c b/sys/arch/arm/sunxi/sunxi_de2_ccu.c index 6c7210e61147..deab3a202959 100644 --- a/sys/arch/arm/sunxi/sunxi_de2_ccu.c +++ b/sys/arch/arm/sunxi/sunxi_de2_ccu.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_de2_ccu.c,v 1.6 2021/01/27 02:09:39 thorpej Exp $ */ +/* $NetBSD: sunxi_de2_ccu.c,v 1.7 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: sunxi_de2_ccu.c,v 1.6 2021/01/27 02:09:39 thorpej Exp $"); +__KERNEL_RCSID(1, "$NetBSD: sunxi_de2_ccu.c,v 1.7 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -113,7 +113,7 @@ sunxi_de2_ccu_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -130,7 +130,7 @@ sunxi_de2_ccu_attach(device_t parent, device_t self, void *aux) sc->sc_phandle = phandle; sc->sc_bst = faa->faa_bst; - conf = of_search_compatible(phandle, compat_data)->data; + conf = of_compatible_lookup(phandle, compat_data)->data; sc->sc_resets = conf->resets; sc->sc_nresets = conf->nresets; diff --git a/sys/arch/arm/sunxi/sunxi_debe.c b/sys/arch/arm/sunxi/sunxi_debe.c index da4e80d20b8f..444c50eb2555 100644 --- a/sys/arch/arm/sunxi/sunxi_debe.c +++ b/sys/arch/arm/sunxi/sunxi_debe.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_debe.c,v 1.11 2021/01/18 02:35:49 thorpej Exp $ */ +/* $NetBSD: sunxi_debe.c,v 1.12 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2018 Manuel Bouyer @@ -38,7 +38,7 @@ #define SUNXI_DEBE_CURMAX 64 #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_debe.c,v 1.11 2021/01/18 02:35:49 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_debe.c,v 1.12 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -104,8 +104,7 @@ struct sunxi_debe_softc { static const struct device_compatible_entry compat_data[] = { { .compat = "allwinner,sun4i-a10-display-backend", .value = DEBE_A10 }, { .compat = "allwinner,sun7i-a20-display-backend", .value = DEBE_A10 }, - - { 0 } + DEVICE_COMPAT_EOL }; struct sunxifb_attach_args { @@ -144,7 +143,7 @@ sunxi_debe_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -190,7 +189,7 @@ sunxi_debe_attach(device_t parent, device_t self, void *aux) } sc->sc_type = - of_search_compatible(faa->faa_phandle, compat_data)->value; + of_compatible_lookup(faa->faa_phandle, compat_data)->value; aprint_naive("\n"); aprint_normal(": Display Engine Backend (%s)\n", @@ -920,15 +919,15 @@ sunxi_debe_pipeline(int phandle, bool active) * But we want to record the /chose/framebuffer phandle if there is one */ -static const char * const simplefb_compatible[] = { - "allwinner,simple-framebuffer", - NULL +static const struct device_compatible_entry simplefb_compat_data[] = { + { .compat = "allwinner,simple-framebuffer" }, + DEVICE_COMPAT_EOL }; static int sunxidebe_console_match(int phandle) { - if (of_match_compatible(phandle, simplefb_compatible)) { + if (of_compatible_match(phandle, simplefb_compat_data)) { sunxi_simplefb_phandle = phandle; } return 0; diff --git a/sys/arch/arm/sunxi/sunxi_dep.c b/sys/arch/arm/sunxi/sunxi_dep.c index 3d409abb79c3..44e1c163fd42 100644 --- a/sys/arch/arm/sunxi/sunxi_dep.c +++ b/sys/arch/arm/sunxi/sunxi_dep.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_dep.c,v 1.6 2021/01/27 02:09:39 thorpej Exp $ */ +/* $NetBSD: sunxi_dep.c,v 1.7 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: sunxi_dep.c,v 1.6 2021/01/27 02:09:39 thorpej Exp $"); +__KERNEL_RCSID(1, "$NetBSD: sunxi_dep.c,v 1.7 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -74,7 +74,7 @@ sunxi_dep_match(device_t parent, cfdata_t cf, void *aux) #if NSUNXI_DEBE > 0 struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); #else return 0; #endif diff --git a/sys/arch/arm/sunxi/sunxi_drm.c b/sys/arch/arm/sunxi/sunxi_drm.c index 1927bc6fcbf1..459919bcb70d 100644 --- a/sys/arch/arm/sunxi/sunxi_drm.c +++ b/sys/arch/arm/sunxi/sunxi_drm.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_drm.c,v 1.11 2019/12/16 12:40:17 jmcneill Exp $ */ +/* $NetBSD: sunxi_drm.c,v 1.12 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_drm.c,v 1.11 2019/12/16 12:40:17 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_drm.c,v 1.12 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -64,10 +64,10 @@ __KERNEL_RCSID(0, "$NetBSD: sunxi_drm.c,v 1.11 2019/12/16 12:40:17 jmcneill Exp static TAILQ_HEAD(, sunxi_drm_endpoint) sunxi_drm_endpoints = TAILQ_HEAD_INITIALIZER(sunxi_drm_endpoints); -static const char * const compatible[] = { - "allwinner,sun8i-h3-display-engine", - "allwinner,sun50i-a64-display-engine", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "allwinner,sun8i-h3-display-engine" }, + { .compat = "allwinner,sun50i-a64-display-engine " }, + DEVICE_COMPAT_EOL }; static const char * fb_compatible[] = { @@ -126,7 +126,7 @@ sunxi_drm_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -306,7 +306,10 @@ static struct drm_mode_config_funcs sunxi_drm_mode_config_funcs = { static int sunxi_drm_simplefb_lookup(bus_addr_t *paddr, bus_size_t *psize) { - static const char * compat[] = { "simple-framebuffer", NULL }; + static const struct device_compatible_entry simplefb_compat[] = { + { .compat = "simple-framebuffer" }, + DEVICE_COMPAT_EOL + }; int chosen, child, error; bus_addr_t addr_end; @@ -317,7 +320,7 @@ sunxi_drm_simplefb_lookup(bus_addr_t *paddr, bus_size_t *psize) for (child = OF_child(chosen); child; child = OF_peer(child)) { if (!fdtbus_status_okay(child)) continue; - if (!of_match_compatible(child, compat)) + if (!of_compatible_match(child, simplefb_compat)) continue; error = fdtbus_get_reg(child, 0, paddr, psize); if (error != 0) diff --git a/sys/arch/arm/sunxi/sunxi_dwhdmi.c b/sys/arch/arm/sunxi/sunxi_dwhdmi.c index e0faa5b5ee39..ed262a02cf74 100644 --- a/sys/arch/arm/sunxi/sunxi_dwhdmi.c +++ b/sys/arch/arm/sunxi/sunxi_dwhdmi.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_dwhdmi.c,v 1.8 2019/11/24 10:27:37 jmcneill Exp $ */ +/* $NetBSD: sunxi_dwhdmi.c,v 1.9 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_dwhdmi.c,v 1.8 2019/11/24 10:27:37 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_dwhdmi.c,v 1.9 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -51,10 +51,10 @@ enum { DWHDMI_PORT_OUTPUT = 1, }; -static const char * const compatible[] = { - "allwinner,sun8i-h3-dw-hdmi", - "allwinner,sun50i-a64-dw-hdmi", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "allwinner,sun8i-h3-dw-hdmi" }, + { .compat = "allwinner,sun50i-a64-dw-hdmi" }, + DEVICE_COMPAT_EOL }; struct sunxi_dwhdmi_softc { @@ -220,7 +220,7 @@ sunxi_dwhdmi_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sunxi/sunxi_emac.c b/sys/arch/arm/sunxi/sunxi_emac.c index 503745dc2d44..1d088c005d59 100644 --- a/sys/arch/arm/sunxi/sunxi_emac.c +++ b/sys/arch/arm/sunxi/sunxi_emac.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_emac.c,v 1.32 2021/01/27 02:09:39 thorpej Exp $ */ +/* $NetBSD: sunxi_emac.c,v 1.33 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2016-2017 Jared McNeill @@ -33,7 +33,7 @@ #include "opt_net_mpsafe.h" #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_emac.c,v 1.32 2021/01/27 02:09:39 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_emac.c,v 1.33 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -968,7 +968,7 @@ sunxi_emac_has_internal_phy(struct sunxi_emac_softc *sc) return false; /* For internal PHY, check compatible string of parent node */ - return of_match_compat_data(OF_parent(phy), mdio_internal_compat); + return of_compatible_match(OF_parent(phy), mdio_internal_compat); } static int @@ -1355,7 +1355,7 @@ sunxi_emac_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -1373,7 +1373,7 @@ sunxi_emac_attach(device_t parent, device_t self, void *aux) sc->phandle = phandle; sc->bst = faa->faa_bst; sc->dmat = faa->faa_dmat; - sc->type = of_search_compatible(phandle, compat_data)->value; + sc->type = of_compatible_lookup(phandle, compat_data)->value; sc->phy_id = sunxi_emac_get_phyid(sc); aprint_naive("\n"); diff --git a/sys/arch/arm/sunxi/sunxi_gates.c b/sys/arch/arm/sunxi/sunxi_gates.c index e27040072d47..9d965b5d9f4e 100644 --- a/sys/arch/arm/sunxi/sunxi_gates.c +++ b/sys/arch/arm/sunxi/sunxi_gates.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_gates.c,v 1.3 2019/05/26 14:14:27 jmcneill Exp $ */ +/* $NetBSD: sunxi_gates.c,v 1.4 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_gates.c,v 1.3 2019/05/26 14:14:27 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_gates.c,v 1.4 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -42,10 +42,10 @@ __KERNEL_RCSID(0, "$NetBSD: sunxi_gates.c,v 1.3 2019/05/26 14:14:27 jmcneill Exp #define GATE_REG(index) (((index) / 32) * 4) #define GATE_MASK(index) __BIT((index) % 32) -static const char * compatible[] = { - "allwinner,sun4i-a10-gates-clk", - "allwinner,sun9i-a80-apbs-gates-clk", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "allwinner,sun4i-a10-gates-clk" }, + { .compat = "allwinner,sun9i-a80-apbs-gates-clk" }, + DEVICE_COMPAT_EOL }; struct sunxi_gate { @@ -207,7 +207,7 @@ sunxi_gates_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sunxi/sunxi_gmac.c b/sys/arch/arm/sunxi/sunxi_gmac.c index 918c6c7da867..8f107a35146f 100644 --- a/sys/arch/arm/sunxi/sunxi_gmac.c +++ b/sys/arch/arm/sunxi/sunxi_gmac.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_gmac.c,v 1.8 2021/01/15 22:47:32 jmcneill Exp $ */ +/* $NetBSD: sunxi_gmac.c,v 1.9 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_gmac.c,v 1.8 2021/01/15 22:47:32 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_gmac.c,v 1.9 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -52,9 +52,9 @@ __KERNEL_RCSID(0, "$NetBSD: sunxi_gmac.c,v 1.8 2021/01/15 22:47:32 jmcneill Exp #define GMAC_TX_RATE_MII 25000000 #define GMAC_TX_RATE_RGMII 125000000 -static const char * compatible[] = { - "allwinner,sun7i-a20-gmac", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "allwinner,sun7i-a20-gmac" }, + DEVICE_COMPAT_EOL }; static int @@ -116,7 +116,7 @@ sunxi_gmac_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sunxi/sunxi_gmacclk.c b/sys/arch/arm/sunxi/sunxi_gmacclk.c index 508dd40b8d0f..bbeec92ed66b 100644 --- a/sys/arch/arm/sunxi/sunxi_gmacclk.c +++ b/sys/arch/arm/sunxi/sunxi_gmacclk.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_gmacclk.c,v 1.2 2018/09/09 07:21:18 aymeric Exp $ */ +/* $NetBSD: sunxi_gmacclk.c,v 1.3 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_gmacclk.c,v 1.2 2018/09/09 07:21:18 aymeric Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_gmacclk.c,v 1.3 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -89,13 +89,17 @@ struct sunxi_gmacclk_softc { CFATTACH_DECL_NEW(sunxi_gmacclk, sizeof(struct sunxi_gmacclk_softc), sunxi_gmacclk_match, sunxi_gmacclk_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "allwinner,sun7i-a20-gmac-clk" }, + DEVICE_COMPAT_EOL +}; + static int sunxi_gmacclk_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { "allwinner,sun7i-a20-gmac-clk", NULL }; const struct fdt_attach_args *faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sunxi/sunxi_gpio.c b/sys/arch/arm/sunxi/sunxi_gpio.c index 73af4a121f37..54a22e6d77d9 100644 --- a/sys/arch/arm/sunxi/sunxi_gpio.c +++ b/sys/arch/arm/sunxi/sunxi_gpio.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_gpio.c,v 1.34 2021/01/27 02:09:39 thorpej Exp $ */ +/* $NetBSD: sunxi_gpio.c,v 1.35 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -29,7 +29,7 @@ #include "opt_soc.h" #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_gpio.c,v 1.34 2021/01/27 02:09:39 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_gpio.c,v 1.35 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -980,7 +980,7 @@ sunxi_gpio_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -1021,7 +1021,7 @@ sunxi_gpio_attach(device_t parent, device_t self, void *aux) return; } mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_VM); - sc->sc_padconf = of_search_compatible(phandle, compat_data)->data; + sc->sc_padconf = of_compatible_lookup(phandle, compat_data)->data; aprint_naive("\n"); aprint_normal(": PIO\n"); diff --git a/sys/arch/arm/sunxi/sunxi_hdmi.c b/sys/arch/arm/sunxi/sunxi_hdmi.c index cfce99db47db..184c1b08816b 100644 --- a/sys/arch/arm/sunxi/sunxi_hdmi.c +++ b/sys/arch/arm/sunxi/sunxi_hdmi.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_hdmi.c,v 1.13 2021/01/27 02:09:39 thorpej Exp $ */ +/* $NetBSD: sunxi_hdmi.c,v 1.14 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2014 Jared D. McNeill @@ -29,7 +29,7 @@ #include "opt_ddb.h" #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_hdmi.c,v 1.13 2021/01/27 02:09:39 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_hdmi.c,v 1.14 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -152,7 +152,7 @@ sunxi_hdmi_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -170,7 +170,7 @@ sunxi_hdmi_attach(device_t parent, device_t self, void *aux) sc->sc_bst = faa->faa_bst; sc->sc_type = - of_search_compatible(faa->faa_phandle, compat_data)->value; + of_compatible_lookup(faa->faa_phandle, compat_data)->value; if (fdtbus_get_reg(phandle, 0, &addr, &size) != 0) { aprint_error(": couldn't get registers\n"); diff --git a/sys/arch/arm/sunxi/sunxi_hdmiphy.c b/sys/arch/arm/sunxi/sunxi_hdmiphy.c index 6ecc971b984c..a1b482b9bc5b 100644 --- a/sys/arch/arm/sunxi/sunxi_hdmiphy.c +++ b/sys/arch/arm/sunxi/sunxi_hdmiphy.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_hdmiphy.c,v 1.7 2021/01/27 02:09:39 thorpej Exp $ */ +/* $NetBSD: sunxi_hdmiphy.c,v 1.8 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_hdmiphy.c,v 1.7 2021/01/27 02:09:39 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_hdmiphy.c,v 1.8 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -397,7 +397,7 @@ sunxi_hdmiphy_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -431,7 +431,7 @@ sunxi_hdmiphy_attach(device_t parent, device_t self, void *aux) sc->sc_dev = self; sc->sc_bst = faa->faa_bst; - sc->sc_data = of_search_compatible(phandle, compat_data)->data; + sc->sc_data = of_compatible_lookup(phandle, compat_data)->data; if (bus_space_map(sc->sc_bst, addr, size, 0, &sc->sc_bsh) != 0) { aprint_error(": couldn't map registers\n"); return; diff --git a/sys/arch/arm/sunxi/sunxi_hstimer.c b/sys/arch/arm/sunxi/sunxi_hstimer.c index c0396773581a..4cc10fd84e72 100644 --- a/sys/arch/arm/sunxi/sunxi_hstimer.c +++ b/sys/arch/arm/sunxi/sunxi_hstimer.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_hstimer.c,v 1.3 2021/01/15 22:47:32 jmcneill Exp $ */ +/* $NetBSD: sunxi_hstimer.c,v 1.4 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2019 Tobias Nygren @@ -28,7 +28,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_hstimer.c,v 1.3 2021/01/15 22:47:32 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_hstimer.c,v 1.4 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -77,11 +77,11 @@ __KERNEL_RCSID(0, "$NetBSD: sunxi_hstimer.c,v 1.3 2021/01/15 22:47:32 jmcneill E #define HS_TMR3_CURNT_LO_REG 0x7c #define HS_TMR3_CURNT_HI_REG 0x80 -static const char * const compatible[] = { - "allwinner,sun5i-a13-hstimer", - "allwinner,sun6i-a31-hstimer", - "allwinner,sun7i-a20-hstimer", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "allwinner,sun5i-a13-hstimer" }, + { .compat = "allwinner,sun6i-a31-hstimer" }, + { .compat = "allwinner,sun7i-a20-hstimer" }, + DEVICE_COMPAT_EOL }; struct sunxi_hstimer_softc { @@ -129,7 +129,7 @@ sunxi_hstimer_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sunxi/sunxi_i2s.c b/sys/arch/arm/sunxi/sunxi_i2s.c index 621b203a9cda..b9da0b84dd8a 100644 --- a/sys/arch/arm/sunxi/sunxi_i2s.c +++ b/sys/arch/arm/sunxi/sunxi_i2s.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_i2s.c,v 1.11 2021/01/27 02:09:39 thorpej Exp $ */ +/* $NetBSD: sunxi_i2s.c,v 1.12 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2018 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_i2s.c,v 1.11 2021/01/27 02:09:39 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_i2s.c,v 1.12 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -860,7 +860,7 @@ sunxi_i2s_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -888,7 +888,7 @@ sunxi_i2s_attach(device_t parent, device_t self, void *aux) } sc->sc_dmat = faa->faa_dmat; LIST_INIT(&sc->sc_dmalist); - sc->sc_cfg = of_search_compatible(phandle, compat_data)->data; + sc->sc_cfg = of_compatible_lookup(phandle, compat_data)->data; mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_NONE); mutex_init(&sc->sc_intr_lock, MUTEX_DEFAULT, IPL_SCHED); diff --git a/sys/arch/arm/sunxi/sunxi_intc.c b/sys/arch/arm/sunxi/sunxi_intc.c index 7082c87e303c..8de6ed923fd8 100644 --- a/sys/arch/arm/sunxi/sunxi_intc.c +++ b/sys/arch/arm/sunxi/sunxi_intc.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_intc.c,v 1.6 2021/01/15 00:38:23 jmcneill Exp $ */ +/* $NetBSD: sunxi_intc.c,v 1.7 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -29,7 +29,7 @@ #define _INTR_PRIVATE #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_intc.c,v 1.6 2021/01/15 00:38:23 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_intc.c,v 1.7 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -62,9 +62,9 @@ __KERNEL_RCSID(0, "$NetBSD: sunxi_intc.c,v 1.6 2021/01/15 00:38:23 jmcneill Exp #define INTC_FORCE_REG(n) (0x70 + ((n) * 4)) #define INTC_SRC_PRIO_REG(n) (0x80 + ((n) * 4)) -static const char * const compatible[] = { - "allwinner,sun4i-a10-ic", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "allwinner,sun4i-a10-ic" }, + DEVICE_COMPAT_EOL }; struct sunxi_intc_softc { @@ -218,7 +218,7 @@ sunxi_intc_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sunxi/sunxi_lcdc.c b/sys/arch/arm/sunxi/sunxi_lcdc.c index 937d45c85bc8..cc2735b3b598 100644 --- a/sys/arch/arm/sunxi/sunxi_lcdc.c +++ b/sys/arch/arm/sunxi/sunxi_lcdc.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_lcdc.c,v 1.11 2021/01/27 02:09:39 thorpej Exp $ */ +/* $NetBSD: sunxi_lcdc.c,v 1.12 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_lcdc.c,v 1.11 2021/01/27 02:09:39 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_lcdc.c,v 1.12 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -467,7 +467,7 @@ sunxi_lcdc_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -512,7 +512,7 @@ sunxi_lcdc_attach(device_t parent, device_t self, void *aux) return; } sc->sc_phandle = faa->faa_phandle; - sc->sc_type = of_search_compatible(phandle, compat_data)->value; + sc->sc_type = of_compatible_lookup(phandle, compat_data)->value; sc->sc_clk_ch[0] = fdtbus_clock_get(phandle, "tcon-ch0"); sc->sc_clk_ch[1] = fdtbus_clock_get(phandle, "tcon-ch1"); diff --git a/sys/arch/arm/sunxi/sunxi_lradc.c b/sys/arch/arm/sunxi/sunxi_lradc.c index b721ff2677c8..9c18699253c0 100644 --- a/sys/arch/arm/sunxi/sunxi_lradc.c +++ b/sys/arch/arm/sunxi/sunxi_lradc.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_lradc.c,v 1.5 2021/01/27 02:09:39 thorpej Exp $ */ +/* $NetBSD: sunxi_lradc.c,v 1.6 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2016, 2018 Manuel Bouyer @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_lradc.c,v 1.5 2021/01/27 02:09:39 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_lradc.c,v 1.6 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -89,7 +89,7 @@ sunxi_lradc_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sunxi/sunxi_mixer.c b/sys/arch/arm/sunxi/sunxi_mixer.c index c4cdf3703a5b..eae45f38c0e4 100644 --- a/sys/arch/arm/sunxi/sunxi_mixer.c +++ b/sys/arch/arm/sunxi/sunxi_mixer.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_mixer.c,v 1.15 2021/01/27 02:09:39 thorpej Exp $ */ +/* $NetBSD: sunxi_mixer.c,v 1.16 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_mixer.c,v 1.15 2021/01/27 02:09:39 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_mixer.c,v 1.16 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -1249,7 +1249,7 @@ sunxi_mixer_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -1260,7 +1260,7 @@ sunxi_mixer_attach(device_t parent, device_t self, void *aux) struct fdt_endpoint *out_ep; const int phandle = faa->faa_phandle; const struct sunxi_mixer_compat_data * const cd = - of_search_compatible(phandle, compat_data)->data; + of_compatible_lookup(phandle, compat_data)->data; struct clk *clk_bus, *clk_mod; struct fdtbus_reset *rst; bus_addr_t addr; diff --git a/sys/arch/arm/sunxi/sunxi_mmc.c b/sys/arch/arm/sunxi/sunxi_mmc.c index 61a00a82047c..1d5ac536ad5f 100644 --- a/sys/arch/arm/sunxi/sunxi_mmc.c +++ b/sys/arch/arm/sunxi/sunxi_mmc.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_mmc.c,v 1.45 2021/01/27 02:09:39 thorpej Exp $ */ +/* $NetBSD: sunxi_mmc.c,v 1.46 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2014-2017 Jared McNeill @@ -29,7 +29,7 @@ #include "opt_sunximmc.h" #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_mmc.c,v 1.45 2021/01/27 02:09:39 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_mmc.c,v 1.46 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -307,7 +307,7 @@ sunxi_mmc_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -359,7 +359,7 @@ sunxi_mmc_attach(device_t parent, device_t self, void *aux) sc->sc_dev = self; sc->sc_phandle = phandle; - sc->sc_config = of_search_compatible(phandle, compat_data)->data; + sc->sc_config = of_compatible_lookup(phandle, compat_data)->data; sc->sc_bst = faa->faa_bst; sc->sc_dmat = faa->faa_dmat; mutex_init(&sc->sc_intr_lock, MUTEX_DEFAULT, IPL_BIO); diff --git a/sys/arch/arm/sunxi/sunxi_musb.c b/sys/arch/arm/sunxi/sunxi_musb.c index b2f430385f41..65b8b28d1371 100644 --- a/sys/arch/arm/sunxi/sunxi_musb.c +++ b/sys/arch/arm/sunxi/sunxi_musb.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_musb.c,v 1.9 2021/01/27 02:09:39 thorpej Exp $ */ +/* $NetBSD: sunxi_musb.c,v 1.10 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_musb.c,v 1.9 2021/01/27 02:09:39 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_musb.c,v 1.10 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -294,7 +294,7 @@ sunxi_musb_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -370,7 +370,7 @@ sunxi_musb_attach(device_t parent, device_t self, void *aux) sc->sc_intr_poll = sunxi_musb_poll; sc->sc_intr_poll_arg = sc; sc->sc_mode = MOTG_MODE_HOST; - sc->sc_ep_max = of_search_compatible(phandle, compat_data)->value; + sc->sc_ep_max = of_compatible_lookup(phandle, compat_data)->value; sc->sc_ep_fifosize = 512; aprint_naive("\n"); diff --git a/sys/arch/arm/sunxi/sunxi_nand.c b/sys/arch/arm/sunxi/sunxi_nand.c index 7a5ebd17950d..5fbf6cae35d4 100644 --- a/sys/arch/arm/sunxi/sunxi_nand.c +++ b/sys/arch/arm/sunxi/sunxi_nand.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_nand.c,v 1.9 2021/01/15 22:47:32 jmcneill Exp $ */ +/* $NetBSD: sunxi_nand.c,v 1.10 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_nand.c,v 1.9 2021/01/15 22:47:32 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_nand.c,v 1.10 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -93,9 +93,9 @@ __KERNEL_RCSID(0, "$NetBSD: sunxi_nand.c,v 1.9 2021/01/15 22:47:32 jmcneill Exp #define NDFC_RAM_SIZE 1024 -static const char * compatible[] = { - "allwinner,sun4i-a10-nand", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "allwinner,sun4i-a10-nand" }, + DEVICE_COMPAT_EOL }; struct sunxi_nand_softc; @@ -631,7 +631,7 @@ sunxi_nand_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sunxi/sunxi_nmi.c b/sys/arch/arm/sunxi/sunxi_nmi.c index e5922c19bb7a..88cd825710e4 100644 --- a/sys/arch/arm/sunxi/sunxi_nmi.c +++ b/sys/arch/arm/sunxi/sunxi_nmi.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_nmi.c,v 1.10 2021/01/27 02:09:39 thorpej Exp $ */ +/* $NetBSD: sunxi_nmi.c,v 1.11 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2018 Jared McNeill @@ -29,7 +29,7 @@ #define _INTR_PRIVATE #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_nmi.c,v 1.10 2021/01/27 02:09:39 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_nmi.c,v 1.11 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -314,7 +314,7 @@ sunxi_nmi_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -334,7 +334,7 @@ sunxi_nmi_attach(device_t parent, device_t self, void *aux) sc->sc_dev = self; sc->sc_phandle = phandle; - sc->sc_config = of_search_compatible(phandle, compat_data)->data; + sc->sc_config = of_compatible_lookup(phandle, compat_data)->data; sc->sc_bst = faa->faa_bst; if (bus_space_map(sc->sc_bst, addr, size, 0, &sc->sc_bsh) != 0) { aprint_error(": couldn't map registers\n"); diff --git a/sys/arch/arm/sunxi/sunxi_platform.c b/sys/arch/arm/sunxi/sunxi_platform.c index 7fbef0c1b5b6..57fe61d7a6a9 100644 --- a/sys/arch/arm/sunxi/sunxi_platform.c +++ b/sys/arch/arm/sunxi/sunxi_platform.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_platform.c,v 1.40 2020/09/28 11:54:23 jmcneill Exp $ */ +/* $NetBSD: sunxi_platform.c,v 1.41 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -31,7 +31,7 @@ #include "opt_console.h" #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_platform.c,v 1.40 2020/09/28 11:54:23 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_platform.c,v 1.41 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -204,25 +204,25 @@ sunxi_platform_device_register(device_t self, void *aux) if (device_is_a(self, "rgephy")) { /* Pine64+ and NanoPi NEO Plus2 gigabit ethernet workaround */ - const char * compat[] = { - "pine64,pine64-plus", - "friendlyarm,nanopi-neo-plus2", - NULL + static const struct device_compatible_entry compat_data[] = { + { .compat = "pine64,pine64-plus" }, + { .compat = "friendlyarm,nanopi-neo-plus2" }, + DEVICE_COMPAT_EOL }; - if (of_match_compatible(OF_finddevice("/"), compat)) { + if (of_compatible_match(OF_finddevice("/"), compat_data)) { prop_dictionary_set_bool(prop, "no-rx-delay", true); } } if (device_is_a(self, "armgtmr")) { /* Allwinner A64 has an unstable architectural timer */ - const char * compat[] = { - "allwinner,sun50i-a64", + static const struct device_compatible_entry compat_data[] = { + { .compat = "allwinner,sun50i-a64" }, /* Cubietruck Plus triggers this problem as well. */ - "allwinner,sun8i-a83t", - NULL + { .compat = "allwinner,sun8i-a83t" }, + DEVICE_COMPAT_EOL }; - if (of_match_compatible(OF_finddevice("/"), compat)) { + if (of_compatible_match(OF_finddevice("/"), compat_data)) { prop_dictionary_set_bool(prop, "sun50i-a64-unstable-timer", true); } } diff --git a/sys/arch/arm/sunxi/sunxi_pwm.c b/sys/arch/arm/sunxi/sunxi_pwm.c index 57d9a8e85cf9..962dff40f496 100644 --- a/sys/arch/arm/sunxi/sunxi_pwm.c +++ b/sys/arch/arm/sunxi/sunxi_pwm.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_pwm.c,v 1.6 2021/01/27 02:09:39 thorpej Exp $ */ +/* $NetBSD: sunxi_pwm.c,v 1.7 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2018 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: sunxi_pwm.c,v 1.6 2021/01/27 02:09:39 thorpej Exp $"); +__KERNEL_RCSID(1, "$NetBSD: sunxi_pwm.c,v 1.7 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -183,7 +183,7 @@ sunxi_pwm_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sunxi/sunxi_resets.c b/sys/arch/arm/sunxi/sunxi_resets.c index b9a100e05233..392f59fcb5de 100644 --- a/sys/arch/arm/sunxi/sunxi_resets.c +++ b/sys/arch/arm/sunxi/sunxi_resets.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_resets.c,v 1.1 2017/07/08 11:12:24 jmcneill Exp $ */ +/* $NetBSD: sunxi_resets.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_resets.c,v 1.1 2017/07/08 11:12:24 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_resets.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -41,9 +41,9 @@ __KERNEL_RCSID(0, "$NetBSD: sunxi_resets.c,v 1.1 2017/07/08 11:12:24 jmcneill Ex #define RESET_REG(index) (((index) / 32) * 4) #define RESET_MASK(index) __BIT((index) % 32) -static const char * compatible[] = { - "allwinner,sun6i-a31-clock-reset", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "allwinner,sun6i-a31-clock-reset" }, + DEVICE_COMPAT_EOL }; struct sunxi_resets_softc { @@ -114,7 +114,7 @@ sunxi_resets_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sunxi/sunxi_rsb.c b/sys/arch/arm/sunxi/sunxi_rsb.c index f1857e32e225..6427476c0939 100644 --- a/sys/arch/arm/sunxi/sunxi_rsb.c +++ b/sys/arch/arm/sunxi/sunxi_rsb.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_rsb.c,v 1.13 2021/01/27 02:09:39 thorpej Exp $ */ +/* $NetBSD: sunxi_rsb.c,v 1.14 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2014-2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_rsb.c,v 1.13 2021/01/27 02:09:39 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_rsb.c,v 1.14 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -119,7 +119,7 @@ sunxi_rsb_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -156,7 +156,7 @@ sunxi_rsb_attach(device_t parent, device_t self, void *aux) } sc->sc_dev = self; - sc->sc_type = of_search_compatible(phandle, compat_data)->value; + sc->sc_type = of_compatible_lookup(phandle, compat_data)->value; sc->sc_bst = faa->faa_bst; if (bus_space_map(sc->sc_bst, addr, size, 0, &sc->sc_bsh) != 0) { aprint_error(": couldn't map registers\n"); diff --git a/sys/arch/arm/sunxi/sunxi_rtc.c b/sys/arch/arm/sunxi/sunxi_rtc.c index 2ba5eb320581..7dc9e666c3c6 100644 --- a/sys/arch/arm/sunxi/sunxi_rtc.c +++ b/sys/arch/arm/sunxi/sunxi_rtc.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_rtc.c,v 1.9 2021/01/27 02:09:39 thorpej Exp $ */ +/* $NetBSD: sunxi_rtc.c,v 1.10 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2014-2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_rtc.c,v 1.9 2021/01/27 02:09:39 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_rtc.c,v 1.10 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -361,7 +361,7 @@ sunxi_rtc_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -386,7 +386,7 @@ sunxi_rtc_attach(device_t parent, device_t self, void *aux) aprint_error(": couldn't map registers\n"); return; } - sc->sc_conf = of_search_compatible(phandle, compat_data)->data; + sc->sc_conf = of_compatible_lookup(phandle, compat_data)->data; aprint_naive("\n"); aprint_normal(": RTC\n"); diff --git a/sys/arch/arm/sunxi/sunxi_sata.c b/sys/arch/arm/sunxi/sunxi_sata.c index 1123e65a223b..9f589e743dd8 100644 --- a/sys/arch/arm/sunxi/sunxi_sata.c +++ b/sys/arch/arm/sunxi/sunxi_sata.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_sata.c,v 1.3 2021/01/15 22:47:32 jmcneill Exp $ */ +/* $NetBSD: sunxi_sata.c,v 1.4 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_sata.c,v 1.3 2021/01/15 22:47:32 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_sata.c,v 1.4 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -41,9 +41,9 @@ __KERNEL_RCSID(0, "$NetBSD: sunxi_sata.c,v 1.3 2021/01/15 22:47:32 jmcneill Exp #include -static const char * compatible[] = { - "allwinner,sun4i-a10-ahci", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "allwinner,sun4i-a10-ahci" }, + DEVICE_COMPAT_EOL }; #define SUNXI_SATA_DMACR(port) (0x170 + AHCI_P_OFFSET(port)) @@ -65,7 +65,7 @@ sunxi_sata_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sunxi/sunxi_sid.c b/sys/arch/arm/sunxi/sunxi_sid.c index d702ea3fadc8..8f126b27f27c 100644 --- a/sys/arch/arm/sunxi/sunxi_sid.c +++ b/sys/arch/arm/sunxi/sunxi_sid.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_sid.c,v 1.6 2021/01/27 02:09:39 thorpej Exp $ */ +/* $NetBSD: sunxi_sid.c,v 1.7 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_sid.c,v 1.6 2021/01/27 02:09:39 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_sid.c,v 1.7 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -82,7 +82,7 @@ sunxi_sid_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -105,7 +105,7 @@ sunxi_sid_attach(device_t parent, device_t self, void *aux) aprint_error(": couldn't map registers\n"); return; } - sc->sc_conf = of_search_compatible(phandle, compat_data)->data; + sc->sc_conf = of_compatible_lookup(phandle, compat_data)->data; aprint_naive("\n"); aprint_normal(": Security ID EFUSE\n"); diff --git a/sys/arch/arm/sunxi/sunxi_sramc.c b/sys/arch/arm/sunxi/sunxi_sramc.c index 7d1677fdb96c..759d8ad93d84 100644 --- a/sys/arch/arm/sunxi/sunxi_sramc.c +++ b/sys/arch/arm/sunxi/sunxi_sramc.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_sramc.c,v 1.10 2021/01/27 02:09:39 thorpej Exp $ */ +/* $NetBSD: sunxi_sramc.c,v 1.11 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_sramc.c,v 1.10 2021/01/27 02:09:39 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_sramc.c,v 1.11 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -126,7 +126,7 @@ sunxi_sramc_init_mmio(struct sunxi_sramc_softc *sc, int phandle) int child; for (child = OF_child(phandle); child; child = OF_peer(child)) { - dce = of_search_compatible(child, sunxi_sramc_areas); + dce = of_compatible_lookup(child, sunxi_sramc_areas); if (dce != NULL) { node = kmem_alloc(sizeof(*node), KM_SLEEP); node->phandle = child; @@ -148,7 +148,7 @@ sunxi_sramc_init(struct sunxi_sramc_softc *sc) int child; for (child = OF_child(sc->sc_phandle); child; child = OF_peer(child)) { - if (!of_match_compat_data(child, mmio_compat_data)) + if (!of_compatible_match(child, mmio_compat_data)) continue; sunxi_sramc_init_mmio(sc, child); } @@ -195,7 +195,7 @@ sunxi_sramc_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sunxi/sunxi_tcon.c b/sys/arch/arm/sunxi/sunxi_tcon.c index 800a46d66564..fc0f40797811 100644 --- a/sys/arch/arm/sunxi/sunxi_tcon.c +++ b/sys/arch/arm/sunxi/sunxi_tcon.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_tcon.c,v 1.10 2021/01/27 02:09:39 thorpej Exp $ */ +/* $NetBSD: sunxi_tcon.c,v 1.11 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2018 Manuel Bouyer @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_tcon.c,v 1.10 2021/01/27 02:09:39 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_tcon.c,v 1.11 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -110,7 +110,7 @@ sunxi_tcon_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -157,7 +157,7 @@ sunxi_tcon_attach(device_t parent, device_t self, void *aux) sc->sc_lvds_rst = fdtbus_reset_get(phandle, "lvds"); sc->sc_type = - of_search_compatible(faa->faa_phandle, compat_data)->value; + of_compatible_lookup(faa->faa_phandle, compat_data)->value; aprint_naive("\n"); aprint_normal(": LCD/TV timing controller (%s)\n", diff --git a/sys/arch/arm/sunxi/sunxi_thermal.c b/sys/arch/arm/sunxi/sunxi_thermal.c index 9f25eab6c08a..155f1aec0ab1 100644 --- a/sys/arch/arm/sunxi/sunxi_thermal.c +++ b/sys/arch/arm/sunxi/sunxi_thermal.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_thermal.c,v 1.12 2021/01/27 02:09:39 thorpej Exp $ */ +/* $NetBSD: sunxi_thermal.c,v 1.13 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2016-2017 Jared McNeill @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_thermal.c,v 1.12 2021/01/27 02:09:39 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_thermal.c,v 1.13 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -544,7 +544,7 @@ sunxi_thermal_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -567,7 +567,7 @@ sunxi_thermal_attach(device_t parent, device_t self, void *aux) sc->dev = self; sc->phandle = phandle; sc->bst = faa->faa_bst; - sc->conf = of_search_compatible(phandle, compat_data)->data; + sc->conf = of_compatible_lookup(phandle, compat_data)->data; if (bus_space_map(sc->bst, addr, size, 0, &sc->bsh) != 0) { aprint_error(": couldn't map registers\n"); return; diff --git a/sys/arch/arm/sunxi/sunxi_timer.c b/sys/arch/arm/sunxi/sunxi_timer.c index bacea216e552..c21e986a66a9 100644 --- a/sys/arch/arm/sunxi/sunxi_timer.c +++ b/sys/arch/arm/sunxi/sunxi_timer.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_timer.c,v 1.8 2021/01/15 22:47:32 jmcneill Exp $ */ +/* $NetBSD: sunxi_timer.c,v 1.9 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_timer.c,v 1.8 2021/01/15 22:47:32 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_timer.c,v 1.9 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -91,9 +91,9 @@ __KERNEL_RCSID(0, "$NetBSD: sunxi_timer.c,v 1.8 2021/01/15 22:47:32 jmcneill Exp #define LOSC_CTRL_OSC32K_AUTO_SWT_EN __BIT(14) #define LOSC_CTRL_OSC32K_SEL __BIT(0) -static const char * const compatible[] = { - "allwinner,sun4i-a10-timer", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "allwinner,sun4i-a10-timer" }, + DEVICE_COMPAT_EOL }; struct sunxi_timer_softc { @@ -178,7 +178,7 @@ sunxi_timer_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/sunxi/sunxi_ts.c b/sys/arch/arm/sunxi/sunxi_ts.c index 61a4e10db204..88c8349ffff7 100644 --- a/sys/arch/arm/sunxi/sunxi_ts.c +++ b/sys/arch/arm/sunxi/sunxi_ts.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_ts.c,v 1.7 2021/01/27 02:09:39 thorpej Exp $ */ +/* $NetBSD: sunxi_ts.c,v 1.8 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_ts.c,v 1.7 2021/01/27 02:09:39 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_ts.c,v 1.8 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -343,7 +343,7 @@ sunxi_ts_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -375,7 +375,7 @@ sunxi_ts_attach(device_t parent, device_t self, void *aux) aprint_error(": couldn't map registers\n"); return; } - sc->sc_conf = of_search_compatible(phandle, compat_data)->data; + sc->sc_conf = of_compatible_lookup(phandle, compat_data)->data; sc->sc_ts_attached = of_getprop_bool(phandle, "allwinner,ts-attached"); sc->sc_ts_inverted_x = of_getprop_bool(phandle, diff --git a/sys/arch/arm/sunxi/sunxi_twi.c b/sys/arch/arm/sunxi/sunxi_twi.c index 6e3613b1cecc..d7cb69fcfed4 100644 --- a/sys/arch/arm/sunxi/sunxi_twi.c +++ b/sys/arch/arm/sunxi/sunxi_twi.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_twi.c,v 1.16 2021/01/27 02:09:39 thorpej Exp $ */ +/* $NetBSD: sunxi_twi.c,v 1.17 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_twi.c,v 1.16 2021/01/27 02:09:39 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_twi.c,v 1.17 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -116,7 +116,7 @@ sunxi_twi_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -161,7 +161,7 @@ sunxi_twi_attach(device_t parent, device_t self, void *aux) return; } - conf = of_search_compatible(phandle, compat_data)->data; + conf = of_compatible_lookup(phandle, compat_data)->data; prop_dictionary_set_bool(device_properties(self), "iflg-rwc", conf->iflg_rwc); diff --git a/sys/arch/arm/sunxi/sunxi_usb3phy.c b/sys/arch/arm/sunxi/sunxi_usb3phy.c index 69eceea739b4..e820bcd9beed 100644 --- a/sys/arch/arm/sunxi/sunxi_usb3phy.c +++ b/sys/arch/arm/sunxi/sunxi_usb3phy.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_usb3phy.c,v 1.4 2021/01/27 02:09:39 thorpej Exp $ */ +/* $NetBSD: sunxi_usb3phy.c,v 1.5 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2018 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_usb3phy.c,v 1.4 2021/01/27 02:09:39 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_usb3phy.c,v 1.5 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -160,7 +160,7 @@ sunxi_usb3phy_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -177,7 +177,7 @@ sunxi_usb3phy_attach(device_t parent, device_t self, void *aux) u_int n; sc->sc_dev = self; - sc->sc_type = of_search_compatible(phandle, compat_data)->value; + sc->sc_type = of_compatible_lookup(phandle, compat_data)->value; if (fdtbus_get_reg(phandle, 0, &addr, &size) != 0) { aprint_error(": couldn't get phy registers\n"); diff --git a/sys/arch/arm/sunxi/sunxi_usbphy.c b/sys/arch/arm/sunxi/sunxi_usbphy.c index 8c7753bce615..6e5d06c6c3d8 100644 --- a/sys/arch/arm/sunxi/sunxi_usbphy.c +++ b/sys/arch/arm/sunxi/sunxi_usbphy.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_usbphy.c,v 1.15 2021/01/27 02:09:39 thorpej Exp $ */ +/* $NetBSD: sunxi_usbphy.c,v 1.16 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_usbphy.c,v 1.15 2021/01/27 02:09:39 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_usbphy.c,v 1.16 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -334,7 +334,7 @@ sunxi_usbphy_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -353,7 +353,7 @@ sunxi_usbphy_attach(device_t parent, device_t self, void *aux) sc->sc_dev = self; sc->sc_bst = faa->faa_bst; - sc->sc_type = of_search_compatible(phandle, compat_data)->value; + sc->sc_type = of_compatible_lookup(phandle, compat_data)->value; if (fdtbus_get_reg_byname(phandle, "phy_ctrl", &addr, &size) != 0) { aprint_error(": couldn't get phy ctrl registers\n"); diff --git a/sys/arch/arm/sunxi/sunxi_wdt.c b/sys/arch/arm/sunxi/sunxi_wdt.c index cc08e137f8aa..64e93e7f58f8 100644 --- a/sys/arch/arm/sunxi/sunxi_wdt.c +++ b/sys/arch/arm/sunxi/sunxi_wdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_wdt.c,v 1.5 2021/01/27 02:09:39 thorpej Exp $ */ +/* $NetBSD: sunxi_wdt.c,v 1.6 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_wdt.c,v 1.5 2021/01/27 02:09:39 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_wdt.c,v 1.6 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -202,7 +202,7 @@ sunxi_wdt_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -235,7 +235,7 @@ sunxi_wdt_attach(device_t parent, device_t self, void *aux) sc->sc_smw.smw_cookie = sc; sc->sc_smw.smw_period = SUNXI_WDT_PERIOD_DEFAULT; - type = of_search_compatible(phandle, compat_data)->value; + type = of_compatible_lookup(phandle, compat_data)->value; switch (type) { case WDT_SUN4I: sc->sc_smw.smw_setmode = sun4i_wdt_setmode; diff --git a/sys/arch/arm/ti/am3_prcm.c b/sys/arch/arm/ti/am3_prcm.c index 9b25cb55e01a..9a86e5148956 100644 --- a/sys/arch/arm/ti/am3_prcm.c +++ b/sys/arch/arm/ti/am3_prcm.c @@ -1,4 +1,4 @@ -/* $NetBSD: am3_prcm.c,v 1.13 2020/06/03 14:56:09 jmcneill Exp $ */ +/* $NetBSD: am3_prcm.c,v 1.14 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: am3_prcm.c,v 1.13 2020/06/03 14:56:09 jmcneill Exp $"); +__KERNEL_RCSID(1, "$NetBSD: am3_prcm.c,v 1.14 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -133,19 +133,19 @@ am3_prcm_hwmod_enable_display(struct ti_prcm_softc *sc, struct ti_prcm_clk *tc, #define AM3_PRCM_HWMOD_WKUP(_name, _reg, _parent) \ TI_PRCM_HWMOD((_name), AM3_PRCM_CM_WKUP + (_reg), (_parent), am3_prcm_hwmod_enable) -static const char * const compatible[] = { - "ti,am3-prcm", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "ti,am3-prcm" }, + DEVICE_COMPAT_EOL }; -static const char * const cm_compatible[] = { - "ti,omap4-cm", - NULL +static const struct device_compatible_entry cm_compat_data[] = { + { .compat = "ti,omap4-cm" }, + DEVICE_COMPAT_EOL }; -static const char * const clkctrl_compatible[] = { - "ti,clkctrl", - NULL +static const struct device_compatible_entry clkctrl_compat_data[] = { + { .compat = "ti,clkctrl" }, + DEVICE_COMPAT_EOL }; CFATTACH_DECL_NEW(am3_prcm, sizeof(struct am3_prcm_softc), @@ -255,7 +255,7 @@ am3_prcm_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -284,11 +284,13 @@ am3_prcm_attach(device_t parent, device_t self, void *aux) aprint_normal(": AM3xxx PRCM\n"); for (child = OF_child(phandle); child; child = OF_peer(child)) { - if (of_match_compatible(child, cm_compatible) == 0) + if (of_compatible_match(child, cm_compat_data) == 0) continue; - for (cm_child = OF_child(child); cm_child; cm_child = OF_peer(cm_child)) { - if (of_match_compatible(cm_child, clkctrl_compatible) == 0) + for (cm_child = OF_child(child); cm_child; + cm_child = OF_peer(cm_child)) { + if (of_compatible_match(cm_child, + clkctrl_compat_data) == 0) continue; aprint_debug_dev(self, "clkctrl: %s\n", fdtbus_get_string(cm_child, "name")); diff --git a/sys/arch/arm/ti/if_cpsw.c b/sys/arch/arm/ti/if_cpsw.c index 396734a34648..6c7775948f52 100644 --- a/sys/arch/arm/ti/if_cpsw.c +++ b/sys/arch/arm/ti/if_cpsw.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_cpsw.c,v 1.13 2021/01/15 23:19:33 jmcneill Exp $ */ +/* $NetBSD: if_cpsw.c,v 1.14 2021/01/27 03:10:20 thorpej Exp $ */ /* * Copyright (c) 2013 Jonathan A. Kollasch @@ -53,7 +53,7 @@ */ #include -__KERNEL_RCSID(1, "$NetBSD: if_cpsw.c,v 1.13 2021/01/15 23:19:33 jmcneill Exp $"); +__KERNEL_RCSID(1, "$NetBSD: if_cpsw.c,v 1.14 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -309,19 +309,18 @@ cpsw_rxdesc_paddr(struct cpsw_softc * const sc, u_int x) return sc->sc_rxdescs_pa + sizeof(struct cpsw_cpdma_bd) * x; } +static const struct device_compatible_entry compat_data[] = { + { .compat = "ti,am335x-cpsw" }, + { .compat = "ti,cpsw" }, + DEVICE_COMPAT_EOL +}; static int cpsw_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - static const char * const compatible[] = { - "ti,am335x-cpsw", - "ti,cpsw", - NULL - }; - - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static bool diff --git a/sys/arch/arm/ti/omap2_nand.c b/sys/arch/arm/ti/omap2_nand.c index 6305dfe7d64c..b6d1c5c6bac6 100644 --- a/sys/arch/arm/ti/omap2_nand.c +++ b/sys/arch/arm/ti/omap2_nand.c @@ -1,4 +1,4 @@ -/* $NetBSD: omap2_nand.c,v 1.2 2019/11/03 13:45:57 jmcneill Exp $ */ +/* $NetBSD: omap2_nand.c,v 1.3 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2010 Department of Software Engineering, @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: omap2_nand.c,v 1.2 2019/11/03 13:45:57 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: omap2_nand.c,v 1.3 2021/01/27 03:10:20 thorpej Exp $"); /* TODO move to opt_* */ #undef OMAP2_NAND_HARDWARE_ECC @@ -124,10 +124,10 @@ struct omap2_nand_softc { bus_size_t sc_data_reg; }; -static const char * compatible[] = { - "ti,omap2-nand", - "ti,omap2-onenand", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "ti,omap2-nand" }, + { .compat = "ti,omap2-onenand" }, + DEVICE_COMPAT_EOL }; CFATTACH_DECL_NEW(omapnand, sizeof(struct omap2_nand_softc), omap2_nand_match, @@ -185,7 +185,7 @@ omap2_nand_match(device_t parent, cfdata_t match, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/ti/omap3_cm.c b/sys/arch/arm/ti/omap3_cm.c index 3a63f4a49670..ac9b21b8011a 100644 --- a/sys/arch/arm/ti/omap3_cm.c +++ b/sys/arch/arm/ti/omap3_cm.c @@ -1,4 +1,4 @@ -/* $NetBSD: omap3_cm.c,v 1.4 2019/11/01 11:53:35 jmcneill Exp $ */ +/* $NetBSD: omap3_cm.c,v 1.5 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: omap3_cm.c,v 1.4 2019/11/01 11:53:35 jmcneill Exp $"); +__KERNEL_RCSID(1, "$NetBSD: omap3_cm.c,v 1.5 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -101,9 +101,9 @@ omap3_cm_hwmod_enable(struct ti_prcm_softc *sc, struct ti_prcm_clk *tc, int enab #define OMAP3_CM_HWMOD_NOP(_name, _parent) \ TI_PRCM_HWMOD_MASK((_name), 0, 0, (_parent), omap3_cm_hwmod_nopenable, 0) -static const char * const compatible[] = { - "ti,omap3-cm", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "ti,omap3-cm" }, + DEVICE_COMPAT_EOL }; CFATTACH_DECL_NEW(omap3_cm, sizeof(struct ti_prcm_softc), @@ -183,7 +183,7 @@ omap3_cm_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/ti/omap3_dss.c b/sys/arch/arm/ti/omap3_dss.c index b0054fa07a21..86b5cfa4498e 100644 --- a/sys/arch/arm/ti/omap3_dss.c +++ b/sys/arch/arm/ti/omap3_dss.c @@ -1,4 +1,4 @@ -/* $NetBSD: omap3_dss.c,v 1.2 2020/06/28 12:43:00 skrll Exp $ */ +/* $NetBSD: omap3_dss.c,v 1.3 2021/01/27 03:10:20 thorpej Exp $ */ /* * Copyright (c) 2010 Michael Lorenz @@ -33,7 +33,7 @@ #include "opt_wsdisplay_compat.h" #include -__KERNEL_RCSID(0, "$NetBSD: omap3_dss.c,v 1.2 2020/06/28 12:43:00 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: omap3_dss.c,v 1.3 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -164,9 +164,9 @@ uint32_t venc_mode_ntsc[] = { extern const u_char rasops_cmap[768]; -static const char * const compatible[] = { - "ti,omap3-dss", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "ti,omap3-dss" }, + DEVICE_COMPAT_EOL }; static int omapfb_console_phandle = -1; @@ -176,7 +176,7 @@ omapfb_match(device_t parent, cfdata_t match, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -1242,7 +1242,7 @@ omapfb_do_cursor(struct omapfb_softc * sc, static int omapfb_console_match(int phandle) { - return of_match_compatible(phandle, compatible); + return of_compatible_match(phandle, compat_data); } static void diff --git a/sys/arch/arm/ti/omap3_prm.c b/sys/arch/arm/ti/omap3_prm.c index c3955342e2a3..17b941d19034 100644 --- a/sys/arch/arm/ti/omap3_prm.c +++ b/sys/arch/arm/ti/omap3_prm.c @@ -1,4 +1,4 @@ -/* $NetBSD: omap3_prm.c,v 1.1 2019/10/29 22:19:13 jmcneill Exp $ */ +/* $NetBSD: omap3_prm.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: omap3_prm.c,v 1.1 2019/10/29 22:19:13 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: omap3_prm.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -46,9 +46,9 @@ static void omap3_prm_attach(device_t, device_t, void *); CFATTACH_DECL_NEW(omap3_prm, 0, omap3_prm_match, omap3_prm_attach, NULL, NULL); -static const char * compatible[] = { - "ti,omap3-prm", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "ti,omap3-prm" }, + DEVICE_COMPAT_EOL }; static int @@ -56,7 +56,7 @@ omap3_prm_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/ti/ti_com.c b/sys/arch/arm/ti/ti_com.c index 8c16a5cc0299..f6ede2149319 100644 --- a/sys/arch/arm/ti/ti_com.c +++ b/sys/arch/arm/ti/ti_com.c @@ -1,4 +1,4 @@ -/* $NetBSD: ti_com.c,v 1.10 2021/01/15 23:19:33 jmcneill Exp $ */ +/* $NetBSD: ti_com.c,v 1.11 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: ti_com.c,v 1.10 2021/01/15 23:19:33 jmcneill Exp $"); +__KERNEL_RCSID(1, "$NetBSD: ti_com.c,v 1.11 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -47,10 +47,10 @@ __KERNEL_RCSID(1, "$NetBSD: ti_com.c,v 1.10 2021/01/15 23:19:33 jmcneill Exp $") static int ti_com_match(device_t, cfdata_t, void *); static void ti_com_attach(device_t, device_t, void *); -static const char * const compatible[] = { - "ti,am3352-uart", - "ti,omap3-uart", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "ti,am3352-uart" }, + { .compat = "ti,omap3-uart" }, + DEVICE_COMPAT_EOL }; struct ti_com_softc { @@ -66,7 +66,7 @@ ti_com_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -134,7 +134,7 @@ ti_com_attach(device_t parent, device_t self, void *aux) static int ti_com_console_match(int phandle) { - return of_match_compatible(phandle, compatible); + return of_compatible_match(phandle, compat_data); } static void diff --git a/sys/arch/arm/ti/ti_cpufreq.c b/sys/arch/arm/ti/ti_cpufreq.c index a899f9946c33..5bfa882faec4 100644 --- a/sys/arch/arm/ti/ti_cpufreq.c +++ b/sys/arch/arm/ti/ti_cpufreq.c @@ -1,4 +1,4 @@ -/* $NetBSD: ti_cpufreq.c,v 1.3 2020/06/03 18:02:03 jmcneill Exp $ */ +/* $NetBSD: ti_cpufreq.c,v 1.4 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill @@ -29,7 +29,7 @@ #include "opt_soc.h" #include -__KERNEL_RCSID(0, "$NetBSD: ti_cpufreq.c,v 1.3 2020/06/03 18:02:03 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ti_cpufreq.c,v 1.4 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -52,7 +52,10 @@ static struct syscon *ti_opp_syscon; #define AM33XX_EFUSE_MASK 0x00001fff #define AM33XX_EFUSE_DEFAULT 0x1e2f -static const char * const am33xx_compatible[] = { "ti,am33xx", NULL }; +static const struct device_compatible_entry am33xx_compat_data[] = { + { .compat = "ti,am33xx" }, + DEVICE_COMPAT_EOL +}; static bool am33xx_opp_supported(const int opp_table, const int opp_node) @@ -94,7 +97,8 @@ ti_opp_probe(const int opp_table) ti_opp_syscon = fdtbus_syscon_acquire(opp_table, "syscon"); #ifdef SOC_AM33XX - if (ti_opp_syscon && of_match_compatible(OF_finddevice("/"), am33xx_compatible)) + if (ti_opp_syscon && + of_compatible_match(OF_finddevice("/"), am33xx_compat_data)) ti_opp_supportedfn = am33xx_opp_supported; #endif } diff --git a/sys/arch/arm/ti/ti_div_clock.c b/sys/arch/arm/ti/ti_div_clock.c index abb24fcea5ce..223279449b0f 100644 --- a/sys/arch/arm/ti/ti_div_clock.c +++ b/sys/arch/arm/ti/ti_div_clock.c @@ -1,4 +1,4 @@ -/* $NetBSD: ti_div_clock.c,v 1.1 2019/10/28 21:16:47 jmcneill Exp $ */ +/* $NetBSD: ti_div_clock.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ti_div_clock.c,v 1.1 2019/10/28 21:16:47 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ti_div_clock.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -39,9 +39,9 @@ __KERNEL_RCSID(0, "$NetBSD: ti_div_clock.c,v 1.1 2019/10/28 21:16:47 jmcneill Ex #include -static const char * const compatible[] = { - "ti,divider-clock", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "ti,divider-clock" }, + DEVICE_COMPAT_EOL }; static int ti_div_clock_match(device_t, cfdata_t, void *); @@ -88,7 +88,7 @@ ti_div_clock_match(device_t parent, cfdata_t cf, void *aux) { const struct fdt_attach_args *faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/ti/ti_dpll_clock.c b/sys/arch/arm/ti/ti_dpll_clock.c index aa357d056ca3..35e95d5e9981 100644 --- a/sys/arch/arm/ti/ti_dpll_clock.c +++ b/sys/arch/arm/ti/ti_dpll_clock.c @@ -1,4 +1,4 @@ -/* $NetBSD: ti_dpll_clock.c,v 1.5 2021/01/25 14:20:39 thorpej Exp $ */ +/* $NetBSD: ti_dpll_clock.c,v 1.6 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ti_dpll_clock.c,v 1.5 2021/01/25 14:20:39 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ti_dpll_clock.c,v 1.6 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -110,7 +110,7 @@ static const struct device_compatible_entry compat_data[] = { { .compat = "ti,omap3-dpll-core-clock", .data = &omap3_dpll_core_clock_clk_funcs }, - { } + DEVICE_COMPAT_EOL }; enum { @@ -143,7 +143,7 @@ ti_dpll_clock_match(device_t parent, cfdata_t cf, void *aux) { const struct fdt_attach_args *faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -179,7 +179,7 @@ ti_dpll_clock_attach(device_t parent, device_t self, void *aux) } } - clkfuncs = of_search_compatible(phandle, compat_data)->data; + clkfuncs = of_compatible_lookup(phandle, compat_data)->data; sc->sc_clkdom.name = device_xname(self); sc->sc_clkdom.funcs = clkfuncs; diff --git a/sys/arch/arm/ti/ti_edma.c b/sys/arch/arm/ti/ti_edma.c index 68c35ff710c5..47106de9f00a 100644 --- a/sys/arch/arm/ti/ti_edma.c +++ b/sys/arch/arm/ti/ti_edma.c @@ -1,4 +1,4 @@ -/* $NetBSD: ti_edma.c,v 1.2 2021/01/15 22:59:50 jmcneill Exp $ */ +/* $NetBSD: ti_edma.c,v 1.3 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2014 Jared D. McNeill @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ti_edma.c,v 1.2 2021/01/15 22:59:50 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ti_edma.c,v 1.3 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -96,9 +96,9 @@ CFATTACH_DECL_NEW(ti_edma, sizeof(struct edma_softc), #define EDMA_WRITE(sc, reg, val) \ bus_space_write_4((sc)->sc_iot, (sc)->sc_ioh, (reg), (val)) -static const char * compatible[] = { - "ti,edma3-tpcc", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "ti,edma3-tpcc" }, + DEVICE_COMPAT_EOL }; static int @@ -106,7 +106,7 @@ edma_match(device_t parent, cfdata_t match, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/ti/ti_ehci.c b/sys/arch/arm/ti/ti_ehci.c index 10cc635f7e43..1f22af5df4e4 100644 --- a/sys/arch/arm/ti/ti_ehci.c +++ b/sys/arch/arm/ti/ti_ehci.c @@ -1,4 +1,4 @@ -/* $NetBSD: ti_ehci.c,v 1.2 2021/01/15 23:19:33 jmcneill Exp $ */ +/* $NetBSD: ti_ehci.c,v 1.3 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2015-2019 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ti_ehci.c,v 1.2 2021/01/15 23:19:33 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ti_ehci.c,v 1.3 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -54,16 +54,17 @@ CFATTACH_DECL2_NEW(ti_ehci, sizeof(struct ehci_softc), ti_ehci_match, ti_ehci_attach, NULL, ehci_activate, NULL, ehci_childdet); +static const struct device_compatible_entry compat_data[] = { + { .compat = "ti,ehci-omap" }, + DEVICE_COMPAT_EOL +}; + static int ti_ehci_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "ti,ehci-omap", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/ti/ti_gpio.c b/sys/arch/arm/ti/ti_gpio.c index 8cbaf566292c..916216a6f049 100644 --- a/sys/arch/arm/ti/ti_gpio.c +++ b/sys/arch/arm/ti/ti_gpio.c @@ -1,4 +1,4 @@ -/* $NetBSD: ti_gpio.c,v 1.9 2021/01/27 02:12:16 thorpej Exp $ */ +/* $NetBSD: ti_gpio.c,v 1.10 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ti_gpio.c,v 1.9 2021/01/27 02:12:16 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ti_gpio.c,v 1.10 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -480,7 +480,7 @@ ti_gpio_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -512,7 +512,7 @@ ti_gpio_attach(device_t parent, device_t self, void *aux) aprint_error(": couldn't map registers\n"); return; } - sc->sc_type = of_search_compatible(phandle, compat_data)->value; + sc->sc_type = of_compatible_lookup(phandle, compat_data)->value; mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_VM); sc->sc_modname = fdtbus_get_string(phandle, "ti,hwmods"); diff --git a/sys/arch/arm/ti/ti_gpmc.c b/sys/arch/arm/ti/ti_gpmc.c index 2470da1f218c..f2e72f7b22e6 100644 --- a/sys/arch/arm/ti/ti_gpmc.c +++ b/sys/arch/arm/ti/ti_gpmc.c @@ -1,4 +1,4 @@ -/* $NetBSD: ti_gpmc.c,v 1.1 2019/11/01 11:53:35 jmcneill Exp $ */ +/* $NetBSD: ti_gpmc.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ti_gpmc.c,v 1.1 2019/11/01 11:53:35 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ti_gpmc.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -46,9 +46,9 @@ static void ti_gpmc_attach(device_t, device_t, void *); CFATTACH_DECL_NEW(ti_gpmc, 0, ti_gpmc_match, ti_gpmc_attach, NULL, NULL); -static const char * compatible[] = { - "ti,omap3430-gpmc", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "ti,omap3430-gpmc" }, + DEVICE_COMPAT_EOL }; static int @@ -56,7 +56,7 @@ ti_gpmc_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/ti/ti_iic.c b/sys/arch/arm/ti/ti_iic.c index 55fc8b0d113c..829e2ac2b72d 100644 --- a/sys/arch/arm/ti/ti_iic.c +++ b/sys/arch/arm/ti/ti_iic.c @@ -1,4 +1,4 @@ -/* $NetBSD: ti_iic.c,v 1.12 2021/01/27 02:12:16 thorpej Exp $ */ +/* $NetBSD: ti_iic.c,v 1.13 2021/01/27 03:10:20 thorpej Exp $ */ /* * Copyright (c) 2013 Manuel Bouyer. All rights reserved. @@ -50,7 +50,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ti_iic.c,v 1.12 2021/01/27 02:12:16 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ti_iic.c,v 1.13 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -225,7 +225,7 @@ ti_iic_match(device_t parent, cfdata_t match, void *opaque) { struct fdt_attach_args * const faa = opaque; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -269,7 +269,7 @@ ti_iic_attach(device_t parent, device_t self, void *opaque) aprint_error(": couldn't map registers\n"); return; } - sc->sc_type = of_search_compatible(phandle, compat_data)->value; + sc->sc_type = of_compatible_lookup(phandle, compat_data)->value; sc->sc_ih = fdtbus_intr_establish_xname(phandle, 0, IPL_NET, 0, ti_iic_intr, sc, device_xname(self)); diff --git a/sys/arch/arm/ti/ti_lcdc.c b/sys/arch/arm/ti/ti_lcdc.c index 39627d9fb620..8d89005dff06 100644 --- a/sys/arch/arm/ti/ti_lcdc.c +++ b/sys/arch/arm/ti/ti_lcdc.c @@ -1,4 +1,4 @@ -/* $NetBSD: ti_lcdc.c,v 1.4 2019/12/15 01:00:58 mrg Exp $ */ +/* $NetBSD: ti_lcdc.c,v 1.5 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ti_lcdc.c,v 1.4 2019/12/15 01:00:58 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ti_lcdc.c,v 1.5 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -54,9 +54,9 @@ __KERNEL_RCSID(0, "$NetBSD: ti_lcdc.c,v 1.4 2019/12/15 01:00:58 mrg Exp $"); #include #include -static const char * const compatible[] = { - "ti,am33xx-tilcdc", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "ti,am33xx-tilcdc" }, + DEVICE_COMPAT_EOL }; enum { @@ -372,7 +372,7 @@ tilcdc_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/ti/ti_motg.c b/sys/arch/arm/ti/ti_motg.c index 2d81d769547f..20da1e1fa0bf 100644 --- a/sys/arch/arm/ti/ti_motg.c +++ b/sys/arch/arm/ti/ti_motg.c @@ -1,4 +1,4 @@ -/* $NetBSD: ti_motg.c,v 1.3 2021/01/15 23:19:33 jmcneill Exp $ */ +/* $NetBSD: ti_motg.c,v 1.4 2021/01/27 03:10:20 thorpej Exp $ */ /* * Copyright (c) 2013 Manuel Bouyer. All rights reserved. * @@ -24,7 +24,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ti_motg.c,v 1.3 2021/01/15 23:19:33 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ti_motg.c,v 1.4 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -61,9 +61,9 @@ extern int motgdebug; #define MOTGHIST_FUNC() USBHIST_FUNC() #define MOTGHIST_CALLED(name) USBHIST_CALLED(motgdebug) -static const char * compatible [] = { - "ti,musb-am33xx", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "ti,musb-am33xx" }, + DEVICE_COMPAT_EOL }; /* @@ -93,7 +93,7 @@ ti_motg_match(device_t parent, cfdata_t match, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/ti/ti_mux_clock.c b/sys/arch/arm/ti/ti_mux_clock.c index 116d5b080124..53c064febb39 100644 --- a/sys/arch/arm/ti/ti_mux_clock.c +++ b/sys/arch/arm/ti/ti_mux_clock.c @@ -1,4 +1,4 @@ -/* $NetBSD: ti_mux_clock.c,v 1.1 2019/10/28 21:16:47 jmcneill Exp $ */ +/* $NetBSD: ti_mux_clock.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ti_mux_clock.c,v 1.1 2019/10/28 21:16:47 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ti_mux_clock.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -84,13 +84,17 @@ struct ti_mux_clock_softc { CFATTACH_DECL_NEW(ti_mux_clock, sizeof(struct ti_mux_clock_softc), ti_mux_clock_match, ti_mux_clock_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "ti,mux-clock" }, + DEVICE_COMPAT_EOL +}; + static int ti_mux_clock_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { "ti,mux-clock", NULL }; const struct fdt_attach_args *faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/ti/ti_omapintc.c b/sys/arch/arm/ti/ti_omapintc.c index 9e5b2d9cf554..2503bc16ce85 100644 --- a/sys/arch/arm/ti/ti_omapintc.c +++ b/sys/arch/arm/ti/ti_omapintc.c @@ -1,4 +1,4 @@ -/* $NetBSD: ti_omapintc.c,v 1.7 2021/01/27 02:12:16 thorpej Exp $ */ +/* $NetBSD: ti_omapintc.c,v 1.8 2021/01/27 03:10:20 thorpej Exp $ */ /* * Define the SDP2430 specific information and then include the generic OMAP * interrupt header. @@ -29,7 +29,7 @@ #define _INTR_PRIVATE #include -__KERNEL_RCSID(0, "$NetBSD: ti_omapintc.c,v 1.7 2021/01/27 02:12:16 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ti_omapintc.c,v 1.8 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -225,7 +225,7 @@ omap2icu_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } void @@ -249,7 +249,7 @@ omap2icu_attach(device_t parent, device_t self, void *aux) aprint_error(": couldn't map registers\n"); return; } - sc->sc_nbank = of_search_compatible(phandle, compat_data)->value; + sc->sc_nbank = of_compatible_lookup(phandle, compat_data)->value; sc->sc_enabled_irqs = kmem_zalloc(sizeof(*sc->sc_enabled_irqs) * sc->sc_nbank, KM_SLEEP); diff --git a/sys/arch/arm/ti/ti_omaptimer.c b/sys/arch/arm/ti/ti_omaptimer.c index ec2f425b3edf..4b5b57338911 100644 --- a/sys/arch/arm/ti/ti_omaptimer.c +++ b/sys/arch/arm/ti/ti_omaptimer.c @@ -1,7 +1,7 @@ -/* $NetBSD: ti_omaptimer.c,v 1.8 2021/01/27 02:12:16 thorpej Exp $ */ +/* $NetBSD: ti_omaptimer.c,v 1.9 2021/01/27 03:10:20 thorpej Exp $ */ #include -__KERNEL_RCSID(0, "$NetBSD: ti_omaptimer.c,v 1.8 2021/01/27 02:12:16 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ti_omaptimer.c,v 1.9 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -140,7 +140,7 @@ omaptimer_match(device_t parent, cfdata_t match, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -164,7 +164,7 @@ omaptimer_attach(device_t parent, device_t self, void *aux) sc->sc_dev = self; sc->sc_phandle = phandle; sc->sc_bst = faa->faa_bst; - sc->sc_type = of_search_compatible(phandle, compat_data)->value; + sc->sc_type = of_compatible_lookup(phandle, compat_data)->value; if (bus_space_map(sc->sc_bst, addr, size, 0, &sc->sc_bsh) != 0) { device_printf(self, "unable to map bus space"); diff --git a/sys/arch/arm/ti/ti_otg.c b/sys/arch/arm/ti/ti_otg.c index 2047a7118371..2aeb38a7cd45 100644 --- a/sys/arch/arm/ti/ti_otg.c +++ b/sys/arch/arm/ti/ti_otg.c @@ -1,4 +1,4 @@ -/* $NetBSD: ti_otg.c,v 1.1 2019/10/27 16:31:26 jmcneill Exp $ */ +/* $NetBSD: ti_otg.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $ */ /* * Copyright (c) 2013 Manuel Bouyer. All rights reserved. * @@ -24,7 +24,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ti_otg.c,v 1.1 2019/10/27 16:31:26 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ti_otg.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -41,9 +41,9 @@ __KERNEL_RCSID(0, "$NetBSD: ti_otg.c,v 1.1 2019/10/27 16:31:26 jmcneill Exp $"); #include -static const char * compatible [] = { - "ti,am33xx-usb", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "ti,am33xx-usb" }, + DEVICE_COMPAT_EOL }; struct tiotg_softc { @@ -65,7 +65,7 @@ tiotg_match(device_t parent, cfdata_t match, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/ti/ti_rng.c b/sys/arch/arm/ti/ti_rng.c index 9899a40da1ce..e993cc493bf4 100644 --- a/sys/arch/arm/ti/ti_rng.c +++ b/sys/arch/arm/ti/ti_rng.c @@ -1,4 +1,4 @@ -/* $NetBSD: ti_rng.c,v 1.4 2020/06/03 15:59:22 jmcneill Exp $ */ +/* $NetBSD: ti_rng.c,v 1.5 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ti_rng.c,v 1.4 2020/06/03 15:59:22 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ti_rng.c,v 1.5 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -41,9 +41,9 @@ __KERNEL_RCSID(0, "$NetBSD: ti_rng.c,v 1.4 2020/06/03 15:59:22 jmcneill Exp $"); #include #include -static const char * const compatible[] = { - "ti,omap4-rng", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "ti,omap4-rng" }, + DEVICE_COMPAT_EOL }; struct ti_rng_softc { @@ -72,7 +72,7 @@ ti_rng_match(device_t parent, cfdata_t match, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/ti/ti_sdhc.c b/sys/arch/arm/ti/ti_sdhc.c index 2c34ee53c882..5fa9ed47f791 100644 --- a/sys/arch/arm/ti/ti_sdhc.c +++ b/sys/arch/arm/ti/ti_sdhc.c @@ -1,4 +1,4 @@ -/* $NetBSD: ti_sdhc.c,v 1.9 2021/01/27 02:12:16 thorpej Exp $ */ +/* $NetBSD: ti_sdhc.c,v 1.10 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. * All rights reserved. @@ -29,7 +29,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ti_sdhc.c,v 1.9 2021/01/27 02:12:16 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ti_sdhc.c,v 1.10 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -151,7 +151,7 @@ ti_sdhc_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -165,7 +165,7 @@ ti_sdhc_attach(device_t parent, device_t self, void *aux) bus_size_t size; u_int bus_width; - conf = of_search_compatible(phandle, compat_data)->data; + conf = of_compatible_lookup(phandle, compat_data)->data; if (ti_prcm_enable_hwmod(phandle, 0) != 0) { aprint_error(": couldn't enable module\n"); diff --git a/sys/arch/arm/ti/ti_sysc.c b/sys/arch/arm/ti/ti_sysc.c index fc0530e88a9d..02e9a106f1fe 100644 --- a/sys/arch/arm/ti/ti_sysc.c +++ b/sys/arch/arm/ti/ti_sysc.c @@ -1,4 +1,4 @@ -/* $NetBSD: ti_sysc.c,v 1.1 2019/10/26 15:58:55 jmcneill Exp $ */ +/* $NetBSD: ti_sysc.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ti_sysc.c,v 1.1 2019/10/26 15:58:55 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ti_sysc.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -46,9 +46,9 @@ static void ti_sysc_attach(device_t, device_t, void *); CFATTACH_DECL_NEW(ti_sysc, 0, ti_sysc_match, ti_sysc_attach, NULL, NULL); -static const char * compatible[] = { - "ti,sysc", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "ti,sysc" }, + DEVICE_COMPAT_EOL }; static int @@ -56,7 +56,7 @@ ti_sysc_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/ti/ti_tptc.c b/sys/arch/arm/ti/ti_tptc.c index 14b1387e55a8..6b4705f1fec9 100644 --- a/sys/arch/arm/ti/ti_tptc.c +++ b/sys/arch/arm/ti/ti_tptc.c @@ -1,4 +1,4 @@ -/* $NetBSD: ti_tptc.c,v 1.1 2019/10/27 12:14:51 jmcneill Exp $ */ +/* $NetBSD: ti_tptc.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ti_tptc.c,v 1.1 2019/10/27 12:14:51 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ti_tptc.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -46,9 +46,9 @@ static void ti_tptc_attach(device_t, device_t, void *); CFATTACH_DECL_NEW(ti_tptc, 0, ti_tptc_match, ti_tptc_attach, NULL, NULL); -static const char * compatible[] = { - "ti,edma3-tptc", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "ti,edma3-tptc" }, + DEVICE_COMPAT_EOL }; static int @@ -56,7 +56,7 @@ ti_tptc_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/ti/ti_usb.c b/sys/arch/arm/ti/ti_usb.c index 51e9d31bc5f5..7a9d62eb5caa 100644 --- a/sys/arch/arm/ti/ti_usb.c +++ b/sys/arch/arm/ti/ti_usb.c @@ -1,4 +1,4 @@ -/* $NetBSD: ti_usb.c,v 1.1 2019/10/30 21:41:40 jmcneill Exp $ */ +/* $NetBSD: ti_usb.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ti_usb.c,v 1.1 2019/10/30 21:41:40 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ti_usb.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -71,9 +71,9 @@ __KERNEL_RCSID(0, "$NetBSD: ti_usb.c,v 1.1 2019/10/30 21:41:40 jmcneill Exp $"); extern void tl_usbtll_enable_port(u_int); -static const char * const compatible[] = { - "ti,usbhs-host", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "ti,usbhs-host" }, + DEVICE_COMPAT_EOL }; #define TI_USB_NPORTS 3 @@ -164,7 +164,7 @@ ti_usb_match(device_t parent, cfdata_t match, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/ti/ti_usbtll.c b/sys/arch/arm/ti/ti_usbtll.c index 7d5900cb2f1d..3b55d3490ec8 100644 --- a/sys/arch/arm/ti/ti_usbtll.c +++ b/sys/arch/arm/ti/ti_usbtll.c @@ -1,4 +1,4 @@ -/* $NetBSD: ti_usbtll.c,v 1.1 2019/10/30 21:41:40 jmcneill Exp $ */ +/* $NetBSD: ti_usbtll.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ti_usbtll.c,v 1.1 2019/10/30 21:41:40 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ti_usbtll.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -77,9 +77,9 @@ __KERNEL_RCSID(0, "$NetBSD: ti_usbtll.c,v 1.1 2019/10/30 21:41:40 jmcneill Exp $ #define USBTLL_CHANNEL_CONF_CHANMODE 0x00000006 #define USBTLL_CHANNEL_CONF_CHANEN 0x00000001 -static const char * const compatible[] = { - "ti,usbhs-tll", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "ti,usbhs-tll" }, + DEVICE_COMPAT_EOL }; struct ti_usbtll_softc { @@ -164,7 +164,7 @@ ti_usbtll_match(device_t parent, cfdata_t match, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/ti/ti_wdt.c b/sys/arch/arm/ti/ti_wdt.c index 718981af87ca..da8c4bff5a79 100644 --- a/sys/arch/arm/ti/ti_wdt.c +++ b/sys/arch/arm/ti/ti_wdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: ti_wdt.c,v 1.1 2019/11/29 20:54:00 jmcneill Exp $ */ +/* $NetBSD: ti_wdt.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ti_wdt.c,v 1.1 2019/11/29 20:54:00 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ti_wdt.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -71,9 +71,9 @@ __KERNEL_RCSID(0, "$NetBSD: ti_wdt.c,v 1.1 2019/11/29 20:54:00 jmcneill Exp $"); #define WATCHDOG_PERIOD_DEFAULT 10 -static const char * compatible[] = { - "ti,omap3-wdt", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "ti,omap3-wdt" }, + DEVICE_COMPAT_EOL }; struct ti_wdt_softc { @@ -202,7 +202,7 @@ ti_wdt_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/vexpress/vexpress_sysreg.c b/sys/arch/arm/vexpress/vexpress_sysreg.c index a031571af468..4c0c62dbc66d 100644 --- a/sys/arch/arm/vexpress/vexpress_sysreg.c +++ b/sys/arch/arm/vexpress/vexpress_sysreg.c @@ -1,4 +1,4 @@ -/* $NetBSD: vexpress_sysreg.c,v 1.3 2017/06/30 09:19:19 jmcneill Exp $ */ +/* $NetBSD: vexpress_sysreg.c,v 1.4 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vexpress_sysreg.c,v 1.3 2017/06/30 09:19:19 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vexpress_sysreg.c,v 1.4 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -51,7 +51,10 @@ __KERNEL_RCSID(0, "$NetBSD: vexpress_sysreg.c,v 1.3 2017/06/30 09:19:19 jmcneill static int vexpress_sysreg_match(device_t, cfdata_t, void *); static void vexpress_sysreg_attach(device_t, device_t, void *); -static const char * const compatible[] = { "arm,vexpress-sysreg", NULL }; +static const struct device_compatible_entry compat_data[] = { + { .compat = "arm,vexpress-sysreg" }, + DEVICE_COMPAT_EOL +}; struct vexpress_sysreg_softc { device_t sc_dev; @@ -100,7 +103,7 @@ vexpress_sysreg_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/xilinx/zynq7000_sdhc.c b/sys/arch/arm/xilinx/zynq7000_sdhc.c index 62b9dc01d92e..4c00bce3a80d 100644 --- a/sys/arch/arm/xilinx/zynq7000_sdhc.c +++ b/sys/arch/arm/xilinx/zynq7000_sdhc.c @@ -1,4 +1,4 @@ -/* $NetBSD: zynq7000_sdhc.c,v 1.1 2019/06/11 13:01:48 skrll Exp $ */ +/* $NetBSD: zynq7000_sdhc.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2015 Genetec Corporation. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: zynq7000_sdhc.c,v 1.1 2019/06/11 13:01:48 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: zynq7000_sdhc.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $"); #include #include @@ -60,9 +60,9 @@ CFATTACH_DECL_NEW(sdhc_fdt, sizeof(struct sdhc_fdt_softc), sdhc_match, sdhc_attach, NULL, NULL); -static const char * compatible[] = { - "arasan,sdhci-8.9a", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "arasan,sdhci-8.9a" }, + DEVICE_COMPAT_EOL }; static int @@ -71,7 +71,7 @@ sdhc_match(device_t parent, cfdata_t cf, void *aux) struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/xilinx/zynq7000_uart.c b/sys/arch/arm/xilinx/zynq7000_uart.c index 65121a082e93..985c1fbd7ad1 100644 --- a/sys/arch/arm/xilinx/zynq7000_uart.c +++ b/sys/arch/arm/xilinx/zynq7000_uart.c @@ -1,4 +1,4 @@ -/* $NetBSD: zynq7000_uart.c,v 1.1 2019/06/11 13:01:48 skrll Exp $ */ +/* $NetBSD: zynq7000_uart.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2015 Genetec Corporation. All rights reserved. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: zynq7000_uart.c,v 1.1 2019/06/11 13:01:48 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: zynq7000_uart.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $"); #include "opt_soc.h" #include "opt_console.h" @@ -41,10 +41,10 @@ __KERNEL_RCSID(0, "$NetBSD: zynq7000_uart.c,v 1.1 2019/06/11 13:01:48 skrll Exp #include -static const char * compatible[] = { - "xlnx,xuartps", - "cdns,uart-r1p8", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "xlnx,xuartps" }, + { .compat = "cdns,uart-r1p8" }, + DEVICE_COMPAT_EOL }; int @@ -52,7 +52,7 @@ zynquart_match(device_t parent, struct cfdata *cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } void @@ -91,7 +91,7 @@ zynquart_attach(device_t parent, device_t self, void *aux) static int zynq_uart_console_match(int phandle) { - return of_match_compatible(phandle, compatible); + return of_compatible_match(phandle, compat_data); } static void diff --git a/sys/arch/arm/xilinx/zynq7000_usb.c b/sys/arch/arm/xilinx/zynq7000_usb.c index 2083f100b28f..4120ff8453c0 100644 --- a/sys/arch/arm/xilinx/zynq7000_usb.c +++ b/sys/arch/arm/xilinx/zynq7000_usb.c @@ -1,4 +1,4 @@ -/* $NetBSD: zynq7000_usb.c,v 1.1 2019/06/11 13:01:48 skrll Exp $ */ +/* $NetBSD: zynq7000_usb.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2015 Genetec Corporation. All rights reserved. * Written by Hashimoto Kenichi for Genetec Corporation. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: zynq7000_usb.c,v 1.1 2019/06/11 13:01:48 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: zynq7000_usb.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $"); #include "opt_soc.h" @@ -51,9 +51,9 @@ __KERNEL_RCSID(0, "$NetBSD: zynq7000_usb.c,v 1.1 2019/06/11 13:01:48 skrll Exp $ #include -static const char * compatible[] = { - "xlnx,zynq-usb-2.20a", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "xlnx,zynq-usb-2.20a" }, + DEVICE_COMPAT_EOL }; static int zynqusb_match(device_t, struct cfdata *, void *); @@ -68,7 +68,7 @@ zynqusb_match(device_t parent, struct cfdata *cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/arm/xilinx/zynq_cemac.c b/sys/arch/arm/xilinx/zynq_cemac.c index 9b466c82e742..58108956831f 100644 --- a/sys/arch/arm/xilinx/zynq_cemac.c +++ b/sys/arch/arm/xilinx/zynq_cemac.c @@ -1,4 +1,4 @@ -/* $NetBSD: zynq_cemac.c,v 1.1 2019/06/11 13:01:48 skrll Exp $ */ +/* $NetBSD: zynq_cemac.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $ */ /*- * Copyright (c) 2015 Genetec Corporation. All rights reserved. * Written by Hashimoto Kenichi for Genetec Corporation. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: zynq_cemac.c,v 1.1 2019/06/11 13:01:48 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: zynq_cemac.c,v 1.2 2021/01/27 03:10:20 thorpej Exp $"); #include "opt_soc.h" @@ -43,9 +43,9 @@ __KERNEL_RCSID(0, "$NetBSD: zynq_cemac.c,v 1.1 2019/06/11 13:01:48 skrll Exp $") #include -static const char * compatible[] = { - "cdns,zynq-gem", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "cdns,zynq-gem" }, + DEVICE_COMPAT_EOL }; int @@ -53,7 +53,7 @@ cemac_match(device_t parent, cfdata_t cfdata, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } void diff --git a/sys/arch/mips/cavium/dev/octeon_cib.c b/sys/arch/mips/cavium/dev/octeon_cib.c index 0cfd6539b29f..3df4fb9fea73 100644 --- a/sys/arch/mips/cavium/dev/octeon_cib.c +++ b/sys/arch/mips/cavium/dev/octeon_cib.c @@ -1,4 +1,4 @@ -/* $NetBSD: octeon_cib.c,v 1.5 2021/01/27 02:20:03 thorpej Exp $ */ +/* $NetBSD: octeon_cib.c,v 1.6 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2020 Jared D. McNeill @@ -29,7 +29,7 @@ #include "opt_multiprocessor.h" #include -__KERNEL_RCSID(0, "$NetBSD: octeon_cib.c,v 1.5 2021/01/27 02:20:03 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: octeon_cib.c,v 1.6 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -100,7 +100,7 @@ octeon_cib_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/mips/cavium/dev/octeon_intc.c b/sys/arch/mips/cavium/dev/octeon_intc.c index 1ed7f6402868..b42d17412bdc 100644 --- a/sys/arch/mips/cavium/dev/octeon_intc.c +++ b/sys/arch/mips/cavium/dev/octeon_intc.c @@ -1,4 +1,4 @@ -/* $NetBSD: octeon_intc.c,v 1.5 2021/01/27 02:20:03 thorpej Exp $ */ +/* $NetBSD: octeon_intc.c,v 1.6 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2020 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: octeon_intc.c,v 1.5 2021/01/27 02:20:03 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: octeon_intc.c,v 1.6 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -79,7 +79,7 @@ octeon_intc_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -92,7 +92,7 @@ octeon_intc_attach(device_t parent, device_t self, void *aux) sc->sc_dev = self; sc->sc_phandle = phandle; - sc->sc_type = of_search_compatible(phandle, compat_data)->value; + sc->sc_type = of_compatible_lookup(phandle, compat_data)->value; switch (sc->sc_type) { case OCTEON_INTC_CIU: diff --git a/sys/arch/mips/cavium/dev/octeon_pip.c b/sys/arch/mips/cavium/dev/octeon_pip.c index 4add8d33f3e4..4a7a02fb9f09 100644 --- a/sys/arch/mips/cavium/dev/octeon_pip.c +++ b/sys/arch/mips/cavium/dev/octeon_pip.c @@ -1,4 +1,4 @@ -/* $NetBSD: octeon_pip.c,v 1.10 2021/01/04 17:22:59 thorpej Exp $ */ +/* $NetBSD: octeon_pip.c,v 1.11 2021/01/27 03:10:21 thorpej Exp $ */ /* * Copyright (c) 2007 Internet Initiative Japan, Inc. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: octeon_pip.c,v 1.10 2021/01/04 17:22:59 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: octeon_pip.c,v 1.11 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -58,14 +58,14 @@ CFATTACH_DECL_NEW(octpip_iobus, sizeof(struct octpip_softc), CFATTACH_DECL_NEW(octpip_fdt, sizeof(struct octpip_softc), octpip_fdt_match, octpip_fdt_attach, NULL, NULL); -static const char * compatible[] = { - "cavium,octeon-3860-pip", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "cavium,octeon-3860-pip" }, + DEVICE_COMPAT_EOL }; -static const char * pip_interface_compatible[] = { - "cavium,octeon-3860-pip-interface", - NULL +static const struct device_compatible_entry pip_compat_data[] = { + { .compat = "cavium,octeon-3860-pip-interface" }, + DEVICE_COMPAT_EOL }; static int @@ -121,7 +121,7 @@ octpip_fdt_match(device_t parent, struct cfdata *cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -140,7 +140,7 @@ octpip_fdt_attach(device_t parent, device_t self, void *aux) aprint_normal("\n"); for (child = OF_child(phandle); child; child = OF_peer(child)) { - if (!of_match_compatible(child, pip_interface_compatible)) + if (!of_compatible_match(child, pip_compat_data)) continue; if (fdtbus_get_reg(child, 0, &intno, NULL) != 0) { diff --git a/sys/arch/mips/cavium/dev/octeon_smi.c b/sys/arch/mips/cavium/dev/octeon_smi.c index e049950df41c..c1da83267a74 100644 --- a/sys/arch/mips/cavium/dev/octeon_smi.c +++ b/sys/arch/mips/cavium/dev/octeon_smi.c @@ -1,4 +1,4 @@ -/* $NetBSD: octeon_smi.c,v 1.6 2020/07/16 11:49:37 jmcneill Exp $ */ +/* $NetBSD: octeon_smi.c,v 1.7 2021/01/27 03:10:21 thorpej Exp $ */ /* * Copyright (c) 2007 Internet Initiative Japan, Inc. @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: octeon_smi.c,v 1.6 2020/07/16 11:49:37 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: octeon_smi.c,v 1.7 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -99,9 +99,9 @@ CFATTACH_DECL_NEW(octsmi_iobus, sizeof(struct octsmi_softc), CFATTACH_DECL_NEW(octsmi_fdt, sizeof(struct octsmi_softc), octsmi_fdt_match, octsmi_fdt_attach, NULL, NULL); -static const char * compatible[] = { - "cavium,octeon-3860-mdio", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "cavium,octeon-3860-mdio" }, + DEVICE_COMPAT_EOL }; static int @@ -144,7 +144,7 @@ octsmi_fdt_match(device_t parent, struct cfdata *cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/arch/mips/cavium/dev/octeon_xhci.c b/sys/arch/mips/cavium/dev/octeon_xhci.c index 1adcba638cba..94285e85f0ec 100644 --- a/sys/arch/mips/cavium/dev/octeon_xhci.c +++ b/sys/arch/mips/cavium/dev/octeon_xhci.c @@ -1,4 +1,4 @@ -/* $NetBSD: octeon_xhci.c,v 1.3 2020/10/15 09:32:40 jmcneill Exp $ */ +/* $NetBSD: octeon_xhci.c,v 1.4 2021/01/27 03:10:21 thorpej Exp $ */ /* $OpenBSD: octxhci.c,v 1.4 2019/09/29 04:32:23 visa Exp $ */ /* @@ -66,9 +66,9 @@ static struct mips_bus_space octxhci_bus_tag; CFATTACH_DECL_NEW(octxhci, sizeof(struct octxhci_softc), octxhci_match, octxhci_attach, NULL, NULL); -static const char * compatible[] = { - "cavium,octeon-7130-usb-uctl", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "cavium,octeon-7130-usb-uctl" }, + DEVICE_COMPAT_EOL }; int @@ -76,7 +76,7 @@ octxhci_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } void diff --git a/sys/arch/shark/ofw/chipsfb_ofbus.c b/sys/arch/shark/ofw/chipsfb_ofbus.c index 97208627dc03..235e0e57d955 100644 --- a/sys/arch/shark/ofw/chipsfb_ofbus.c +++ b/sys/arch/shark/ofw/chipsfb_ofbus.c @@ -1,4 +1,4 @@ -/* $NetBSD: chipsfb_ofbus.c,v 1.4 2014/01/02 19:00:39 joerg Exp $ */ +/* $NetBSD: chipsfb_ofbus.c,v 1.5 2021/01/27 03:10:21 thorpej Exp $ */ /* * Copyright (c) 2011 Michael Lorenz @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: chipsfb_ofbus.c,v 1.4 2014/01/02 19:00:39 joerg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: chipsfb_ofbus.c,v 1.5 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -72,8 +72,11 @@ int chipsfb_ofbus_cnattach(bus_space_tag_t, bus_space_tag_t); CFATTACH_DECL_NEW(chipsfb_ofbus, sizeof(struct chipsfb_softc), chipsfb_ofbus_match, chipsfb_ofbus_attach, NULL, NULL); - -static const char * const compat_strings[] = { "CHPS,ct65550", NULL }; + +static const struct device_compatible_entry compat_data[] = { + { .compat = "CHPS,ct65550" }, + DEVICE_COMPAT_EOL +}; vaddr_t chipsfb_mem_vaddr = 0, chipsfb_mmio_vaddr = 0; paddr_t chipsfb_mem_paddr; @@ -97,7 +100,7 @@ chipsfb_ofbus_cnattach(bus_space_tag_t iot, bus_space_tag_t memt) ct_node = OF_finddevice("/vlbus/display"); if (ct_node == -1) return ENXIO; - if (of_compatible(ct_node, compat_strings) < 0) + if (!of_compatible_match(ct_node, compat_data)) return ENXIO; /* @@ -156,10 +159,8 @@ chipsfb_ofbus_match(device_t parent, struct cfdata *match, void *aux) { struct ofbus_attach_args *oba = aux; - if (of_compatible(oba->oba_phandle, compat_strings) < 0) - return 0; - - return 10; /* beat vga etc. */ + /* beat vga etc. */ + return of_compatible_match(oba->oba_phandle, compat_data) * 10; } static void diff --git a/sys/arch/shark/ofw/igsfb_ofbus.c b/sys/arch/shark/ofw/igsfb_ofbus.c index 68bea3f9e24f..0c8e566fd6b6 100644 --- a/sys/arch/shark/ofw/igsfb_ofbus.c +++ b/sys/arch/shark/ofw/igsfb_ofbus.c @@ -1,4 +1,4 @@ -/* $NetBSD: igsfb_ofbus.c,v 1.19 2020/11/22 03:57:19 thorpej Exp $ */ +/* $NetBSD: igsfb_ofbus.c,v 1.20 2021/01/27 03:10:21 thorpej Exp $ */ /* * Copyright (c) 2006 Michael Lorenz @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: igsfb_ofbus.c,v 1.19 2020/11/22 03:57:19 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: igsfb_ofbus.c,v 1.20 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -73,7 +73,10 @@ static paddr_t igsfb_ofbus_mmap(void *, void *, off_t, int); CFATTACH_DECL_NEW(igsfb_ofbus, sizeof(struct igsfb_softc), igsfb_ofbus_match, igsfb_ofbus_attach, NULL, NULL); -static const char * const compat_strings[] = { "igs,cyperpro2010", NULL }; +static const struct device_compatible_entry compat_data[] = { + { .compat = "igs,cyperpro2010" }, + DEVICE_COMPAT_EOL +}; vaddr_t igsfb_mem_vaddr = 0, igsfb_mmio_vaddr = 0; paddr_t igsfb_mem_paddr; @@ -100,7 +103,7 @@ igsfb_ofbus_cnattach(bus_space_tag_t iot, bus_space_tag_t memt) igs_node = OF_finddevice("/vlbus/display"); if (igs_node == -1) return ENXIO; - if (of_compatible(igs_node, compat_strings) < 0) + if (!of_compatible_match(igs_node, compat_data)) return ENXIO; /* @@ -209,10 +212,8 @@ igsfb_ofbus_match(device_t parent, cfdata_t match, void *aux) { struct ofbus_attach_args *oba = aux; - if (of_compatible(oba->oba_phandle, compat_strings) < 0) - return 0; - - return 10; /* beat vga etc. */ + /* beat vga etc. */ + return of_compatible_match(oba->oba_phandle, compat_data) * 10; } static void diff --git a/sys/arch/shark/ofw/ofrom.c b/sys/arch/shark/ofw/ofrom.c index 6df6f903a020..8f328f874e60 100644 --- a/sys/arch/shark/ofw/ofrom.c +++ b/sys/arch/shark/ofw/ofrom.c @@ -1,4 +1,4 @@ -/* $NetBSD: ofrom.c,v 1.28 2018/09/03 16:29:27 riastradh Exp $ */ +/* $NetBSD: ofrom.c,v 1.29 2021/01/27 03:10:21 thorpej Exp $ */ /* * Copyright 1998 @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ofrom.c,v 1.28 2018/09/03 16:29:27 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ofrom.c,v 1.29 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -84,14 +84,17 @@ const struct cdevsw ofrom_cdevsw = { .d_flag = 0 }; +static const struct device_compatible_entry compat_data[] = { + { .compat = "rom" }, + DEVICE_COMPAT_EOL +}; + int ofromprobe(device_t parent, cfdata_t cf, void *aux) { struct ofbus_attach_args *oba = aux; - static const char *const compatible_strings[] = { "rom", NULL }; - return (of_compatible(oba->oba_phandle, compatible_strings) == -1) ? - 0 : 5; + return of_compatible_match(oba->oba_phandle, compat_data) * 5; } diff --git a/sys/arch/shark/ofw/vga_ofbus.c b/sys/arch/shark/ofw/vga_ofbus.c index 80b07a3528a8..cc4e548bc057 100644 --- a/sys/arch/shark/ofw/vga_ofbus.c +++ b/sys/arch/shark/ofw/vga_ofbus.c @@ -1,4 +1,4 @@ -/* $NetBSD: vga_ofbus.c,v 1.16 2012/03/13 18:40:28 elad Exp $ */ +/* $NetBSD: vga_ofbus.c,v 1.17 2021/01/27 03:10:21 thorpej Exp $ */ /* * Copyright (c) 1995, 1996 Carnegie-Mellon University. @@ -28,7 +28,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vga_ofbus.c,v 1.16 2012/03/13 18:40:28 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vga_ofbus.c,v 1.17 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -68,7 +68,10 @@ void vga_ofbus_attach (device_t, device_t, void *); CFATTACH_DECL_NEW(vga_ofbus, sizeof(struct vga_ofbus_softc), vga_ofbus_match, vga_ofbus_attach, NULL, NULL); -static const char *compat_strings[] = { "pnpPNP,900", 0 }; +static const struct device_compatible_entry compat_data[] = { + { .compat = "pnpPNP,900" }, + DEVICE_COMPAT_EOL +}; static int vga_ofbus_ioctl(void *, u_long, void *, int, struct lwp *); static paddr_t vga_ofbus_mmap(void *, off_t, int); @@ -85,7 +88,7 @@ vga_ofbus_match(device_t parent, cfdata_t match, void *aux) { struct ofbus_attach_args *oba = aux; - if (of_compatible(oba->oba_phandle, compat_strings) == -1) + if (!of_compatible_match(oba->oba_phandle, compat_data)) return (0); if (!vga_is_console(&isa_io_bs_tag, WSDISPLAY_TYPE_ISAVGA) && diff --git a/sys/arch/shark/ofw/vlpci.c b/sys/arch/shark/ofw/vlpci.c index 36bd5f0a959b..e488496b8498 100644 --- a/sys/arch/shark/ofw/vlpci.c +++ b/sys/arch/shark/ofw/vlpci.c @@ -1,4 +1,4 @@ -/* $NetBSD: vlpci.c,v 1.9 2019/01/03 18:28:21 macallan Exp $ */ +/* $NetBSD: vlpci.c,v 1.10 2021/01/27 03:10:21 thorpej Exp $ */ /* * Copyright (c) 2017 Jonathan A. Kollasch @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vlpci.c,v 1.9 2019/01/03 18:28:21 macallan Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vlpci.c,v 1.10 2021/01/27 03:10:21 thorpej Exp $"); #include "opt_pci.h" #include "pci.h" @@ -97,7 +97,10 @@ struct vlpci_softc { CFATTACH_DECL_NEW(vlpci, sizeof(struct vlpci_softc), vlpci_match, vlpci_attach, NULL, NULL); -static const char * const compat_strings[] = { "via,vt82c505", NULL }; +static const struct device_compatible_entry compat_data[] = { + { .compat = "via,vt82c505" }, + DEVICE_COMPAT_EOL +}; vaddr_t vlpci_mem_vaddr = 0; paddr_t vlpci_mem_paddr; @@ -192,10 +195,8 @@ vlpci_match(device_t parent, struct cfdata *match, void *aux) { struct ofbus_attach_args * const oba = aux; - if (of_compatible(oba->oba_phandle, compat_strings) < 0) - return 0; - - return 2; /* beat generic ofbus */ + /* beat generic ofbus */ + return of_compatible_match(oba->oba_phandle, compat_data) * 2; } static void diff --git a/sys/dev/fdt/ahcisata_fdt.c b/sys/dev/fdt/ahcisata_fdt.c index 56ef196fb31f..7552bf00d7fc 100644 --- a/sys/dev/fdt/ahcisata_fdt.c +++ b/sys/dev/fdt/ahcisata_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: ahcisata_fdt.c,v 1.2 2021/01/15 22:35:39 jmcneill Exp $ */ +/* $NetBSD: ahcisata_fdt.c,v 1.3 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2018 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: ahcisata_fdt.c,v 1.2 2021/01/15 22:35:39 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ahcisata_fdt.c,v 1.3 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -41,10 +41,10 @@ __KERNEL_RCSID(0, "$NetBSD: ahcisata_fdt.c,v 1.2 2021/01/15 22:35:39 jmcneill Ex #include -static const char * compatible[] = { - "snps,dwc-ahci", - "generic-ahci", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "snps,dwc-ahci" }, + { .compat = "generic-ahci" }, + DEVICE_COMPAT_EOL }; static int @@ -52,7 +52,7 @@ ahcisata_fdt_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/amdccp_fdt.c b/sys/dev/fdt/amdccp_fdt.c index b83969995f96..ee64fbaf5e6d 100644 --- a/sys/dev/fdt/amdccp_fdt.c +++ b/sys/dev/fdt/amdccp_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: amdccp_fdt.c,v 1.5 2021/01/27 02:24:10 thorpej Exp $ */ +/* $NetBSD: amdccp_fdt.c,v 1.6 2021/01/27 03:10:21 thorpej Exp $ */ /* * Copyright (c) 2018 Jonathan A. Kollasch @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: amdccp_fdt.c,v 1.5 2021/01/27 02:24:10 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: amdccp_fdt.c,v 1.6 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -59,7 +59,7 @@ amdccp_fdt_match(device_t parent, cfdata_t cf, void *aux) { const struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/arasan_sdhc_fdt.c b/sys/dev/fdt/arasan_sdhc_fdt.c index c212263502d2..74a85d56ba47 100644 --- a/sys/dev/fdt/arasan_sdhc_fdt.c +++ b/sys/dev/fdt/arasan_sdhc_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: arasan_sdhc_fdt.c,v 1.5 2021/01/18 02:35:49 thorpej Exp $ */ +/* $NetBSD: arasan_sdhc_fdt.c,v 1.6 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: arasan_sdhc_fdt.c,v 1.5 2021/01/18 02:35:49 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: arasan_sdhc_fdt.c,v 1.6 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -76,7 +76,12 @@ static const struct device_compatible_entry compat_data[] = { { .compat = "rockchip,rk3399-sdhci-5.1", .value = AS_TYPE_RK3399 }, - { 0 } + DEVICE_COMPAT_EOL +}; + +static const struct device_compatible_entry sdhci_5_1_compat[] = { + { .compat = "arasan,sdhci-5.1" }, + DEVICE_COMPAT_EOL }; static struct clk * @@ -185,13 +190,12 @@ static void arasan_sdhc_init(device_t dev) { struct arasan_sdhc_softc * const sc = device_private(dev); - const char * sdhci_5_1_compat[] = { "arasan,sdhci-5.1", NULL }; int error; if (sc->sc_type == AS_TYPE_RK3399) arasan_sdhc_init_rk3399(sc); - if (of_match_compatible(sc->sc_phandle, sdhci_5_1_compat)) { + if (of_compatible_match(sc->sc_phandle, sdhci_5_1_compat)) { sc->sc_phy = fdtbus_phy_get(sc->sc_phandle, "phy_arasan"); if (sc->sc_phy == NULL) { aprint_error_dev(dev, "couldn't get PHY\n"); @@ -212,7 +216,7 @@ arasan_sdhc_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -264,7 +268,7 @@ arasan_sdhc_attach(device_t parent, device_t self, void *aux) return; } sc->sc_bsz = size; - sc->sc_type = of_search_compatible(phandle, compat_data)->value; + sc->sc_type = of_compatible_lookup(phandle, compat_data)->value; const uint32_t caps = bus_space_read_4(sc->sc_bst, sc->sc_bsh, SDHC_CAPABILITIES); if ((caps & (SDHC_ADMA2_SUPP|SDHC_64BIT_SYS_BUS)) == SDHC_ADMA2_SUPP) { diff --git a/sys/dev/fdt/ausoc.c b/sys/dev/fdt/ausoc.c index 7894eb37f50b..b4e87ce2a837 100644 --- a/sys/dev/fdt/ausoc.c +++ b/sys/dev/fdt/ausoc.c @@ -1,4 +1,4 @@ -/* $NetBSD: ausoc.c,v 1.5 2019/11/16 12:47:47 jmcneill Exp $ */ +/* $NetBSD: ausoc.c,v 1.6 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2018 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ausoc.c,v 1.5 2019/11/16 12:47:47 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ausoc.c,v 1.6 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -42,7 +42,10 @@ __KERNEL_RCSID(0, "$NetBSD: ausoc.c,v 1.5 2019/11/16 12:47:47 jmcneill Exp $"); #include -static const char *compatible[] = { "simple-audio-card", NULL }; +static const struct device_compatible_entry compat_data[] = { + { .compat = "simple-audio-card" }, + DEVICE_COMPAT_EOL +}; struct ausoc_link { const char *link_name; @@ -343,7 +346,7 @@ ausoc_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static struct { diff --git a/sys/dev/fdt/connector_fdt.c b/sys/dev/fdt/connector_fdt.c index c8813b3e8833..5e3fba98da5f 100644 --- a/sys/dev/fdt/connector_fdt.c +++ b/sys/dev/fdt/connector_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: connector_fdt.c,v 1.4 2021/01/27 02:24:10 thorpej Exp $ */ +/* $NetBSD: connector_fdt.c,v 1.5 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: connector_fdt.c,v 1.4 2021/01/27 02:24:10 thorpej Exp $"); +__KERNEL_RCSID(1, "$NetBSD: connector_fdt.c,v 1.5 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -82,7 +82,7 @@ fdt_connector_match(device_t parent, cfdata_t cf, void *aux) { const struct fdt_attach_args *faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -94,7 +94,7 @@ fdt_connector_attach(device_t parent, device_t self, void *aux) sc->sc_dev = self; sc->sc_phandle = phandle; - sc->sc_type = of_search_compatible(phandle, compat_data)->value; + sc->sc_type = of_compatible_lookup(phandle, compat_data)->value; SLIST_INSERT_HEAD(&fdt_connectors, sc, sc_list); diff --git a/sys/dev/fdt/cpufreq_dt.c b/sys/dev/fdt/cpufreq_dt.c index 939b9a4f29d3..ea708037f5c8 100644 --- a/sys/dev/fdt/cpufreq_dt.c +++ b/sys/dev/fdt/cpufreq_dt.c @@ -1,4 +1,4 @@ -/* $NetBSD: cpufreq_dt.c,v 1.17 2020/06/03 19:55:13 jmcneill Exp $ */ +/* $NetBSD: cpufreq_dt.c,v 1.18 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2015-2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cpufreq_dt.c,v 1.17 2020/06/03 19:55:13 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpufreq_dt.c,v 1.18 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -365,8 +365,12 @@ cpufreq_dt_lookup_opp_info(const int opp_table) int match, best_match = 0; __link_set_foreach(opp, fdt_opps) { - const char * const compat[] = { (*opp)->opp_compat, NULL }; - match = of_match_compatible(opp_table, compat); + const struct device_compatible_entry compat_data[] = { + { .compat = (*opp)->opp_compat }, + DEVICE_COMPAT_EOL + }; + + match = of_compatible_match(opp_table, compat_data); if (match > best_match) { best_match = match; best_opp = *opp; diff --git a/sys/dev/fdt/dw_apb_uart.c b/sys/dev/fdt/dw_apb_uart.c index 4e3c2c3dfd35..84d73f6be5c1 100644 --- a/sys/dev/fdt/dw_apb_uart.c +++ b/sys/dev/fdt/dw_apb_uart.c @@ -1,4 +1,4 @@ -/* $NetBSD: dw_apb_uart.c,v 1.9 2021/01/15 20:50:49 ryo Exp $ */ +/* $NetBSD: dw_apb_uart.c,v 1.10 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: dw_apb_uart.c,v 1.9 2021/01/15 20:50:49 ryo Exp $"); +__KERNEL_RCSID(1, "$NetBSD: dw_apb_uart.c,v 1.10 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -45,9 +45,9 @@ __KERNEL_RCSID(1, "$NetBSD: dw_apb_uart.c,v 1.9 2021/01/15 20:50:49 ryo Exp $"); static int dw_apb_uart_match(device_t, cfdata_t, void *); static void dw_apb_uart_attach(device_t, device_t, void *); -static const char * const compatible[] = { - "snps,dw-apb-uart", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "snps,dw-apb-uart" }, + DEVICE_COMPAT_EOL }; struct dw_apb_uart_softc { @@ -67,7 +67,7 @@ dw_apb_uart_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -152,7 +152,7 @@ dw_apb_uart_attach(device_t parent, device_t self, void *aux) static int dw_apb_uart_console_match(int phandle) { - return of_match_compatible(phandle, compatible); + return of_compatible_match(phandle, compat_data); } static void diff --git a/sys/dev/fdt/dwc2_fdt.c b/sys/dev/fdt/dwc2_fdt.c index cfdfc049a894..25c81713cb41 100644 --- a/sys/dev/fdt/dwc2_fdt.c +++ b/sys/dev/fdt/dwc2_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: dwc2_fdt.c,v 1.9 2021/01/27 02:24:10 thorpej Exp $ */ +/* $NetBSD: dwc2_fdt.c,v 1.10 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dwc2_fdt.c,v 1.9 2021/01/27 02:24:10 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dwc2_fdt.c,v 1.10 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -104,7 +104,7 @@ dwc2_fdt_match(device_t parent, struct cfdata *match, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } /* ARGSUSED */ @@ -115,7 +115,7 @@ dwc2_fdt_attach(device_t parent, device_t self, void *aux) struct fdt_attach_args * const faa = aux; const int phandle = faa->faa_phandle; const struct dwc2_fdt_config *conf = - of_search_compatible(phandle, compat_data)->data; + of_compatible_lookup(phandle, compat_data)->data; char intrstr[128]; struct fdtbus_phy *phy; struct clk *clk; diff --git a/sys/dev/fdt/dwc3_fdt.c b/sys/dev/fdt/dwc3_fdt.c index 86e8c540c138..ff280dafc714 100644 --- a/sys/dev/fdt/dwc3_fdt.c +++ b/sys/dev/fdt/dwc3_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: dwc3_fdt.c,v 1.12 2021/01/15 20:50:49 ryo Exp $ */ +/* $NetBSD: dwc3_fdt.c,v 1.13 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2018 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dwc3_fdt.c,v 1.12 2021/01/15 20:50:49 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dwc3_fdt.c,v 1.13 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -202,31 +202,33 @@ dwc3_fdt_set_mode(struct xhci_softc *sc, u_int mode) WR4(sc, DWC3_GCTL, val); } +static const struct device_compatible_entry compat_data[] = { + /* 1 = parent of dwc3 subnode */ + { .compat = "allwinner,sun50i-h6-dwc3", .value = 1 }, + { .compat = "amlogic,meson-gxl-dwc3", .value = 1 }, + { .compat = "fsl,imx8mq-dwc3", .value = 1 }, + { .compat = "rockchip,rk3328-dwc3", .value = 1 }, + { .compat = "rockchip,rk3399-dwc3", .value = 1 }, + { .compat = "samsung,exynos5250-dwusb3", .value = 1 }, + { .compat = "snps,dwc3", .value = 0 }, + DEVICE_COMPAT_EOL +}; + static int dwc3_fdt_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "allwinner,sun50i-h6-dwc3", - "amlogic,meson-gxl-dwc3", - "fsl,imx8mq-dwc3", - "rockchip,rk3328-dwc3", - "rockchip,rk3399-dwc3", - "samsung,exynos5250-dwusb3", - "snps,dwc3", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void dwc3_fdt_attach(device_t parent, device_t self, void *aux) { - const char * const dwc3_compatible[] = { "snps,dwc3", NULL }; struct xhci_softc * const sc = device_private(self); struct fdt_attach_args * const faa = aux; const int phandle = faa->faa_phandle; + const struct device_compatible_entry *dce; struct fdtbus_reset *rst; struct fdtbus_phy *phy; struct clk *clk; @@ -237,11 +239,14 @@ dwc3_fdt_attach(device_t parent, device_t self, void *aux) void *ih; u_int n; + dce = of_compatible_lookup(phandle, compat_data); + KASSERT(dce != NULL); + /* Find dwc3 sub-node */ - if (of_match_compatible(phandle, dwc3_compatible) > 0) { - dwc3_phandle = phandle; - } else { + if (dce->value != 0) { dwc3_phandle = of_find_firstchild_byname(phandle, "dwc3"); + } else { + dwc3_phandle = phandle; } if (dwc3_phandle <= 0) { aprint_error(": couldn't find dwc3 child node\n"); diff --git a/sys/dev/fdt/dwcmmc_fdt.c b/sys/dev/fdt/dwcmmc_fdt.c index c63e11ae749b..5964d08ad4fa 100644 --- a/sys/dev/fdt/dwcmmc_fdt.c +++ b/sys/dev/fdt/dwcmmc_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: dwcmmc_fdt.c,v 1.15 2021/01/27 02:24:10 thorpej Exp $ */ +/* $NetBSD: dwcmmc_fdt.c,v 1.16 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2015-2018 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dwcmmc_fdt.c,v 1.15 2021/01/27 02:24:10 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dwcmmc_fdt.c,v 1.16 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -90,7 +90,7 @@ dwcmmc_fdt_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -150,7 +150,7 @@ dwcmmc_fdt_attach(device_t parent, device_t self, void *aux) (uint64_t)addr, error); return; } - esc->sc_conf = of_search_compatible(phandle, compat_data)->data; + esc->sc_conf = of_compatible_lookup(phandle, compat_data)->data; if (of_getprop_uint32(phandle, "max-frequency", &sc->sc_clock_freq) != 0) sc->sc_clock_freq = UINT_MAX; diff --git a/sys/dev/fdt/dwcwdt_fdt.c b/sys/dev/fdt/dwcwdt_fdt.c index e9d01fd26d15..c993e5d95271 100644 --- a/sys/dev/fdt/dwcwdt_fdt.c +++ b/sys/dev/fdt/dwcwdt_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: dwcwdt_fdt.c,v 1.4 2019/10/19 13:08:52 tnn Exp $ */ +/* $NetBSD: dwcwdt_fdt.c,v 1.5 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2018 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dwcwdt_fdt.c,v 1.4 2019/10/19 13:08:52 tnn Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dwcwdt_fdt.c,v 1.5 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -82,9 +82,9 @@ static const uint32_t wdt_torr[] = { #define DWCWDT_PERIOD_DEFAULT 15 -static const char * const compatible[] = { - "snps,dw-wdt", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "snps,dw-wdt" }, + DEVICE_COMPAT_EOL }; struct dwcwdt_softc { @@ -168,7 +168,7 @@ dwcwdt_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/dwiic_fdt.c b/sys/dev/fdt/dwiic_fdt.c index 9844793cbf93..82ce90099eca 100644 --- a/sys/dev/fdt/dwiic_fdt.c +++ b/sys/dev/fdt/dwiic_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: dwiic_fdt.c,v 1.3 2021/01/15 22:35:39 jmcneill Exp $ */ +/* $NetBSD: dwiic_fdt.c,v 1.4 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2017 The NetBSD Foundation, Inc. @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dwiic_fdt.c,v 1.3 2021/01/15 22:35:39 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dwiic_fdt.c,v 1.4 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -41,9 +41,9 @@ __KERNEL_RCSID(0, "$NetBSD: dwiic_fdt.c,v 1.3 2021/01/15 22:35:39 jmcneill Exp $ #include #include -static const char * const compatible[] = { - "snps,designware-i2c", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "snps,designware-i2c" }, + DEVICE_COMPAT_EOL }; struct dwiic_fdt_softc { @@ -61,7 +61,7 @@ dwiic_fdt_match(device_t parent, cfdata_t match, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } void diff --git a/sys/dev/fdt/ehci_fdt.c b/sys/dev/fdt/ehci_fdt.c index 0927cbb57db4..05bb2db48451 100644 --- a/sys/dev/fdt/ehci_fdt.c +++ b/sys/dev/fdt/ehci_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: ehci_fdt.c,v 1.5 2021/01/15 20:50:49 ryo Exp $ */ +/* $NetBSD: ehci_fdt.c,v 1.6 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2015-2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ehci_fdt.c,v 1.5 2021/01/15 20:50:49 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ehci_fdt.c,v 1.6 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -52,16 +52,17 @@ CFATTACH_DECL2_NEW(ehci_fdt, sizeof(struct ehci_softc), ehci_fdt_match, ehci_fdt_attach, NULL, ehci_activate, NULL, ehci_childdet); +static const struct device_compatible_entry compat_data[] = { + { .compat = "generic-ehci" }, + DEVICE_COMPAT_EOL +}; + static int ehci_fdt_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "generic-ehci", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/fdt_panel.c b/sys/dev/fdt/fdt_panel.c index fdac5d893221..cc864d334cb8 100644 --- a/sys/dev/fdt/fdt_panel.c +++ b/sys/dev/fdt/fdt_panel.c @@ -1,4 +1,4 @@ -/* $NetBSD: fdt_panel.c,v 1.2 2019/12/19 16:00:52 jakllsch Exp $ */ +/* $NetBSD: fdt_panel.c,v 1.3 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2019 Jonathan A. Kollasch @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: fdt_panel.c,v 1.2 2019/12/19 16:00:52 jakllsch Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fdt_panel.c,v 1.3 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -44,9 +44,9 @@ __KERNEL_RCSID(0, "$NetBSD: fdt_panel.c,v 1.2 2019/12/19 16:00:52 jakllsch Exp $ #include #include -static const char * const compatible[] = { - "simple-panel", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "simple-panel" }, + DEVICE_COMPAT_EOL }; struct panel_fdt_softc { @@ -127,7 +127,7 @@ panel_fdt_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/fdtbus.c b/sys/dev/fdt/fdtbus.c index f3d58e2764f6..4b58a58adbfc 100644 --- a/sys/dev/fdt/fdtbus.c +++ b/sys/dev/fdt/fdtbus.c @@ -1,4 +1,4 @@ -/* $NetBSD: fdtbus.c,v 1.37 2021/01/27 02:24:10 thorpej Exp $ */ +/* $NetBSD: fdtbus.c,v 1.38 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: fdtbus.c,v 1.37 2021/01/27 02:24:10 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fdtbus.c,v 1.38 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -103,7 +103,7 @@ fdt_match(device_t parent, cfdata_t cf, void *aux) int match; /* Check compatible string */ - match = of_match_compat_data(phandle, compat_data); + match = of_compatible_match(phandle, compat_data); if (match) return match; diff --git a/sys/dev/fdt/fixedclock.c b/sys/dev/fdt/fixedclock.c index 62434d445ef3..9fc914973ed9 100644 --- a/sys/dev/fdt/fixedclock.c +++ b/sys/dev/fdt/fixedclock.c @@ -1,4 +1,4 @@ -/* $NetBSD: fixedclock.c,v 1.5 2018/09/09 07:21:18 aymeric Exp $ */ +/* $NetBSD: fixedclock.c,v 1.6 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: fixedclock.c,v 1.5 2018/09/09 07:21:18 aymeric Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fixedclock.c,v 1.6 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -74,13 +74,17 @@ struct fixedclock_softc { CFATTACH_DECL_NEW(fclock, sizeof(struct fixedclock_softc), fixedclock_match, fixedclock_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "fixed-clock" }, + DEVICE_COMPAT_EOL +}; + static int fixedclock_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { "fixed-clock", NULL }; const struct fdt_attach_args *faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/fixedfactorclock.c b/sys/dev/fdt/fixedfactorclock.c index c979c2fc365f..2bfbe3828285 100644 --- a/sys/dev/fdt/fixedfactorclock.c +++ b/sys/dev/fdt/fixedfactorclock.c @@ -1,4 +1,4 @@ -/* $NetBSD: fixedfactorclock.c,v 1.3 2018/09/09 07:21:18 aymeric Exp $ */ +/* $NetBSD: fixedfactorclock.c,v 1.4 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: fixedfactorclock.c,v 1.3 2018/09/09 07:21:18 aymeric Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fixedfactorclock.c,v 1.4 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -76,13 +76,17 @@ struct fixedfactorclock_softc { CFATTACH_DECL_NEW(ffclock, sizeof(struct fixedfactorclock_softc), fixedfactorclock_match, fixedfactorclock_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "fixed-factor-clock" }, + DEVICE_COMPAT_EOL +}; + static int fixedfactorclock_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { "fixed-factor-clock", NULL }; const struct fdt_attach_args *faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/fixedregulator.c b/sys/dev/fdt/fixedregulator.c index 6624552fde60..ce468d915d43 100644 --- a/sys/dev/fdt/fixedregulator.c +++ b/sys/dev/fdt/fixedregulator.c @@ -1,4 +1,4 @@ -/* $NetBSD: fixedregulator.c,v 1.9 2021/01/17 19:54:23 jmcneill Exp $ */ +/* $NetBSD: fixedregulator.c,v 1.10 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: fixedregulator.c,v 1.9 2021/01/17 19:54:23 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fixedregulator.c,v 1.10 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -74,13 +74,17 @@ struct fixedregulator_softc { CFATTACH_DECL_NEW(fregulator, sizeof(struct fixedregulator_softc), fixedregulator_match, fixedregulator_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "regulator-fixed" }, + DEVICE_COMPAT_EOL +}; + static int fixedregulator_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { "regulator-fixed", NULL }; const struct fdt_attach_args *faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/genet_fdt.c b/sys/dev/fdt/genet_fdt.c index bc34498f1bf0..d4a99c8cbe8e 100644 --- a/sys/dev/fdt/genet_fdt.c +++ b/sys/dev/fdt/genet_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: genet_fdt.c,v 1.3 2021/01/15 22:35:39 jmcneill Exp $ */ +/* $NetBSD: genet_fdt.c,v 1.4 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2020 Jared McNeill @@ -29,7 +29,7 @@ #include "opt_net_mpsafe.h" #include -__KERNEL_RCSID(0, "$NetBSD: genet_fdt.c,v 1.3 2021/01/15 22:35:39 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: genet_fdt.c,v 1.4 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -61,16 +61,17 @@ static void genet_fdt_attach(device_t, device_t, void *); CFATTACH_DECL_NEW(genet_fdt, sizeof(struct genet_softc), genet_fdt_match, genet_fdt_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "brcm,bcm2711-genet-v5" }, + DEVICE_COMPAT_EOL +}; + static int genet_fdt_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "brcm,bcm2711-genet-v5", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/gpiokeys.c b/sys/dev/fdt/gpiokeys.c index 812da79084f0..18d95354b03b 100644 --- a/sys/dev/fdt/gpiokeys.c +++ b/sys/dev/fdt/gpiokeys.c @@ -1,4 +1,4 @@ -/* $NetBSD: gpiokeys.c,v 1.8 2018/05/10 13:05:18 jmcneill Exp $ */ +/* $NetBSD: gpiokeys.c,v 1.9 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: gpiokeys.c,v 1.8 2018/05/10 13:05:18 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gpiokeys.c,v 1.9 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -140,13 +140,17 @@ static const struct wskbd_accessops gpiokeys_accessops = { .ioctl = gpiokeys_ioctl }; +static const struct device_compatible_entry compat_data[] = { + { .compat = "gpio-keys" }, + DEVICE_COMPAT_EOL +}; + static int gpiokeys_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { "gpio-keys", NULL }; const struct fdt_attach_args *faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/gpioleds.c b/sys/dev/fdt/gpioleds.c index 6ae126900499..b27573b4b4ed 100644 --- a/sys/dev/fdt/gpioleds.c +++ b/sys/dev/fdt/gpioleds.c @@ -1,4 +1,4 @@ -/* $NetBSD: gpioleds.c,v 1.1 2017/07/08 00:55:02 jmcneill Exp $ */ +/* $NetBSD: gpioleds.c,v 1.2 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: gpioleds.c,v 1.1 2017/07/08 00:55:02 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gpioleds.c,v 1.2 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -62,13 +62,17 @@ gpioleds_set(void *priv, int state) fdtbus_gpio_write(pin, state); } +static const struct device_compatible_entry compat_data[] = { + { .compat = "gpio-leds" }, + DEVICE_COMPAT_EOL +}; + static int gpioleds_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { "gpio-leds", NULL }; const struct fdt_attach_args *faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/gpioregulator.c b/sys/dev/fdt/gpioregulator.c index 7f784682479b..275b4ff36fad 100644 --- a/sys/dev/fdt/gpioregulator.c +++ b/sys/dev/fdt/gpioregulator.c @@ -1,4 +1,4 @@ -/* $NetBSD: gpioregulator.c,v 1.3 2021/01/17 19:54:23 jmcneill Exp $ */ +/* $NetBSD: gpioregulator.c,v 1.4 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: gpioregulator.c,v 1.3 2021/01/17 19:54:23 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gpioregulator.c,v 1.4 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -83,13 +83,17 @@ struct gpioregulator_softc { CFATTACH_DECL_NEW(gregulator, sizeof(struct gpioregulator_softc), gpioregulator_match, gpioregulator_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "regulator-gpio" }, + DEVICE_COMPAT_EOL +}; + static int gpioregulator_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { "regulator-gpio", NULL }; const struct fdt_attach_args *faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/hdmi_connector.c b/sys/dev/fdt/hdmi_connector.c index de580b4a7379..862495c00432 100644 --- a/sys/dev/fdt/hdmi_connector.c +++ b/sys/dev/fdt/hdmi_connector.c @@ -1,4 +1,4 @@ -/* $NetBSD: hdmi_connector.c,v 1.1 2019/01/30 01:24:00 jmcneill Exp $ */ +/* $NetBSD: hdmi_connector.c,v 1.2 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: hdmi_connector.c,v 1.1 2019/01/30 01:24:00 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hdmi_connector.c,v 1.2 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -45,9 +45,9 @@ __KERNEL_RCSID(0, "$NetBSD: hdmi_connector.c,v 1.1 2019/01/30 01:24:00 jmcneill #include #include -static const char * const compatible[] = { - "hdmi-connector", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "hdmi-connector" }, + DEVICE_COMPAT_EOL }; struct dispcon_hdmi_connector { @@ -210,7 +210,7 @@ dispcon_hdmi_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/i2cmux_fdt.c b/sys/dev/fdt/i2cmux_fdt.c index 7feeb49fd0e4..ce2353f782de 100644 --- a/sys/dev/fdt/i2cmux_fdt.c +++ b/sys/dev/fdt/i2cmux_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: i2cmux_fdt.c,v 1.9 2021/01/27 02:24:10 thorpej Exp $ */ +/* $NetBSD: i2cmux_fdt.c,v 1.10 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: i2cmux_fdt.c,v 1.9 2021/01/27 02:24:10 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i2cmux_fdt.c,v 1.10 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -251,7 +251,7 @@ iicmux_fdt_match(device_t const parent, cfdata_t const match, void * const aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -262,7 +262,7 @@ iicmux_fdt_attach(device_t const parent, device_t const self, void * const aux) sc->sc_dev = self; sc->sc_handle = faa->faa_phandle; - sc->sc_config = of_search_compatible(sc->sc_handle, compat_data)->data; + sc->sc_config = of_compatible_lookup(sc->sc_handle, compat_data)->data; aprint_naive("\n"); aprint_normal(": %s I2C mux\n", sc->sc_config->desc); diff --git a/sys/dev/fdt/mmc_pwrseq_emmc.c b/sys/dev/fdt/mmc_pwrseq_emmc.c index a26578fea700..419a32ec2d1c 100644 --- a/sys/dev/fdt/mmc_pwrseq_emmc.c +++ b/sys/dev/fdt/mmc_pwrseq_emmc.c @@ -1,4 +1,4 @@ -/* $NetBSD: mmc_pwrseq_emmc.c,v 1.1 2019/03/03 12:54:07 jmcneill Exp $ */ +/* $NetBSD: mmc_pwrseq_emmc.c,v 1.2 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mmc_pwrseq_emmc.c,v 1.1 2019/03/03 12:54:07 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mmc_pwrseq_emmc.c,v 1.2 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -40,9 +40,9 @@ __KERNEL_RCSID(0, "$NetBSD: mmc_pwrseq_emmc.c,v 1.1 2019/03/03 12:54:07 jmcneill #define MMCPWRSEQ_MAX_PINS 32 -static const char * const compatible[] = { - "mmc-pwrseq-emmc", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "mmc-pwrseq-emmc" }, + DEVICE_COMPAT_EOL }; struct mmcpwrseq_emmc_softc { @@ -71,7 +71,7 @@ mmcpwrseq_emmc_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/mmc_pwrseq_simple.c b/sys/dev/fdt/mmc_pwrseq_simple.c index 22122242d4cc..2cda231e8e29 100644 --- a/sys/dev/fdt/mmc_pwrseq_simple.c +++ b/sys/dev/fdt/mmc_pwrseq_simple.c @@ -1,4 +1,4 @@ -/* $NetBSD: mmc_pwrseq_simple.c,v 1.2 2019/03/03 12:54:07 jmcneill Exp $ */ +/* $NetBSD: mmc_pwrseq_simple.c,v 1.3 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mmc_pwrseq_simple.c,v 1.2 2019/03/03 12:54:07 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mmc_pwrseq_simple.c,v 1.3 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -40,9 +40,9 @@ __KERNEL_RCSID(0, "$NetBSD: mmc_pwrseq_simple.c,v 1.2 2019/03/03 12:54:07 jmcnei #define MMCPWRSEQ_MAX_PINS 32 -static const char * const compatible[] = { - "mmc-pwrseq-simple", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "mmc-pwrseq-simple" }, + DEVICE_COMPAT_EOL }; struct mmcpwrseq_simple_softc { @@ -109,7 +109,7 @@ mmcpwrseq_simple_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/ns8250_uart.c b/sys/dev/fdt/ns8250_uart.c index 8b122207b145..879d02861f1b 100644 --- a/sys/dev/fdt/ns8250_uart.c +++ b/sys/dev/fdt/ns8250_uart.c @@ -1,4 +1,4 @@ -/* $NetBSD: ns8250_uart.c,v 1.6 2021/01/27 02:24:10 thorpej Exp $ */ +/* $NetBSD: ns8250_uart.c,v 1.7 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2017-2020 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: ns8250_uart.c,v 1.6 2021/01/27 02:24:10 thorpej Exp $"); +__KERNEL_RCSID(1, "$NetBSD: ns8250_uart.c,v 1.7 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -95,7 +95,7 @@ ns8250_uart_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -115,7 +115,7 @@ ns8250_uart_attach(device_t parent, device_t self, void *aux) void *ih; const struct ns8250_config *config = - of_search_compatible(phandle, compat_data)->data; + of_compatible_lookup(phandle, compat_data)->data; if (fdtbus_get_reg(phandle, 0, &addr, &size) != 0) { aprint_error(": couldn't get registers\n"); @@ -180,7 +180,7 @@ ns8250_uart_attach(device_t parent, device_t self, void *aux) static int ns8250_uart_console_match(int phandle) { - return of_match_compat_data(phandle, compat_data); + return of_compatible_match(phandle, compat_data); } static void @@ -196,7 +196,7 @@ ns8250_uart_console_consinit(struct fdt_attach_args *faa, u_int uart_freq) int speed; const struct ns8250_config *config = - of_search_compatible(phandle, compat_data)->data; + of_compatible_lookup(phandle, compat_data)->data; fdtbus_get_reg(phandle, 0, &addr, NULL); speed = fdtbus_get_stdout_speed(); diff --git a/sys/dev/fdt/ohci_fdt.c b/sys/dev/fdt/ohci_fdt.c index 37d83b52020d..32a1165c6645 100644 --- a/sys/dev/fdt/ohci_fdt.c +++ b/sys/dev/fdt/ohci_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: ohci_fdt.c,v 1.4 2021/01/15 20:50:49 ryo Exp $ */ +/* $NetBSD: ohci_fdt.c,v 1.5 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2015-2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ohci_fdt.c,v 1.4 2021/01/15 20:50:49 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ohci_fdt.c,v 1.5 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -52,16 +52,17 @@ CFATTACH_DECL2_NEW(ohci_fdt, sizeof(struct ohci_softc), ohci_fdt_match, ohci_fdt_attach, NULL, ohci_activate, NULL, ohci_childdet); +static const struct device_compatible_entry compat_data[] = { + { .compat = "generic-ohci" }, + DEVICE_COMPAT_EOL +}; + static int ohci_fdt_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "generic-ohci", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/panel_fdt.c b/sys/dev/fdt/panel_fdt.c index 2e7b471c933e..c3daf44671ca 100644 --- a/sys/dev/fdt/panel_fdt.c +++ b/sys/dev/fdt/panel_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: panel_fdt.c,v 1.5 2021/01/27 02:24:10 thorpej Exp $ */ +/* $NetBSD: panel_fdt.c,v 1.6 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -39,7 +39,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: panel_fdt.c,v 1.5 2021/01/27 02:24:10 thorpej Exp $"); +__KERNEL_RCSID(1, "$NetBSD: panel_fdt.c,v 1.6 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -79,7 +79,7 @@ fdt_panel_match(device_t parent, cfdata_t cf, void *aux) { const struct fdt_attach_args *faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -98,7 +98,7 @@ fdt_panel_attach(device_t parent, device_t self, void *aux) sc->sc_dev = self; sc->sc_phandle = phandle; sc->sc_panel.panel_type = - of_search_compatible(phandle, compat_data)->value; + of_compatible_lookup(phandle, compat_data)->value; if (of_getprop_uint32(phandle, "width-mm", &sc->sc_panel.panel_width) || of_getprop_uint32(phandle, "height-mm", &sc->sc_panel.panel_height)){ diff --git a/sys/dev/fdt/pinctrl_single.c b/sys/dev/fdt/pinctrl_single.c index dc3f2951080c..8d3a2864b100 100644 --- a/sys/dev/fdt/pinctrl_single.c +++ b/sys/dev/fdt/pinctrl_single.c @@ -1,4 +1,4 @@ -/* $NetBSD: pinctrl_single.c,v 1.4 2021/01/27 02:24:10 thorpej Exp $ */ +/* $NetBSD: pinctrl_single.c,v 1.5 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pinctrl_single.c,v 1.4 2021/01/27 02:24:10 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pinctrl_single.c,v 1.5 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -140,7 +140,7 @@ pinctrl_single_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -159,7 +159,7 @@ pinctrl_single_attach(device_t parent, device_t self, void *aux) return; } - conf = of_search_compatible(phandle, compat_data)->data; + conf = of_compatible_lookup(phandle, compat_data)->data; sc->sc_dev = self; sc->sc_phandle = phandle; diff --git a/sys/dev/fdt/pl061gpio_fdt.c b/sys/dev/fdt/pl061gpio_fdt.c index b1ba57873c61..0abe69dec30a 100644 --- a/sys/dev/fdt/pl061gpio_fdt.c +++ b/sys/dev/fdt/pl061gpio_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: pl061gpio_fdt.c,v 1.4 2018/10/15 23:53:47 jmcneill Exp $ */ +/* $NetBSD: pl061gpio_fdt.c,v 1.5 2021/01/27 03:10:21 thorpej Exp $ */ /* * Copyright (c) 2018 Jonathan A. Kollasch @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pl061gpio_fdt.c,v 1.4 2018/10/15 23:53:47 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pl061gpio_fdt.c,v 1.5 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -71,16 +71,17 @@ struct plgpio_fdt_pin { CFATTACH_DECL_NEW(plgpio_fdt, sizeof(struct plgpio_softc), plgpio_fdt_match, plgpio_fdt_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "arm,pl061" }, + DEVICE_COMPAT_EOL +}; + static int plgpio_fdt_match(device_t parent, cfdata_t cf, void *aux) { - const char * const compatible[] = { - "arm,pl061", - NULL - }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/pwm_backlight.c b/sys/dev/fdt/pwm_backlight.c index 038aa127d97a..eec787b8bf47 100644 --- a/sys/dev/fdt/pwm_backlight.c +++ b/sys/dev/fdt/pwm_backlight.c @@ -1,4 +1,4 @@ -/* $NetBSD: pwm_backlight.c,v 1.8 2020/05/20 05:24:35 hkenken Exp $ */ +/* $NetBSD: pwm_backlight.c,v 1.9 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2018 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pwm_backlight.c,v 1.8 2020/05/20 05:24:35 hkenken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pwm_backlight.c,v 1.9 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -63,9 +63,9 @@ static void pwm_backlight_pmf_init(struct pwm_backlight_softc *); static void pwm_backlight_set(struct pwm_backlight_softc *, u_int, bool); static u_int pwm_backlight_get(struct pwm_backlight_softc *); -static const char *compatible[] = { - "pwm-backlight", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "pwm-backlight" }, + DEVICE_COMPAT_EOL }; CFATTACH_DECL_NEW(pwmbacklight, sizeof(struct pwm_backlight_softc), @@ -76,7 +76,7 @@ pwm_backlight_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/pwm_fan.c b/sys/dev/fdt/pwm_fan.c index b2199df49855..b67954bdf101 100644 --- a/sys/dev/fdt/pwm_fan.c +++ b/sys/dev/fdt/pwm_fan.c @@ -1,4 +1,4 @@ -/* $NetBSD: pwm_fan.c,v 1.1 2018/07/04 23:08:06 jmcneill Exp $ */ +/* $NetBSD: pwm_fan.c,v 1.2 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2018 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pwm_fan.c,v 1.1 2018/07/04 23:08:06 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pwm_fan.c,v 1.2 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -55,9 +55,9 @@ static void pwm_fan_attach(device_t, device_t, void *); static void pwm_fan_set(struct pwm_fan_softc *, u_int); -static const char *compatible[] = { - "pwm-fan", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "pwm-fan" }, + DEVICE_COMPAT_EOL }; CFATTACH_DECL_NEW(pwmfan, sizeof(struct pwm_fan_softc), @@ -68,7 +68,7 @@ pwm_fan_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/pwmregulator.c b/sys/dev/fdt/pwmregulator.c index c3a0695439be..7a42a1fc0427 100644 --- a/sys/dev/fdt/pwmregulator.c +++ b/sys/dev/fdt/pwmregulator.c @@ -1,4 +1,4 @@ -/* $NetBSD: pwmregulator.c,v 1.2 2021/01/01 03:07:51 ryo Exp $ */ +/* $NetBSD: pwmregulator.c,v 1.3 2021/01/27 03:10:21 thorpej Exp $ */ /* * Copyright (c) 2020 Ryo Shimizu @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pwmregulator.c,v 1.2 2021/01/01 03:07:51 ryo Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pwmregulator.c,v 1.3 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -78,9 +78,9 @@ struct pwmregulator_softc { CFATTACH_DECL_NEW(pregulator, sizeof(struct pwmregulator_softc), pwmregulator_match, pwmregulator_attach, NULL, NULL); -static const char * const compatible[] = { - "pwm-regulator", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "pwm-regulator" }, + DEVICE_COMPAT_EOL }; static int @@ -88,7 +88,7 @@ pwmregulator_match(device_t parent, cfdata_t cf, void *aux) { const struct fdt_attach_args *faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/qemufwcfg_fdt.c b/sys/dev/fdt/qemufwcfg_fdt.c index 7e1bb6c0320a..a3c6917a5e74 100644 --- a/sys/dev/fdt/qemufwcfg_fdt.c +++ b/sys/dev/fdt/qemufwcfg_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: qemufwcfg_fdt.c,v 1.1 2018/06/15 15:07:56 jakllsch Exp $ */ +/* $NetBSD: qemufwcfg_fdt.c,v 1.2 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: qemufwcfg_fdt.c,v 1.1 2018/06/15 15:07:56 jakllsch Exp $"); +__KERNEL_RCSID(0, "$NetBSD: qemufwcfg_fdt.c,v 1.2 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -49,9 +49,9 @@ CFATTACH_DECL_NEW(qemufwcfg_fdt, sizeof(struct fwcfg_softc), NULL ); -static const char * const compatible[] = { - "qemu,fw-cfg-mmio", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "qemu,fw-cfg-mmio" }, + DEVICE_COMPAT_EOL }; @@ -60,7 +60,7 @@ fwcfg_fdt_match(device_t parent, cfdata_t match, void *opaque) { struct fdt_attach_args * const faa = opaque; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/simple_amplifier.c b/sys/dev/fdt/simple_amplifier.c index a28d46a7ae77..3c5f81750cf7 100644 --- a/sys/dev/fdt/simple_amplifier.c +++ b/sys/dev/fdt/simple_amplifier.c @@ -1,4 +1,4 @@ -/* $NetBSD: simple_amplifier.c,v 1.1 2020/01/02 00:57:09 jmcneill Exp $ */ +/* $NetBSD: simple_amplifier.c,v 1.2 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2020 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: simple_amplifier.c,v 1.1 2020/01/02 00:57:09 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: simple_amplifier.c,v 1.2 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -50,9 +50,9 @@ struct simple_amplifier_softc { static int simple_amplifier_match(device_t, cfdata_t, void *); static void simple_amplifier_attach(device_t, device_t, void *); -static const char *compatible[] = { - "simple-audio-amplifier", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "simple-audio-amplifier" }, + DEVICE_COMPAT_EOL }; CFATTACH_DECL_NEW(simpleamp, sizeof(struct simple_amplifier_softc), @@ -113,7 +113,7 @@ simple_amplifier_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/simplefb.c b/sys/dev/fdt/simplefb.c index 32a7238db0e4..5a84fcba99dc 100644 --- a/sys/dev/fdt/simplefb.c +++ b/sys/dev/fdt/simplefb.c @@ -1,4 +1,4 @@ -/* $NetBSD: simplefb.c,v 1.11 2020/10/21 11:02:31 rin Exp $ */ +/* $NetBSD: simplefb.c,v 1.12 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2017 Jared McNeill @@ -29,7 +29,7 @@ #include "opt_wsdisplay_compat.h" #include -__KERNEL_RCSID(0, "$NetBSD: simplefb.c,v 1.11 2020/10/21 11:02:31 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: simplefb.c,v 1.12 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -40,9 +40,9 @@ __KERNEL_RCSID(0, "$NetBSD: simplefb.c,v 1.11 2020/10/21 11:02:31 rin Exp $"); #include -static const char * const compatible[] = { - "simple-framebuffer", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "simple-framebuffer" }, + DEVICE_COMPAT_EOL }; struct simplefb_softc { @@ -231,7 +231,7 @@ simplefb_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void @@ -255,7 +255,7 @@ CFATTACH_DECL_NEW(simplefb, sizeof(struct simplefb_softc), static int simplefb_console_match(int phandle) { - return of_match_compatible(phandle, compatible); + return of_compatible_match(phandle, compat_data); } static void diff --git a/sys/dev/fdt/spdif_tx.c b/sys/dev/fdt/spdif_tx.c index 901f3f7e962a..d45127180467 100644 --- a/sys/dev/fdt/spdif_tx.c +++ b/sys/dev/fdt/spdif_tx.c @@ -1,4 +1,4 @@ -/* $NetBSD: spdif_tx.c,v 1.1 2019/11/17 19:30:42 jmcneill Exp $ */ +/* $NetBSD: spdif_tx.c,v 1.2 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: spdif_tx.c,v 1.1 2019/11/17 19:30:42 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: spdif_tx.c,v 1.2 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -48,9 +48,9 @@ struct spdif_tx_softc { static int spdif_tx_match(device_t, cfdata_t, void *); static void spdif_tx_attach(device_t, device_t, void *); -static const char *compatible[] = { - "linux,spdif-dit", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "linux,spdif-dit" }, + DEVICE_COMPAT_EOL }; CFATTACH_DECL_NEW(spdiftx, sizeof(struct spdif_tx_softc), @@ -90,7 +90,7 @@ spdif_tx_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/syscon.c b/sys/dev/fdt/syscon.c index 3ad87e166a11..906453980d6f 100644 --- a/sys/dev/fdt/syscon.c +++ b/sys/dev/fdt/syscon.c @@ -1,4 +1,4 @@ -/* $NetBSD: syscon.c,v 1.4 2019/10/28 21:13:48 jmcneill Exp $ */ +/* $NetBSD: syscon.c,v 1.5 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2018 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: syscon.c,v 1.4 2019/10/28 21:13:48 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: syscon.c,v 1.5 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -52,10 +52,10 @@ struct syscon_softc { static int syscon_match(device_t, cfdata_t, void *); static void syscon_attach(device_t, device_t, void *); -static const char *compatible[] = { - "syscon", - "simple-mfd", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "syscon" }, + { .compat = "simple-mfd" }, + DEVICE_COMPAT_EOL }; CFATTACH_DECL_NEW(syscon, sizeof(struct syscon_softc), @@ -102,7 +102,7 @@ syscon_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/usbnopphy.c b/sys/dev/fdt/usbnopphy.c index 2f1345dce7f2..173fd82d1ab1 100644 --- a/sys/dev/fdt/usbnopphy.c +++ b/sys/dev/fdt/usbnopphy.c @@ -1,4 +1,4 @@ -/* $NetBSD: usbnopphy.c,v 1.1 2019/10/30 21:37:56 jmcneill Exp $ */ +/* $NetBSD: usbnopphy.c,v 1.2 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill @@ -28,7 +28,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: usbnopphy.c,v 1.1 2019/10/30 21:37:56 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: usbnopphy.c,v 1.2 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -42,9 +42,9 @@ __KERNEL_RCSID(0, "$NetBSD: usbnopphy.c,v 1.1 2019/10/30 21:37:56 jmcneill Exp $ static int usbnopphy_match(device_t, cfdata_t, void *); static void usbnopphy_attach(device_t, device_t, void *); -static const char * const compatible[] = { - "usb-nop-xceiv", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "usb-nop-xceiv" }, + DEVICE_COMPAT_EOL }; struct usbnopphy_softc { @@ -117,7 +117,7 @@ usbnopphy_match(device_t parent, cfdata_t cf, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/virtio_mmio_fdt.c b/sys/dev/fdt/virtio_mmio_fdt.c index 76c5f610792f..f5da1f4db682 100644 --- a/sys/dev/fdt/virtio_mmio_fdt.c +++ b/sys/dev/fdt/virtio_mmio_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: virtio_mmio_fdt.c,v 1.6 2021/01/20 21:59:48 reinoud Exp $ */ +/* $NetBSD: virtio_mmio_fdt.c,v 1.7 2021/01/27 03:10:21 thorpej Exp $ */ /* * Copyright (c) 2018 Jonathan A. Kollasch @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: virtio_mmio_fdt.c,v 1.6 2021/01/20 21:59:48 reinoud Exp $"); +__KERNEL_RCSID(0, "$NetBSD: virtio_mmio_fdt.c,v 1.7 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -56,9 +56,9 @@ CFATTACH_DECL3_NEW(virtio_mmio_fdt, sizeof(struct virtio_mmio_fdt_softc), virtio_mmio_fdt_match, virtio_mmio_fdt_attach, virtio_mmio_fdt_detach, NULL, virtio_mmio_fdt_rescan, (void *)voidop, DVF_DETACH_SHUTDOWN); -static const char * const compatible[] = { - "virtio,mmio", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "virtio,mmio" }, + DEVICE_COMPAT_EOL }; static int @@ -66,7 +66,7 @@ virtio_mmio_fdt_match(device_t parent, cfdata_t match, void *aux) { struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/fdt/vmt_fdt.c b/sys/dev/fdt/vmt_fdt.c index b4b818330b3c..3eb91e51dbaf 100644 --- a/sys/dev/fdt/vmt_fdt.c +++ b/sys/dev/fdt/vmt_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: vmt_fdt.c,v 1.4 2021/01/27 02:24:10 thorpej Exp $ */ +/* $NetBSD: vmt_fdt.c,v 1.5 2021/01/27 03:10:21 thorpej Exp $ */ /* * Copyright (c) 2020 Ryo Shimizu @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vmt_fdt.c,v 1.4 2021/01/27 02:24:10 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vmt_fdt.c,v 1.5 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -55,7 +55,7 @@ vmt_fdt_match(device_t parent, cfdata_t cf, void *aux) if (OF_finddevice("/hypervisor") != faa->faa_phandle) return 0; - return of_match_compat_data(faa->faa_phandle, compat_data); + return of_compatible_match(faa->faa_phandle, compat_data); } static void diff --git a/sys/dev/i2c/twl4030.c b/sys/dev/i2c/twl4030.c index 0bceed4930dc..0987ce8fb352 100644 --- a/sys/dev/i2c/twl4030.c +++ b/sys/dev/i2c/twl4030.c @@ -1,4 +1,4 @@ -/* $NetBSD: twl4030.c,v 1.5 2021/01/27 02:28:37 thorpej Exp $ */ +/* $NetBSD: twl4030.c,v 1.6 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2019 Jared McNeill @@ -29,7 +29,7 @@ #include "opt_fdt.h" #include -__KERNEL_RCSID(0, "$NetBSD: twl4030.c,v 1.5 2021/01/27 02:28:37 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: twl4030.c,v 1.6 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -390,10 +390,10 @@ twl_attach(device_t parent, device_t self, void *aux) #ifdef FDT for (int child = OF_child(sc->sc_phandle); child; child = OF_peer(child)) { - if (of_match_compat_data(child, gpio_compat_data)) { + if (of_compatible_match(child, gpio_compat_data)) { aprint_normal(", GPIO"); twl_gpio_attach(sc, child); - } else if (of_match_compat_data(child, rtc_compat_data)) { + } else if (of_compatible_match(child, rtc_compat_data)) { aprint_normal(", RTC"); twl_rtc_attach(sc, child); } diff --git a/sys/dev/ofisa/atppc_ofisa.c b/sys/dev/ofisa/atppc_ofisa.c index ffd834792d53..af61fcd2d27a 100644 --- a/sys/dev/ofisa/atppc_ofisa.c +++ b/sys/dev/ofisa/atppc_ofisa.c @@ -1,4 +1,4 @@ -/* $NetBSD: atppc_ofisa.c,v 1.13 2021/01/27 02:31:03 thorpej Exp $ */ +/* $NetBSD: atppc_ofisa.c,v 1.14 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: atppc_ofisa.c,v 1.13 2021/01/27 02:31:03 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: atppc_ofisa.c,v 1.14 2021/01/27 03:10:21 thorpej Exp $"); #include "opt_atppc.h" @@ -88,7 +88,7 @@ atppc_ofisa_match(device_t parent, cfdata_t match, void *aux) struct ofisa_attach_args *aa = aux; int rv; - rv = of_match_compat_data(aa->oba.oba_phandle, compat_data) ? 5 : 0; + rv = of_compatible_match(aa->oba.oba_phandle, compat_data) ? 5 : 0; #ifdef _LPT_OFISA_MD_MATCH if (!rv) rv = lpt_ofisa_md_match(parent, match, aux); diff --git a/sys/dev/ofisa/com_ofisa.c b/sys/dev/ofisa/com_ofisa.c index 65345d04f5bc..99dfddb7c09a 100644 --- a/sys/dev/ofisa/com_ofisa.c +++ b/sys/dev/ofisa/com_ofisa.c @@ -1,4 +1,4 @@ -/* $NetBSD: com_ofisa.c,v 1.19 2021/01/27 02:31:03 thorpej Exp $ */ +/* $NetBSD: com_ofisa.c,v 1.20 2021/01/27 03:10:21 thorpej Exp $ */ /* * Copyright 1997, 1998 @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: com_ofisa.c,v 1.19 2021/01/27 02:31:03 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: com_ofisa.c,v 1.20 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -79,7 +79,7 @@ com_ofisa_probe(device_t parent, cfdata_t cf, void *aux) struct ofisa_attach_args *aa = aux; int rv; - rv = of_match_compat_data(aa->oba.oba_phandle, compat_data) ? 5 : 0; + rv = of_compatible_match(aa->oba.oba_phandle, compat_data) ? 5 : 0; #ifdef _COM_OFISA_MD_MATCH if (!rv) rv = com_ofisa_md_match(parent, cf, aux); diff --git a/sys/dev/ofisa/ess_ofisa.c b/sys/dev/ofisa/ess_ofisa.c index 03da11ab6c31..286176b1d7e3 100644 --- a/sys/dev/ofisa/ess_ofisa.c +++ b/sys/dev/ofisa/ess_ofisa.c @@ -1,4 +1,4 @@ -/* $NetBSD: ess_ofisa.c,v 1.31 2021/01/27 02:31:03 thorpej Exp $ */ +/* $NetBSD: ess_ofisa.c,v 1.32 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ess_ofisa.c,v 1.31 2021/01/27 02:31:03 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ess_ofisa.c,v 1.32 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -69,7 +69,7 @@ ess_ofisa_match(device_t parent, cfdata_t cf, void *aux) struct ofisa_attach_args *aa = aux; /* beat generic SB */ - return of_match_compat_data(aa->oba.oba_phandle, compat_data) ? 10 : 0; + return of_compatible_match(aa->oba.oba_phandle, compat_data) ? 10 : 0; } void diff --git a/sys/dev/ofisa/if_cs_ofisa.c b/sys/dev/ofisa/if_cs_ofisa.c index b43f2d0f4e37..555ad9292f5a 100644 --- a/sys/dev/ofisa/if_cs_ofisa.c +++ b/sys/dev/ofisa/if_cs_ofisa.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_cs_ofisa.c,v 1.30 2021/01/27 02:31:03 thorpej Exp $ */ +/* $NetBSD: if_cs_ofisa.c,v 1.31 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_cs_ofisa.c,v 1.30 2021/01/27 02:31:03 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_cs_ofisa.c,v 1.31 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -79,7 +79,7 @@ cs_ofisa_match(device_t parent, cfdata_t cf, void *aux) struct ofisa_attach_args *aa = aux; int rv; - rv = of_match_compat_data(aa->oba.oba_phandle, compat_data) ? 5 : 0; + rv = of_compatible_match(aa->oba.oba_phandle, compat_data) ? 5 : 0; #ifdef _CS_OFISA_MD_MATCH if (rv == 0) rv = cs_ofisa_md_match(parent, cf, aux); diff --git a/sys/dev/ofisa/joy_ofisa.c b/sys/dev/ofisa/joy_ofisa.c index 1bfebda3f01d..c9a2d47e2a35 100644 --- a/sys/dev/ofisa/joy_ofisa.c +++ b/sys/dev/ofisa/joy_ofisa.c @@ -1,4 +1,4 @@ -/* $NetBSD: joy_ofisa.c,v 1.19 2021/01/27 02:31:03 thorpej Exp $ */ +/* $NetBSD: joy_ofisa.c,v 1.20 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 1996, 1998, 2008 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: joy_ofisa.c,v 1.19 2021/01/27 02:31:03 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: joy_ofisa.c,v 1.20 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -68,7 +68,7 @@ joy_ofisa_match(device_t parent, cfdata_t match, void *aux) { struct ofisa_attach_args *aa = aux; - return of_match_compat_data(aa->oba.oba_phandle, compat_data); + return of_compatible_match(aa->oba.oba_phandle, compat_data); } static void diff --git a/sys/dev/ofisa/lpt_ofisa.c b/sys/dev/ofisa/lpt_ofisa.c index e8da463bb1ed..42cb0b0d3759 100644 --- a/sys/dev/ofisa/lpt_ofisa.c +++ b/sys/dev/ofisa/lpt_ofisa.c @@ -1,4 +1,4 @@ -/* $NetBSD: lpt_ofisa.c,v 1.18 2021/01/27 02:31:03 thorpej Exp $ */ +/* $NetBSD: lpt_ofisa.c,v 1.19 2021/01/27 03:10:21 thorpej Exp $ */ /* * Copyright 1997, 1998 @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: lpt_ofisa.c,v 1.18 2021/01/27 02:31:03 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lpt_ofisa.c,v 1.19 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -79,7 +79,7 @@ lpt_ofisa_probe(device_t parent, cfdata_t cf, void *aux) struct ofisa_attach_args *aa = aux; int rv; - rv = of_match_compat_data(aa->oba.oba_phandle, compat_data) ? 5 : 0; + rv = of_compatible_match(aa->oba.oba_phandle, compat_data) ? 5 : 0; #ifdef _LPT_OFISA_MD_MATCH if (!rv) rv = lpt_ofisa_md_match(parent, cf, aux); diff --git a/sys/dev/ofisa/ofisa.c b/sys/dev/ofisa/ofisa.c index 6c16718caabf..88664b1a322e 100644 --- a/sys/dev/ofisa/ofisa.c +++ b/sys/dev/ofisa/ofisa.c @@ -1,4 +1,4 @@ -/* $NetBSD: ofisa.c,v 1.29 2021/01/27 02:31:03 thorpej Exp $ */ +/* $NetBSD: ofisa.c,v 1.30 2021/01/27 03:10:21 thorpej Exp $ */ /* * Copyright 1997, 1998 @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ofisa.c,v 1.29 2021/01/27 02:31:03 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ofisa.c,v 1.30 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -86,7 +86,7 @@ ofisamatch(device_t parent, cfdata_t cf, void *aux) struct ofbus_attach_args *oba = aux; int rv; - rv = of_match_compat_data(oba->oba_phandle, compat_data) ? 5 : 0; + rv = of_compatible_match(oba->oba_phandle, compat_data) ? 5 : 0; #ifdef _OFISA_MD_MATCH if (!rv) rv = ofisa_md_match(parent, cf, aux); diff --git a/sys/dev/ofisa/pckbc_ofisa.c b/sys/dev/ofisa/pckbc_ofisa.c index 746bd343c524..454be1d91969 100644 --- a/sys/dev/ofisa/pckbc_ofisa.c +++ b/sys/dev/ofisa/pckbc_ofisa.c @@ -1,4 +1,4 @@ -/* $NetBSD: pckbc_ofisa.c,v 1.18 2021/01/27 02:31:03 thorpej Exp $ */ +/* $NetBSD: pckbc_ofisa.c,v 1.19 2021/01/27 03:10:21 thorpej Exp $ */ /* * Copyright (c) 1998 @@ -28,7 +28,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pckbc_ofisa.c,v 1.18 2021/01/27 02:31:03 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pckbc_ofisa.c,v 1.19 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -80,7 +80,7 @@ pckbc_ofisa_match(device_t parent, cfdata_t match, void *aux) { struct ofisa_attach_args *aa = aux; - return of_match_compat_data(aa->oba.oba_phandle, compat_data) ? 5 : 0; + return of_compatible_match(aa->oba.oba_phandle, compat_data) ? 5 : 0; } static void @@ -103,7 +103,7 @@ pckbc_ofisa_attach(device_t parent, device_t self, void *aux) phandle = OF_child(aa->oba.oba_phandle); while (phandle != 0) { - dce = of_search_compatible(phandle, port_compat_data); + dce = of_compatible_lookup(phandle, port_compat_data); if (dce != NULL) { ofisa_intr_get(phandle, &osc->sc_intr[dce->value], 1); } diff --git a/sys/dev/ofisa/sb_ofisa.c b/sys/dev/ofisa/sb_ofisa.c index 70a86dc55e9e..3cb536b02016 100644 --- a/sys/dev/ofisa/sb_ofisa.c +++ b/sys/dev/ofisa/sb_ofisa.c @@ -1,4 +1,4 @@ -/* $NetBSD: sb_ofisa.c,v 1.22 2021/01/27 02:31:03 thorpej Exp $ */ +/* $NetBSD: sb_ofisa.c,v 1.23 2021/01/27 03:10:21 thorpej Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sb_ofisa.c,v 1.22 2021/01/27 02:31:03 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sb_ofisa.c,v 1.23 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -75,7 +75,7 @@ sb_ofisa_match(device_t parent, cfdata_t cf, void *aux) * Use a low match priority so that a more specific driver * can match, e.g. a native ESS driver. */ - return of_match_compat_data(aa->oba.oba_phandle, compat_data) ? 1 : 0; + return of_compatible_match(aa->oba.oba_phandle, compat_data) ? 1 : 0; } void diff --git a/sys/dev/ofisa/wdc_ofisa.c b/sys/dev/ofisa/wdc_ofisa.c index ca3c7e4d1cc7..516bd5131882 100644 --- a/sys/dev/ofisa/wdc_ofisa.c +++ b/sys/dev/ofisa/wdc_ofisa.c @@ -1,4 +1,4 @@ -/* $NetBSD: wdc_ofisa.c,v 1.39 2021/01/27 02:31:03 thorpej Exp $ */ +/* $NetBSD: wdc_ofisa.c,v 1.40 2021/01/27 03:10:21 thorpej Exp $ */ /* * Copyright 1997, 1998 @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wdc_ofisa.c,v 1.39 2021/01/27 02:31:03 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wdc_ofisa.c,v 1.40 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -82,7 +82,7 @@ wdc_ofisa_probe(device_t parent, cfdata_t cf, void *aux) struct ofisa_attach_args *aa = aux; int rv; - rv = of_match_compat_data(aa->oba.oba_phandle, compat_data) ? 5 : 0; + rv = of_compatible_match(aa->oba.oba_phandle, compat_data) ? 5 : 0; #ifdef _WDC_OFISA_MD_MATCH if (!rv) rv = wdc_ofisa_md_match(parent, cf, aux); diff --git a/sys/dev/ofw/ofw_subr.c b/sys/dev/ofw/ofw_subr.c index 046e7a76f615..542d718a5d9c 100644 --- a/sys/dev/ofw/ofw_subr.c +++ b/sys/dev/ofw/ofw_subr.c @@ -1,4 +1,4 @@ -/* $NetBSD: ofw_subr.c,v 1.53 2021/01/26 14:55:57 thorpej Exp $ */ +/* $NetBSD: ofw_subr.c,v 1.54 2021/01/27 03:10:21 thorpej Exp $ */ /* * Copyright 1998 @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ofw_subr.c,v 1.53 2021/01/26 14:55:57 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ofw_subr.c,v 1.54 2021/01/27 03:10:21 thorpej Exp $"); #include #include @@ -80,7 +80,7 @@ of_decode_int(const unsigned char *p) * This routine checks an OFW node's "compatible" entry to see if * it matches any of the provided strings. * - * of_match_compat_data() is the preferred way to perform driver + * of_compatible_match() is the preferred way to perform driver * compatibility match. However, this routine that deals with * only strings is useful in some situations and is provided for * convenience. @@ -142,7 +142,7 @@ of_match_compatible(int phandle, const char * const *strings) } /* - * int of_match_compat_data(phandle, compat_data) + * int of_compatible_match(phandle, compat_data) * * This routine searches an array of device_compatible_entry structures * for a matching "compatible" entry matching the supplied OFW node, @@ -170,7 +170,7 @@ of_match_compatible(int phandle, const char * const *strings) * None. */ int -of_match_compat_data(int phandle, +of_compatible_match(int phandle, const struct device_compatible_entry *compat_data) { char *prop, propbuf[OFW_MAX_STACK_BUF_SIZE]; @@ -195,7 +195,7 @@ of_match_compat_data(int phandle, } /* - * const struct device_compatible_entry *of_search_compatible(phandle, + * const struct device_compatible_entry *of_compatible_lookup(phandle, * compat_data) * * This routine searches an array of device_compatible_entry structures @@ -217,7 +217,7 @@ of_match_compat_data(int phandle, * None. */ const struct device_compatible_entry * -of_search_compatible(int phandle, +of_compatible_lookup(int phandle, const struct device_compatible_entry *compat_data) { char *prop, propbuf[OFW_MAX_STACK_BUF_SIZE]; diff --git a/sys/dev/ofw/openfirm.h b/sys/dev/ofw/openfirm.h index 8f6108658d5a..474dba3967f8 100644 --- a/sys/dev/ofw/openfirm.h +++ b/sys/dev/ofw/openfirm.h @@ -1,4 +1,4 @@ -/* $NetBSD: openfirm.h,v 1.42 2021/01/25 19:59:49 mrg Exp $ */ +/* $NetBSD: openfirm.h,v 1.43 2021/01/27 03:10:21 thorpej Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -107,9 +107,9 @@ struct device_compatible_entry; int of_compatible(int, const char * const *); int of_match_compatible(int, const char * const *); -int of_match_compat_data(int, const struct device_compatible_entry *); +int of_compatible_match(int, const struct device_compatible_entry *); const struct device_compatible_entry * - of_search_compatible(int, const struct device_compatible_entry *); + of_compatible_lookup(int, const struct device_compatible_entry *); int of_decode_int(const unsigned char *); int of_packagename(int, char *, int); int of_find_firstchild_byname(int, const char *); diff --git a/sys/dev/sdmmc/if_bwfm_sdio.c b/sys/dev/sdmmc/if_bwfm_sdio.c index df70a034e8da..a4bb42598821 100644 --- a/sys/dev/sdmmc/if_bwfm_sdio.c +++ b/sys/dev/sdmmc/if_bwfm_sdio.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_bwfm_sdio.c,v 1.24 2020/11/03 09:26:41 mlelstv Exp $ */ +/* $NetBSD: if_bwfm_sdio.c,v 1.25 2021/01/27 03:10:21 thorpej Exp $ */ /* $OpenBSD: if_bwfm_sdio.c,v 1.1 2017/10/11 17:19:50 patrick Exp $ */ /* * Copyright (c) 2010-2016 Broadcom Corporation @@ -304,9 +304,9 @@ static const struct bwfm_sdio_product { }, }; -static const char * const compatible[] = { - "brcm,bcm4329-fmac", - NULL +static const struct device_compatible_entry compat_data[] = { + { .compat = "brcm,bcm4329-fmac" }, + DEVICE_COMPAT_EOL }; static int @@ -583,7 +583,7 @@ bwfm_fdt_find_phandle(device_t self, device_t parent) phandle = OF_child(OF_finddevice(str)); } - if (!of_match_compatible(phandle, compatible)) + if (!of_compatible_match(phandle, compat_data)) return -1; return phandle; diff --git a/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_netbsd_fdt.c b/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_netbsd_fdt.c index 947281e34582..18fd587bb52b 100644 --- a/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_netbsd_fdt.c +++ b/sys/external/bsd/vchiq/dist/interface/vchiq_arm/vchiq_netbsd_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: vchiq_netbsd_fdt.c,v 1.4 2021/01/15 22:58:49 jmcneill Exp $ */ +/* $NetBSD: vchiq_netbsd_fdt.c,v 1.5 2021/01/27 03:10:22 thorpej Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vchiq_netbsd_fdt.c,v 1.4 2021/01/15 22:58:49 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vchiq_netbsd_fdt.c,v 1.5 2021/01/27 03:10:22 thorpej Exp $"); #include #include @@ -65,13 +65,17 @@ int vchiq_init(void); CFATTACH_DECL_NEW(vchiq_fdt, sizeof(struct vchiq_fdt_softc), vchiq_fdt_match, vchiq_fdt_attach, NULL, NULL); +static const struct device_compatible_entry compat_data[] = { + { .compat = "brcm,bcm2835-vchiq" }, + DEVICE_COMPAT_EOL +}; + static int vchiq_fdt_match(device_t parent, cfdata_t match, void *aux) { - const char * const compatible[] = { "brcm,bcm2835-vchiq", NULL }; struct fdt_attach_args * const faa = aux; - return of_match_compatible(faa->faa_phandle, compatible); + return of_compatible_match(faa->faa_phandle, compat_data); } static void