drm: Use PTR_ERR_OR_ZERO in drm_fb_cma_fbdev_init()
authorYueHaibing <yuehaibing@huawei.com>
Wed, 10 Oct 2018 13:02:43 +0000 (13:02 +0000)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 11 Oct 2018 08:46:40 +0000 (10:46 +0200)
Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/1539176563-144779-1-git-send-email-yuehaibing@huawei.com
drivers/gpu/drm/drm_fb_cma_helper.c

index 47e0e2f6642d2520b7ca18fc25a4d3b731366a18..d52344a03aa8752035025d7e8b5ee56cf3021ac9 100644 (file)
@@ -124,10 +124,7 @@ int drm_fb_cma_fbdev_init(struct drm_device *dev, unsigned int preferred_bpp,
 
        /* dev->fb_helper will indirectly point to fbdev_cma after this call */
        fbdev_cma = drm_fbdev_cma_init(dev, preferred_bpp, max_conn_count);
-       if (IS_ERR(fbdev_cma))
-               return PTR_ERR(fbdev_cma);
-
-       return 0;
+       return PTR_ERR_OR_ZERO(fbdev_cma);
 }
 EXPORT_SYMBOL_GPL(drm_fb_cma_fbdev_init);