Module Name: src Committed By: riastradh Date: Sun Dec 19 11:01:22 UTC 2021
Modified Files: src/sys/arch/arm/nvidia: tegra_drm.c tegra_nouveau.c src/sys/arch/arm/rockchip: rk_drm.c src/sys/arch/arm/sunxi: sunxi_drm.c src/sys/arch/arm/ti: ti_lcdc.c src/sys/external/bsd/drm2/pci: drm_pci.c Log Message: drm_dev_alloc now returns ERR_PTR, check for that. Author: Maya Rashish <m...@netbsd.org> Committer: Taylor R Campbell <riastr...@netbsd.org> To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/nvidia/tegra_drm.c cvs rdiff -u -r1.16 -r1.17 src/sys/arch/arm/nvidia/tegra_nouveau.c cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/rockchip/rk_drm.c cvs rdiff -u -r1.17 -r1.18 src/sys/arch/arm/sunxi/sunxi_drm.c cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/ti/ti_lcdc.c cvs rdiff -u -r1.42 -r1.43 src/sys/external/bsd/drm2/pci/drm_pci.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/arm/nvidia/tegra_drm.c diff -u src/sys/arch/arm/nvidia/tegra_drm.c:1.11 src/sys/arch/arm/nvidia/tegra_drm.c:1.12 --- src/sys/arch/arm/nvidia/tegra_drm.c:1.11 Wed Jan 27 03:10:19 2021 +++ src/sys/arch/arm/nvidia/tegra_drm.c Sun Dec 19 11:01:21 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: tegra_drm.c,v 1.11 2021/01/27 03:10:19 thorpej Exp $ */ +/* $NetBSD: tegra_drm.c,v 1.12 2021/12/19 11:01:21 riastradh Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill <jmcne...@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: tegra_drm.c,v 1.11 2021/01/27 03:10:19 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tegra_drm.c,v 1.12 2021/12/19 11:01:21 riastradh Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -199,7 +199,7 @@ tegra_drm_attach(device_t parent, device prop_dictionary_get_bool(prop, "force-dvi", &sc->sc_force_dvi); sc->sc_ddev = drm_dev_alloc(driver, sc->sc_dev); - if (sc->sc_ddev == NULL) { + if (IS_ERR(sc->sc_ddev)) { aprint_error_dev(self, "couldn't allocate DRM device\n"); return; } Index: src/sys/arch/arm/nvidia/tegra_nouveau.c diff -u src/sys/arch/arm/nvidia/tegra_nouveau.c:1.16 src/sys/arch/arm/nvidia/tegra_nouveau.c:1.17 --- src/sys/arch/arm/nvidia/tegra_nouveau.c:1.16 Wed Jan 27 03:10:19 2021 +++ src/sys/arch/arm/nvidia/tegra_nouveau.c Sun Dec 19 11:01:21 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: tegra_nouveau.c,v 1.16 2021/01/27 03:10:19 thorpej Exp $ */ +/* $NetBSD: tegra_nouveau.c,v 1.17 2021/12/19 11:01:21 riastradh Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill <jmcne...@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: tegra_nouveau.c,v 1.16 2021/01/27 03:10:19 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tegra_nouveau.c,v 1.17 2021/12/19 11:01:21 riastradh Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -221,7 +221,7 @@ tegra_nouveau_init(device_t self) } dev = drm_dev_alloc(driver, sc->sc_dev); - if (dev == NULL) { + if (IS_ERR(dev)) { aprint_error_dev(self, "couldn't allocate DRM device\n"); return; } Index: src/sys/arch/arm/rockchip/rk_drm.c diff -u src/sys/arch/arm/rockchip/rk_drm.c:1.9 src/sys/arch/arm/rockchip/rk_drm.c:1.10 --- src/sys/arch/arm/rockchip/rk_drm.c:1.9 Sun Dec 19 11:01:10 2021 +++ src/sys/arch/arm/rockchip/rk_drm.c Sun Dec 19 11:01:21 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: rk_drm.c,v 1.9 2021/12/19 11:01:10 riastradh Exp $ */ +/* $NetBSD: rk_drm.c,v 1.10 2021/12/19 11:01:21 riastradh Exp $ */ /*- * Copyright (c) 2019 Jared D. McNeill <jmcne...@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rk_drm.c,v 1.9 2021/12/19 11:01:10 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rk_drm.c,v 1.10 2021/12/19 11:01:21 riastradh Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -146,7 +146,7 @@ rk_drm_attach(device_t parent, device_t aprint_normal("\n"); sc->sc_ddev = drm_dev_alloc(driver, sc->sc_dev); - if (sc->sc_ddev == NULL) { + if (IS_ERR(sc->sc_ddev)) { aprint_error_dev(self, "couldn't allocate DRM device\n"); return; } Index: src/sys/arch/arm/sunxi/sunxi_drm.c diff -u src/sys/arch/arm/sunxi/sunxi_drm.c:1.17 src/sys/arch/arm/sunxi/sunxi_drm.c:1.18 --- src/sys/arch/arm/sunxi/sunxi_drm.c:1.17 Sun Dec 19 11:01:10 2021 +++ src/sys/arch/arm/sunxi/sunxi_drm.c Sun Dec 19 11:01:21 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_drm.c,v 1.17 2021/12/19 11:01:10 riastradh Exp $ */ +/* $NetBSD: sunxi_drm.c,v 1.18 2021/12/19 11:01:21 riastradh Exp $ */ /*- * Copyright (c) 2019 Jared D. McNeill <jmcne...@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sunxi_drm.c,v 1.17 2021/12/19 11:01:10 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_drm.c,v 1.18 2021/12/19 11:01:21 riastradh Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -155,7 +155,7 @@ sunxi_drm_attach(device_t parent, device aprint_normal(": Display Engine Pipeline\n"); sc->sc_ddev = drm_dev_alloc(driver, sc->sc_dev); - if (sc->sc_ddev == NULL) { + if (IS_ERR(sc->sc_ddev)) { aprint_error_dev(self, "couldn't allocate DRM device\n"); return; } Index: src/sys/arch/arm/ti/ti_lcdc.c diff -u src/sys/arch/arm/ti/ti_lcdc.c:1.7 src/sys/arch/arm/ti/ti_lcdc.c:1.8 --- src/sys/arch/arm/ti/ti_lcdc.c:1.7 Sat Aug 7 16:18:46 2021 +++ src/sys/arch/arm/ti/ti_lcdc.c Sun Dec 19 11:01:21 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: ti_lcdc.c,v 1.7 2021/08/07 16:18:46 thorpej Exp $ */ +/* $NetBSD: ti_lcdc.c,v 1.8 2021/12/19 11:01:21 riastradh Exp $ */ /*- * Copyright (c) 2019 Jared D. McNeill <jmcne...@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ti_lcdc.c,v 1.7 2021/08/07 16:18:46 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ti_lcdc.c,v 1.8 2021/12/19 11:01:21 riastradh Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -420,7 +420,7 @@ tilcdc_attach(device_t parent, device_t fdt_ports_register(&sc->sc_ports, self, phandle, EP_DRM_ENCODER); sc->sc_ddev = drm_dev_alloc(driver, sc->sc_dev); - if (sc->sc_ddev == NULL) { + if (IS_ERR(sc->sc_ddev)) { aprint_error_dev(self, "couldn't allocate DRM device\n"); return; } Index: src/sys/external/bsd/drm2/pci/drm_pci.c diff -u src/sys/external/bsd/drm2/pci/drm_pci.c:1.42 src/sys/external/bsd/drm2/pci/drm_pci.c:1.43 --- src/sys/external/bsd/drm2/pci/drm_pci.c:1.42 Sun Dec 19 10:37:09 2021 +++ src/sys/external/bsd/drm2/pci/drm_pci.c Sun Dec 19 11:01:22 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: drm_pci.c,v 1.42 2021/12/19 10:37:09 riastradh Exp $ */ +/* $NetBSD: drm_pci.c,v 1.43 2021/12/19 11:01:22 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: drm_pci.c,v 1.42 2021/12/19 10:37:09 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: drm_pci.c,v 1.43 2021/12/19 11:01:22 riastradh Exp $"); #include <sys/types.h> #include <sys/errno.h> @@ -38,6 +38,7 @@ __KERNEL_RCSID(0, "$NetBSD: drm_pci.c,v #include <dev/pci/pcivar.h> +#include <linux/err.h> #include <drm/drm_agpsupport.h> #include <drm/drm_device.h> #include <drm/drm_drv.h> @@ -74,7 +75,7 @@ drm_pci_attach(device_t self, const stru /* Create a DRM device. */ dev = drm_dev_alloc(driver, self); - if (dev == NULL) { + if (IS_ERR(dev)) { ret = -ENOMEM; goto fail0; }