diff options
author | rnoland <rnoland@FreeBSD.org> | 2008-10-04 14:48:40 +0000 |
---|---|---|
committer | rnoland <rnoland@FreeBSD.org> | 2008-10-04 14:48:40 +0000 |
commit | e416dd643a947a6b0b74b8cd709467a599dc72c8 (patch) | |
tree | 106a6245b0aea5865f11410c76f386b1c0bc8f38 | |
parent | 6d0a9a164f2ca73f1303af9b5f7dcb07b5765c3f (diff) | |
download | FreeBSD-src-e416dd643a947a6b0b74b8cd709467a599dc72c8.zip FreeBSD-src-e416dd643a947a6b0b74b8cd709467a599dc72c8.tar.gz |
Use M_WAITOK when allocating driver memory
We don't explicity check for error here and M_WAITOK will just put the
process to sleep waiting on resources to become available.
Suggested by jhb@
Approved by: jhb (mentor)
-rw-r--r-- | sys/dev/drm/i915_drv.c | 4 | ||||
-rw-r--r-- | sys/dev/drm/mach64_drv.c | 4 | ||||
-rw-r--r-- | sys/dev/drm/mga_drv.c | 4 | ||||
-rw-r--r-- | sys/dev/drm/r128_drv.c | 4 | ||||
-rw-r--r-- | sys/dev/drm/radeon_drv.c | 4 | ||||
-rw-r--r-- | sys/dev/drm/savage_drv.c | 4 | ||||
-rw-r--r-- | sys/dev/drm/sis_drv.c | 4 | ||||
-rw-r--r-- | sys/dev/drm/tdfx_drv.c | 4 |
8 files changed, 24 insertions, 8 deletions
diff --git a/sys/dev/drm/i915_drv.c b/sys/dev/drm/i915_drv.c index 945ef72..d2795a3 100644 --- a/sys/dev/drm/i915_drv.c +++ b/sys/dev/drm/i915_drv.c @@ -114,7 +114,9 @@ i915_attach(device_t nbdev) bzero(dev, sizeof(struct drm_device)); - dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_NOWAIT | M_ZERO); + dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, + M_WAITOK | M_ZERO); + i915_configure(dev); return drm_attach(nbdev, i915_pciidlist); diff --git a/sys/dev/drm/mach64_drv.c b/sys/dev/drm/mach64_drv.c index 24e8e63..b312f48 100644 --- a/sys/dev/drm/mach64_drv.c +++ b/sys/dev/drm/mach64_drv.c @@ -88,7 +88,9 @@ mach64_attach(device_t nbdev) bzero(dev, sizeof(struct drm_device)); - dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_NOWAIT | M_ZERO); + dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, + M_WAITOK | M_ZERO); + mach64_configure(dev); return drm_attach(nbdev, mach64_pciidlist); diff --git a/sys/dev/drm/mga_drv.c b/sys/dev/drm/mga_drv.c index 049d54b..f3d9cae 100644 --- a/sys/dev/drm/mga_drv.c +++ b/sys/dev/drm/mga_drv.c @@ -132,7 +132,9 @@ mga_attach(device_t nbdev) bzero(dev, sizeof(struct drm_device)); - dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_NOWAIT | M_ZERO); + dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, + M_WAITOK | M_ZERO); + mga_configure(dev); return drm_attach(nbdev, mga_pciidlist); diff --git a/sys/dev/drm/r128_drv.c b/sys/dev/drm/r128_drv.c index 93cdefe..ad4da43 100644 --- a/sys/dev/drm/r128_drv.c +++ b/sys/dev/drm/r128_drv.c @@ -87,7 +87,9 @@ r128_attach(device_t nbdev) bzero(dev, sizeof(struct drm_device)); - dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_NOWAIT | M_ZERO); + dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, + M_WAITOK | M_ZERO); + r128_configure(dev); return drm_attach(nbdev, r128_pciidlist); diff --git a/sys/dev/drm/radeon_drv.c b/sys/dev/drm/radeon_drv.c index 5a44093..caddf1e 100644 --- a/sys/dev/drm/radeon_drv.c +++ b/sys/dev/drm/radeon_drv.c @@ -92,7 +92,9 @@ radeon_attach(device_t nbdev) bzero(dev, sizeof(struct drm_device)); - dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_NOWAIT | M_ZERO); + dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, + M_WAITOK | M_ZERO); + radeon_configure(dev); return drm_attach(nbdev, radeon_pciidlist); diff --git a/sys/dev/drm/savage_drv.c b/sys/dev/drm/savage_drv.c index 3ce895b..aa0103f 100644 --- a/sys/dev/drm/savage_drv.c +++ b/sys/dev/drm/savage_drv.c @@ -78,7 +78,9 @@ savage_attach(device_t nbdev) bzero(dev, sizeof(struct drm_device)); - dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_NOWAIT | M_ZERO); + dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, + M_WAITOK | M_ZERO); + savage_configure(dev); return drm_attach(nbdev, savage_pciidlist); diff --git a/sys/dev/drm/sis_drv.c b/sys/dev/drm/sis_drv.c index 6c6d02d..c17557e 100644 --- a/sys/dev/drm/sis_drv.c +++ b/sys/dev/drm/sis_drv.c @@ -72,7 +72,9 @@ sis_attach(device_t nbdev) bzero(dev, sizeof(struct drm_device)); - dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_NOWAIT | M_ZERO); + dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, + M_WAITOK | M_ZERO); + sis_configure(dev); return drm_attach(nbdev, sis_pciidlist); diff --git a/sys/dev/drm/tdfx_drv.c b/sys/dev/drm/tdfx_drv.c index 511f9ea..14bde23 100644 --- a/sys/dev/drm/tdfx_drv.c +++ b/sys/dev/drm/tdfx_drv.c @@ -74,7 +74,9 @@ tdfx_attach(device_t nbdev) bzero(dev, sizeof(struct drm_device)); - dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_NOWAIT | M_ZERO); + dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, + M_WAITOK | M_ZERO); + tdfx_configure(dev); return drm_attach(nbdev, tdfx_pciidlist); |