[FreeBSD] Use M_WAITOK when allocating driver memory.

We don't explicitly check for error here and M_WAITOK will just put the
process to sleep waiting on resources to become available.

Suggested by John Baldwin
main
Robert Noland 2008-10-03 14:05:45 -04:00
parent 4c92abfa8d
commit 9c0ce38df3
9 changed files with 27 additions and 9 deletions

View File

@ -111,7 +111,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);

View File

@ -85,7 +85,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);

View File

@ -129,7 +129,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);

View File

@ -84,7 +84,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);

View File

@ -89,7 +89,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);

View File

@ -75,7 +75,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);

View File

@ -69,7 +69,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);

View File

@ -71,7 +71,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);

View File

@ -82,7 +82,9 @@ via_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);
via_configure(dev);
return drm_attach(nbdev, via_pciidlist);