diff options
author | Thomas Zimmermann <tzimmermann@suse.de> | 2021-10-15 11:40:45 +0300 |
---|---|---|
committer | Thomas Zimmermann <tzimmermann@suse.de> | 2021-10-19 11:31:32 +0300 |
commit | 9f40dbd4416f14657d9b354b7ec855244d97a91c (patch) | |
tree | 771c28ac61eeef5346c6faed692bfbcb4e198526 /drivers/gpu/drm/gma500 | |
parent | 1f9f6790cc62eeaa973d05a9a2f16ca0f3b80b36 (diff) | |
download | linux-9f40dbd4416f14657d9b354b7ec855244d97a91c.tar.xz |
drm/gma500: Use to_gtt_range() everywhere
Convert upcasts from struct drm_gem_object to struct gtt_range to
to_gtt_range(). Some places used container_of() directly.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211015084053.13708-3-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu/drm/gma500')
-rw-r--r-- | drivers/gpu/drm/gma500/gem.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/gma500/gma_display.c | 7 |
2 files changed, 5 insertions, 6 deletions
diff --git a/drivers/gpu/drm/gma500/gem.c b/drivers/gpu/drm/gma500/gem.c index a41990dbcc0e..b52908313ee5 100644 --- a/drivers/gpu/drm/gma500/gem.c +++ b/drivers/gpu/drm/gma500/gem.c @@ -117,7 +117,7 @@ static vm_fault_t psb_gem_fault(struct vm_fault *vmf); static void psb_gem_free_object(struct drm_gem_object *obj) { - struct gtt_range *gtt = container_of(obj, struct gtt_range, gem); + struct gtt_range *gtt = to_gtt_range(obj); /* Remove the list map if one is present */ drm_gem_free_mmap_offset(obj); @@ -267,7 +267,7 @@ static vm_fault_t psb_gem_fault(struct vm_fault *vmf) dev = obj->dev; dev_priv = to_drm_psb_private(dev); - r = container_of(obj, struct gtt_range, gem); /* Get the gtt range */ + r = to_gtt_range(obj); /* Make sure we don't parallel update on a fault, nor move or remove something from beneath our feet */ diff --git a/drivers/gpu/drm/gma500/gma_display.c b/drivers/gpu/drm/gma500/gma_display.c index ecf8153416ac..8285358fac01 100644 --- a/drivers/gpu/drm/gma500/gma_display.c +++ b/drivers/gpu/drm/gma500/gma_display.c @@ -349,8 +349,7 @@ int gma_crtc_cursor_set(struct drm_crtc *crtc, /* Unpin the old GEM object */ if (gma_crtc->cursor_obj) { - gt = container_of(gma_crtc->cursor_obj, - struct gtt_range, gem); + gt = to_gtt_range(gma_crtc->cursor_obj); psb_gtt_unpin(gt); drm_gem_object_put(gma_crtc->cursor_obj); gma_crtc->cursor_obj = NULL; @@ -376,7 +375,7 @@ int gma_crtc_cursor_set(struct drm_crtc *crtc, goto unref_cursor; } - gt = container_of(obj, struct gtt_range, gem); + gt = to_gtt_range(obj); /* Pin the memory into the GTT */ ret = psb_gtt_pin(gt); @@ -426,7 +425,7 @@ int gma_crtc_cursor_set(struct drm_crtc *crtc, /* unpin the old bo */ if (gma_crtc->cursor_obj) { - gt = container_of(gma_crtc->cursor_obj, struct gtt_range, gem); + gt = to_gtt_range(gma_crtc->cursor_obj); psb_gtt_unpin(gt); drm_gem_object_put(gma_crtc->cursor_obj); } |