From patchwork Sun Sep 23 19:34:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 1495841 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 4E4F2400EC for ; Sun, 23 Sep 2012 19:35:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754181Ab2IWTfW (ORCPT ); Sun, 23 Sep 2012 15:35:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1657 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754050Ab2IWTfV (ORCPT ); Sun, 23 Sep 2012 15:35:21 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q8NJZ1fK010798 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 23 Sep 2012 15:35:01 -0400 Received: from [10.97.7.49] (vpn1-7-49.gru2.redhat.com [10.97.7.49]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q8NJYwpg015551 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 23 Sep 2012 15:34:59 -0400 Message-ID: <505F6461.8090401@redhat.com> Date: Sun, 23 Sep 2012 16:34:57 -0300 From: Mauro Carvalho Chehab User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120828 Thunderbird/15.0 MIME-Version: 1.0 To: Guennadi Liakhovetski , kernel-janitors@vger.kernel.org, Julia.Lawall@lip6.fr, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Senna Tschudin Subject: Fwd: [PATCH 2/14] drivers/media/platform/soc_camera/mx2_camera.c: fix error return code References: <1346945041-26676-12-git-send-email-peter.senna@gmail.com> In-Reply-To: <1346945041-26676-12-git-send-email-peter.senna@gmail.com> X-Enigmail-Version: 1.4.4 X-Forwarded-Message-Id: <1346945041-26676-12-git-send-email-peter.senna@gmail.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Please review, Regards, Mauro. -------- Mensagem original -------- Assunto: [PATCH 2/14] drivers/media/platform/soc_camera/mx2_camera.c: fix error return code Data: Thu, 6 Sep 2012 17:23:59 +0200 De: Peter Senna Tschudin Para: Mauro Carvalho Chehab CC: kernel-janitors@vger.kernel.org, Julia.Lawall@lip6.fr, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org From: Peter Senna Tschudin Convert a nonnegative error return code to a negative one, as returned elsewhere in the function. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // ( if@p1 (\(ret < 0\|ret != 0\)) { ... return ret; } | ret@p1 = 0 ) ... when != ret = e1 when != &ret *if(...) { ... when != ret = e2 when forall return ret; } // Signed-off-by: Peter Senna Tschudin --- drivers/media/platform/soc_camera/mx2_camera.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/platform/soc_camera/mx2_camera.c b/drivers/media/platform/soc_camera/mx2_camera.c index 256187f..f8884a7 100644 --- a/drivers/media/platform/soc_camera/mx2_camera.c +++ b/drivers/media/platform/soc_camera/mx2_camera.c @@ -1800,13 +1800,16 @@ static int __devinit mx2_camera_probe(struct platform_device *pdev) if (!res_emma || !irq_emma) { dev_err(&pdev->dev, "no EMMA resources\n"); + err = -ENODEV; goto exit_free_irq; } pcdev->res_emma = res_emma; pcdev->irq_emma = irq_emma; - if (mx27_camera_emma_init(pcdev)) + if (mx27_camera_emma_init(pcdev)) { + err = -ENODEV; goto exit_free_irq; + } } pcdev->soc_host.drv_name = MX2_CAM_DRV_NAME,