drm/exynos: Remove redundant error messages
authorSachin Kamat <sachin.kamat@linaro.org>
Mon, 19 Aug 2013 10:04:55 +0000 (19:04 +0900)
committerInki Dae <inki.dae@samsung.com>
Thu, 5 Sep 2013 04:43:43 +0000 (13:43 +0900)
kzalloc already has built-in error messages. Hence remove
additional ones.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
19 files changed:
drivers/gpu/drm/exynos/exynos_drm_buf.c
drivers/gpu/drm/exynos/exynos_drm_connector.c
drivers/gpu/drm/exynos/exynos_drm_crtc.c
drivers/gpu/drm/exynos/exynos_drm_dmabuf.c
drivers/gpu/drm/exynos/exynos_drm_drv.c
drivers/gpu/drm/exynos/exynos_drm_encoder.c
drivers/gpu/drm/exynos/exynos_drm_fb.c
drivers/gpu/drm/exynos/exynos_drm_fbdev.c
drivers/gpu/drm/exynos/exynos_drm_fimc.c
drivers/gpu/drm/exynos/exynos_drm_fimd.c
drivers/gpu/drm/exynos/exynos_drm_g2d.c
drivers/gpu/drm/exynos/exynos_drm_gem.c
drivers/gpu/drm/exynos/exynos_drm_gsc.c
drivers/gpu/drm/exynos/exynos_drm_hdmi.c
drivers/gpu/drm/exynos/exynos_drm_ipp.c
drivers/gpu/drm/exynos/exynos_drm_plane.c
drivers/gpu/drm/exynos/exynos_drm_rotator.c
drivers/gpu/drm/exynos/exynos_hdmi.c
drivers/gpu/drm/exynos/exynos_mixer.c

index 7f489e7330fe39f3c3ff9367a07fdc77929df69f..3445a0f3a6b29dc6110d0e3a950a23de92a4098c 100644 (file)
@@ -149,10 +149,8 @@ struct exynos_drm_gem_buf *exynos_drm_init_buf(struct drm_device *dev,
        DRM_DEBUG_KMS("desired size = 0x%x\n", size);
 
        buffer = kzalloc(sizeof(*buffer), GFP_KERNEL);
-       if (!buffer) {
-               DRM_ERROR("failed to allocate exynos_drm_gem_buf.\n");
+       if (!buffer)
                return NULL;
-       }
 
        buffer->size = size;
        return buffer;
index 3f80673c12ecc2eb4dc40d4c6d417c5123ecf29f..de7c7b294d2c919bc806f5ddc826aed11c49e9ef 100644 (file)
@@ -279,10 +279,8 @@ struct drm_connector *exynos_drm_connector_create(struct drm_device *dev,
        int err;
 
        exynos_connector = kzalloc(sizeof(*exynos_connector), GFP_KERNEL);
-       if (!exynos_connector) {
-               DRM_ERROR("failed to allocate connector\n");
+       if (!exynos_connector)
                return NULL;
-       }
 
        connector = &exynos_connector->drm_connector;
 
index e6992d8d20469a62bd35675e632358f1088a5a81..ebc01503d50ec1f2a9034bb81fa4724f12555f16 100644 (file)
@@ -325,10 +325,8 @@ int exynos_drm_crtc_create(struct drm_device *dev, unsigned int nr)
        struct drm_crtc *crtc;
 
        exynos_crtc = kzalloc(sizeof(*exynos_crtc), GFP_KERNEL);
-       if (!exynos_crtc) {
-               DRM_ERROR("failed to allocate exynos crtc\n");
+       if (!exynos_crtc)
                return -ENOMEM;
-       }
 
        exynos_crtc->pipe = nr;
        exynos_crtc->dpms = DRM_MODE_DPMS_OFF;
index e80e0a807a4b195ee705c3721871451f7f8de790..59827cc5e77090d7f1aa03e470a5c4cf40d4bb63 100644 (file)
@@ -231,7 +231,6 @@ struct drm_gem_object *exynos_dmabuf_prime_import(struct drm_device *drm_dev,
 
        buffer = kzalloc(sizeof(*buffer), GFP_KERNEL);
        if (!buffer) {
-               DRM_ERROR("failed to allocate exynos_drm_gem_buf.\n");
                ret = -ENOMEM;
                goto err_unmap_attach;
        }
index df81d3c959b416862ccda0b7bfadcb81d1b61d3e..bb82ef78ca851101458a76178656a6f5646137b1 100644 (file)
@@ -47,10 +47,8 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags)
        int nr;
 
        private = kzalloc(sizeof(struct exynos_drm_private), GFP_KERNEL);
-       if (!private) {
-               DRM_ERROR("failed to allocate private\n");
+       if (!private)
                return -ENOMEM;
-       }
 
        INIT_LIST_HEAD(&private->pageflip_event_list);
        dev->dev_private = (void *)private;
index a99a033793bc321a26f33d3d37c6b8504ce289c7..06f1b2a09da7a1d2c1f4f556db86f299d872a081 100644 (file)
@@ -324,10 +324,8 @@ exynos_drm_encoder_create(struct drm_device *dev,
                return NULL;
 
        exynos_encoder = kzalloc(sizeof(*exynos_encoder), GFP_KERNEL);
-       if (!exynos_encoder) {
-               DRM_ERROR("failed to allocate encoder\n");
+       if (!exynos_encoder)
                return NULL;
-       }
 
        exynos_encoder->dpms = DRM_MODE_DPMS_OFF;
        exynos_encoder->manager = manager;
index c2d149f0408a4f75949aad76de0836c3c9707b0a..ea39e0ef2ae4c61d530bd2f7b729a26a6ad1e752 100644 (file)
@@ -156,10 +156,8 @@ exynos_drm_framebuffer_init(struct drm_device *dev,
        }
 
        exynos_fb = kzalloc(sizeof(*exynos_fb), GFP_KERNEL);
-       if (!exynos_fb) {
-               DRM_ERROR("failed to allocate exynos drm framebuffer\n");
+       if (!exynos_fb)
                return ERR_PTR(-ENOMEM);
-       }
 
        drm_helper_mode_fill_fb_struct(&exynos_fb->fb, mode_cmd);
        exynos_fb->exynos_gem_obj[0] = exynos_gem_obj;
@@ -220,10 +218,8 @@ exynos_user_fb_create(struct drm_device *dev, struct drm_file *file_priv,
        int i, ret;
 
        exynos_fb = kzalloc(sizeof(*exynos_fb), GFP_KERNEL);
-       if (!exynos_fb) {
-               DRM_ERROR("failed to allocate exynos drm framebuffer\n");
+       if (!exynos_fb)
                return ERR_PTR(-ENOMEM);
-       }
 
        obj = drm_gem_object_lookup(dev, file_priv, mode_cmd->handles[0]);
        if (!obj) {
index eac6933125bc34cf7cbd05a86ae30be0427a45ee..78e868bcf1ecc364638e4ce3343cc66f260599f0 100644 (file)
@@ -248,10 +248,8 @@ int exynos_drm_fbdev_init(struct drm_device *dev)
                return 0;
 
        fbdev = kzalloc(sizeof(*fbdev), GFP_KERNEL);
-       if (!fbdev) {
-               DRM_ERROR("failed to allocate drm fbdev.\n");
+       if (!fbdev)
                return -ENOMEM;
-       }
 
        private->fb_helper = helper = &fbdev->drm_fb_helper;
        helper->funcs = &exynos_drm_fb_helper_funcs;
index b047597d1f6b4aa7d10a2fb25a3e9979d7c20cad..8adfc8f1e08f162c587288e6d1a57f6fbde9887a 100644 (file)
@@ -1345,10 +1345,8 @@ static int fimc_init_prop_list(struct exynos_drm_ippdrv *ippdrv)
        struct drm_exynos_ipp_prop_list *prop_list;
 
        prop_list = devm_kzalloc(ippdrv->dev, sizeof(*prop_list), GFP_KERNEL);
-       if (!prop_list) {
-               DRM_ERROR("failed to alloc property list.\n");
+       if (!prop_list)
                return -ENOMEM;
-       }
 
        prop_list->version = 1;
        prop_list->writeback = 1;
index 19328d03e46d66428b704c0553f61b1e74e3a471..b8aa8fee82013c5a8723a7baf0154af92c0eecb5 100644 (file)
@@ -890,10 +890,8 @@ static int fimd_probe(struct platform_device *pdev)
 
        if (dev->of_node) {
                pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
-               if (!pdata) {
-                       DRM_ERROR("memory allocation for pdata failed\n");
+               if (!pdata)
                        return -ENOMEM;
-               }
 
                ret = of_get_fb_videomode(dev->of_node, &pdata->panel.timing,
                                        OF_USE_NATIVE_MODE);
index 5cec194b6cc52fbaf8a4cd840434d83ce74db654..0b8b6e43bbd24a4f9280db8f777be1fa32c8edc0 100644 (file)
@@ -447,10 +447,8 @@ static dma_addr_t *g2d_userptr_get_dma_addr(struct drm_device *drm_dev,
        }
 
        g2d_userptr = kzalloc(sizeof(*g2d_userptr), GFP_KERNEL);
-       if (!g2d_userptr) {
-               DRM_ERROR("failed to allocate g2d_userptr.\n");
+       if (!g2d_userptr)
                return ERR_PTR(-ENOMEM);
-       }
 
        atomic_set(&g2d_userptr->refcount, 1);
 
@@ -500,7 +498,6 @@ static dma_addr_t *g2d_userptr_get_dma_addr(struct drm_device *drm_dev,
 
        sgt = kzalloc(sizeof(*sgt), GFP_KERNEL);
        if (!sgt) {
-               DRM_ERROR("failed to allocate sg table.\n");
                ret = -ENOMEM;
                goto err_free_userptr;
        }
@@ -1087,8 +1084,6 @@ int exynos_g2d_set_cmdlist_ioctl(struct drm_device *drm_dev, void *data,
 
                e = kzalloc(sizeof(*node->event), GFP_KERNEL);
                if (!e) {
-                       dev_err(dev, "failed to allocate event\n");
-
                        spin_lock_irqsave(&drm_dev->event_lock, flags);
                        file->event_space += sizeof(e->event);
                        spin_unlock_irqrestore(&drm_dev->event_lock, flags);
@@ -1318,10 +1313,8 @@ static int g2d_open(struct drm_device *drm_dev, struct device *dev,
        struct exynos_drm_g2d_private *g2d_priv;
 
        g2d_priv = kzalloc(sizeof(*g2d_priv), GFP_KERNEL);
-       if (!g2d_priv) {
-               dev_err(dev, "failed to allocate g2d private data\n");
+       if (!g2d_priv)
                return -ENOMEM;
-       }
 
        g2d_priv->dev = dev;
        file_priv->g2d_priv = g2d_priv;
@@ -1377,10 +1370,8 @@ static int g2d_probe(struct platform_device *pdev)
        int ret;
 
        g2d = devm_kzalloc(dev, sizeof(*g2d), GFP_KERNEL);
-       if (!g2d) {
-               dev_err(dev, "failed to allocate driver data\n");
+       if (!g2d)
                return -ENOMEM;
-       }
 
        g2d->runqueue_slab = kmem_cache_create("g2d_runqueue_slab",
                        sizeof(struct g2d_runqueue_node), 0, 0, NULL);
index f3c6f40666e1f58f214e94c94d03c1ed8ac523a7..862f1d9a2ecb6d155f3678eb4d59b540d9f749f2 100644 (file)
@@ -191,10 +191,8 @@ struct exynos_drm_gem_obj *exynos_drm_gem_init(struct drm_device *dev,
        int ret;
 
        exynos_gem_obj = kzalloc(sizeof(*exynos_gem_obj), GFP_KERNEL);
-       if (!exynos_gem_obj) {
-               DRM_ERROR("failed to allocate exynos gem object\n");
+       if (!exynos_gem_obj)
                return NULL;
-       }
 
        exynos_gem_obj->size = size;
        obj = &exynos_gem_obj->base;
index e69d1d294629b39911f34df56852fb95e75c59c2..cd6aebd53bd0ce10b0ff75b6311f1c2ae5120bcc 100644 (file)
@@ -1338,10 +1338,8 @@ static int gsc_init_prop_list(struct exynos_drm_ippdrv *ippdrv)
        struct drm_exynos_ipp_prop_list *prop_list;
 
        prop_list = devm_kzalloc(ippdrv->dev, sizeof(*prop_list), GFP_KERNEL);
-       if (!prop_list) {
-               DRM_ERROR("failed to alloc property list.\n");
+       if (!prop_list)
                return -ENOMEM;
-       }
 
        prop_list->version = 1;
        prop_list->writeback = 1;
index 8d3bc01d6834f7b8fca2c2320e67b151a4df3d0c..8548b974bd59715389ce41b411c121a17877cb46 100644 (file)
@@ -403,10 +403,8 @@ static int exynos_drm_hdmi_probe(struct platform_device *pdev)
        struct drm_hdmi_context *ctx;
 
        ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
-       if (!ctx) {
-               DRM_LOG_KMS("failed to alloc common hdmi context.\n");
+       if (!ctx)
                return -ENOMEM;
-       }
 
        subdrv = &ctx->subdrv;
 
index d2b6ab4def93ab7421d30fea9c9f86880a0b0e10..824e0705c8d333734f1713f996e9c48d225b307f 100644 (file)
@@ -408,10 +408,8 @@ static struct drm_exynos_ipp_cmd_work *ipp_create_cmd_work(void)
        struct drm_exynos_ipp_cmd_work *cmd_work;
 
        cmd_work = kzalloc(sizeof(*cmd_work), GFP_KERNEL);
-       if (!cmd_work) {
-               DRM_ERROR("failed to alloc cmd_work.\n");
+       if (!cmd_work)
                return ERR_PTR(-ENOMEM);
-       }
 
        INIT_WORK((struct work_struct *)cmd_work, ipp_sched_cmd);
 
@@ -423,10 +421,8 @@ static struct drm_exynos_ipp_event_work *ipp_create_event_work(void)
        struct drm_exynos_ipp_event_work *event_work;
 
        event_work = kzalloc(sizeof(*event_work), GFP_KERNEL);
-       if (!event_work) {
-               DRM_ERROR("failed to alloc event_work.\n");
+       if (!event_work)
                return ERR_PTR(-ENOMEM);
-       }
 
        INIT_WORK((struct work_struct *)event_work, ipp_sched_event);
 
@@ -482,10 +478,8 @@ int exynos_drm_ipp_set_property(struct drm_device *drm_dev, void *data,
 
        /* allocate command node */
        c_node = kzalloc(sizeof(*c_node), GFP_KERNEL);
-       if (!c_node) {
-               DRM_ERROR("failed to allocate map node.\n");
+       if (!c_node)
                return -ENOMEM;
-       }
 
        /* create property id */
        ret = ipp_create_id(&ctx->prop_idr, &ctx->prop_lock, c_node,
@@ -694,10 +688,8 @@ static struct drm_exynos_ipp_mem_node
        mutex_lock(&c_node->mem_lock);
 
        m_node = kzalloc(sizeof(*m_node), GFP_KERNEL);
-       if (!m_node) {
-               DRM_ERROR("failed to allocate queue node.\n");
+       if (!m_node)
                goto err_unlock;
-       }
 
        /* clear base address for error handling */
        memset(&buf_info, 0x0, sizeof(buf_info));
@@ -798,9 +790,7 @@ static int ipp_get_event(struct drm_device *drm_dev,
        DRM_DEBUG_KMS("ops_id[%d]buf_id[%d]\n", qbuf->ops_id, qbuf->buf_id);
 
        e = kzalloc(sizeof(*e), GFP_KERNEL);
-
        if (!e) {
-               DRM_ERROR("failed to allocate event.\n");
                spin_lock_irqsave(&drm_dev->event_lock, flags);
                file->event_space += sizeof(e->event);
                spin_unlock_irqrestore(&drm_dev->event_lock, flags);
@@ -1780,10 +1770,8 @@ static int ipp_subdrv_open(struct drm_device *drm_dev, struct device *dev,
        struct exynos_drm_ipp_private *priv;
 
        priv = kzalloc(sizeof(*priv), GFP_KERNEL);
-       if (!priv) {
-               DRM_ERROR("failed to allocate priv.\n");
+       if (!priv)
                return -ENOMEM;
-       }
        priv->dev = dev;
        file_priv->ipp_priv = priv;
 
index 98eb1f709b13128f0a2bd586ad3a69a1ff20abd0..fcb0652e77d04975f005e885faf33c70e2b291ba 100644 (file)
@@ -265,10 +265,8 @@ struct drm_plane *exynos_plane_init(struct drm_device *dev,
        int err;
 
        exynos_plane = kzalloc(sizeof(struct exynos_plane), GFP_KERNEL);
-       if (!exynos_plane) {
-               DRM_ERROR("failed to allocate plane\n");
+       if (!exynos_plane)
                return NULL;
-       }
 
        err = drm_plane_init(dev, &exynos_plane->base, possible_crtcs,
                              &exynos_plane_funcs, formats, ARRAY_SIZE(formats),
index a77cd5bb104c9f286b27c1c4a9fda4daf3557c7e..7b901688defa78f5e2d6ee1853e45f71f8e4bf2b 100644 (file)
@@ -472,10 +472,8 @@ static int rotator_init_prop_list(struct exynos_drm_ippdrv *ippdrv)
        struct drm_exynos_ipp_prop_list *prop_list;
 
        prop_list = devm_kzalloc(ippdrv->dev, sizeof(*prop_list), GFP_KERNEL);
-       if (!prop_list) {
-               DRM_ERROR("failed to alloc property list.\n");
+       if (!prop_list)
                return -ENOMEM;
-       }
 
        prop_list->version = 1;
        prop_list->flip = (1 << EXYNOS_DRM_FLIP_VERTICAL) |
@@ -713,10 +711,8 @@ static int rotator_probe(struct platform_device *pdev)
        }
 
        rot = devm_kzalloc(dev, sizeof(*rot), GFP_KERNEL);
-       if (!rot) {
-               dev_err(dev, "failed to allocate rot\n");
+       if (!rot)
                return -ENOMEM;
-       }
 
        match = of_match_node(exynos_rotator_match, dev->of_node);
        if (!match) {
index aecc601d540b22201c8745e07bfd8fb556256a0f..8ea07a106df2b0682e36968ad430998f0da1362c 100644 (file)
@@ -1825,10 +1825,8 @@ static int hdmi_resources_init(struct hdmi_context *hdata)
 
        res->regul_bulk = devm_kzalloc(dev, ARRAY_SIZE(supply) *
                sizeof(res->regul_bulk[0]), GFP_KERNEL);
-       if (!res->regul_bulk) {
-               DRM_ERROR("failed to get memory for regulators\n");
+       if (!res->regul_bulk)
                goto fail;
-       }
        for (i = 0; i < ARRAY_SIZE(supply); ++i) {
                res->regul_bulk[i].supply = supply[i];
                res->regul_bulk[i].consumer = NULL;
@@ -1869,10 +1867,8 @@ static struct s5p_hdmi_platform_data *drm_hdmi_dt_parse_pdata
        u32 value;
 
        pd = devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL);
-       if (!pd) {
-               DRM_ERROR("memory allocation for pdata failed\n");
+       if (!pd)
                goto err_data;
-       }
 
        if (!of_find_property(np, "hpd-gpio", &value)) {
                DRM_ERROR("no hpd gpio property found\n");
@@ -1952,17 +1948,13 @@ static int hdmi_probe(struct platform_device *pdev)
 
        drm_hdmi_ctx = devm_kzalloc(dev, sizeof(*drm_hdmi_ctx),
                                                                GFP_KERNEL);
-       if (!drm_hdmi_ctx) {
-               DRM_ERROR("failed to allocate common hdmi context.\n");
+       if (!drm_hdmi_ctx)
                return -ENOMEM;
-       }
 
        hdata = devm_kzalloc(dev, sizeof(struct hdmi_context),
                                                                GFP_KERNEL);
-       if (!hdata) {
-               DRM_ERROR("out of memory\n");
+       if (!hdata)
                return -ENOMEM;
-       }
 
        mutex_init(&hdata->hdmi_mutex);
 
index f6cb1205a2fd56b235afbc3a186f96af56e77301..63bc5f92fbb320e6287fa106a8357c7eac503435 100644 (file)
@@ -1186,16 +1186,12 @@ static int mixer_probe(struct platform_device *pdev)
 
        drm_hdmi_ctx = devm_kzalloc(dev, sizeof(*drm_hdmi_ctx),
                                                                GFP_KERNEL);
-       if (!drm_hdmi_ctx) {
-               DRM_ERROR("failed to allocate common hdmi context.\n");
+       if (!drm_hdmi_ctx)
                return -ENOMEM;
-       }
 
        ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
-       if (!ctx) {
-               DRM_ERROR("failed to alloc mixer context.\n");
+       if (!ctx)
                return -ENOMEM;
-       }
 
        mutex_init(&ctx->mixer_mutex);