Commit 5a2c920c authored by Julia Lawall's avatar Julia Lawall Committed by Mark Yao

drm/rockchip: return ERR_PTR instead of NULL

rockchip_drm_framebuffer_init is only used in one case, in
rockchip_drm_fbdev.c, where its return value is tested using IS_ERR.  To
enable propagating the reason for the error, change the definition so that
it returns an ERR_PTR value.

Problem found with the help of Coccinelle.
Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
parent 17a794d7
...@@ -213,7 +213,7 @@ rockchip_drm_framebuffer_init(struct drm_device *dev, ...@@ -213,7 +213,7 @@ rockchip_drm_framebuffer_init(struct drm_device *dev,
rockchip_fb = rockchip_fb_alloc(dev, mode_cmd, &obj, 1); rockchip_fb = rockchip_fb_alloc(dev, mode_cmd, &obj, 1);
if (IS_ERR(rockchip_fb)) if (IS_ERR(rockchip_fb))
return NULL; return ERR_CAST(rockchip_fb);
return &rockchip_fb->fb; return &rockchip_fb->fb;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment