diff options
author | CQ Tang <cq.tang@intel.com> | 2019-10-04 18:04:32 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2019-10-04 19:27:41 +0100 |
commit | 0e5493cab5ef90fb91f89a2dc84259c7a7d7fd50 (patch) | |
tree | 45a5f3cf79aafaf4762553d7d1ff2c10919c4cdd /drivers/gpu/drm/i915/gt/intel_rc6.c | |
parent | 7d423af9bfb172c3802cc1ca6591ac608c26a311 (diff) |
drm/i915/stolen: make the object creation interface consistent
Our other backends return an actual error value upon failure. Do the
same for stolen objects, which currently just return NULL on failure.
Signed-off-by: CQ Tang <cq.tang@intel.com>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20191004170452.15410-2-matthew.auld@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/gt/intel_rc6.c')
-rw-r--r-- | drivers/gpu/drm/i915/gt/intel_rc6.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/gt/intel_rc6.c b/drivers/gpu/drm/i915/gt/intel_rc6.c index d6167dd592e9..71184aa72896 100644 --- a/drivers/gpu/drm/i915/gt/intel_rc6.c +++ b/drivers/gpu/drm/i915/gt/intel_rc6.c @@ -299,8 +299,8 @@ static int vlv_rc6_init(struct intel_rc6 *rc6) pcbr_offset, I915_GTT_OFFSET_NONE, pctx_size); - if (!pctx) - return -ENOMEM; + if (IS_ERR(pctx)) + return PTR_ERR(pctx); goto out; } @@ -316,9 +316,9 @@ static int vlv_rc6_init(struct intel_rc6 *rc6) * memory, or any other relevant ranges. */ pctx = i915_gem_object_create_stolen(i915, pctx_size); - if (!pctx) { + if (IS_ERR(pctx)) { DRM_DEBUG("not enough stolen space for PCTX, disabling\n"); - return -ENOMEM; + return PTR_ERR(pctx); } GEM_BUG_ON(range_overflows_t(u64, |