@@ -282,7 +282,7 @@ struct drm_plane *exynos_plane_init(struct drm_device *dev,
exynos_plane = kzalloc(sizeof(struct exynos_plane), GFP_KERNEL);
if (!exynos_plane) {
DRM_ERROR("failed to allocate plane\n");
- return NULL;
+ return ERR_PTR(-ENOMEM);
}
err = drm_plane_init(dev, &exynos_plane->base, possible_crtcs,
@@ -291,7 +291,7 @@ struct drm_plane *exynos_plane_init(struct drm_device *dev,
if (err) {
DRM_ERROR("failed to initialize plane\n");
kfree(exynos_plane);
- return NULL;
+ return ERR_PTR(err);
}
if (priv)
@@ -345,9 +345,9 @@ int exynos_drm_crtc_create(struct drm_device *dev, unsigned int nr)
exynos_crtc->pipe = nr;
exynos_crtc->dpms = DRM_MODE_DPMS_OFF;
exynos_crtc->plane = exynos_plane_init(dev, 1 << nr, true);
- if (!exynos_crtc->plane) {
+ if (IS_ERR(exynos_crtc->plane)) {
kfree(exynos_crtc);
- return -ENOMEM;
+ return PTR_ERR(exynos_crtc->plane);
}
crtc = &exynos_crtc->drm_crtc;
@@ -91,8 +91,10 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags)
unsigned int possible_crtcs = (1 << MAX_CRTC) - 1;
plane = exynos_plane_init(dev, possible_crtcs, false);
- if (!plane)
+ if (IS_ERR(plane) {
+ ret = PTR_ERR(plane);
goto err_release_iommu_mapping;
+ }
}
ret = drm_vblank_init(dev, MAX_CRTC);