Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm: Convert drm_legacy_ctxbitmap_init to void return type

It can't fail really.

Also remove the redundant kms check Peter added.

Cc: Peter Antoine <peter.antoine@intel.com>
Reviewed-by: Peter Antoine <peter.antoine@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

+4 -13
+2 -3
drivers/gpu/drm/drm_context.c
··· 89 89 * 90 90 * Initialise the drm_device::ctx_idr 91 91 */ 92 - int drm_legacy_ctxbitmap_init(struct drm_device * dev) 92 + void drm_legacy_ctxbitmap_init(struct drm_device * dev) 93 93 { 94 94 if (!drm_core_check_feature(dev, DRIVER_KMS_LEGACY_CONTEXT) && 95 95 drm_core_check_feature(dev, DRIVER_MODESET)) 96 - return -EINVAL; 96 + return; 97 97 98 98 idr_init(&dev->ctx_idr); 99 - return 0; 100 99 } 101 100 102 101 /**
+1 -9
drivers/gpu/drm/drm_drv.c
··· 582 582 if (drm_ht_create(&dev->map_hash, 12)) 583 583 goto err_minors; 584 584 585 - if (drm_core_check_feature(dev, DRIVER_KMS_LEGACY_CONTEXT) || 586 - !drm_core_check_feature(dev, DRIVER_MODESET)) 587 - ret = drm_legacy_ctxbitmap_init(dev); 588 - if (ret) { 589 - DRM_ERROR( 590 - "Cannot allocate memory for context bitmap.\n"); 591 - goto err_ht; 592 - } 585 + drm_legacy_ctxbitmap_init(dev); 593 586 594 587 if (drm_core_check_feature(dev, DRIVER_GEM)) { 595 588 ret = drm_gem_init(dev); ··· 596 603 597 604 err_ctxbitmap: 598 605 drm_legacy_ctxbitmap_cleanup(dev); 599 - err_ht: 600 606 drm_ht_remove(&dev->map_hash); 601 607 err_minors: 602 608 drm_minor_free(dev, DRM_MINOR_LEGACY);
+1 -1
drivers/gpu/drm/drm_legacy.h
··· 42 42 #define DRM_KERNEL_CONTEXT 0 43 43 #define DRM_RESERVED_CONTEXTS 1 44 44 45 - int drm_legacy_ctxbitmap_init(struct drm_device *dev); 45 + void drm_legacy_ctxbitmap_init(struct drm_device *dev); 46 46 void drm_legacy_ctxbitmap_cleanup(struct drm_device *dev); 47 47 void drm_legacy_ctxbitmap_free(struct drm_device *dev, int ctx_handle); 48 48 void drm_legacy_ctxbitmap_flush(struct drm_device *dev, struct drm_file *file);