From patchwork Thu Sep 6 15:23:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Senna Tschudin X-Patchwork-Id: 1415861 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 1BDF7DFFCF for ; Thu, 6 Sep 2012 15:24:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758259Ab2IFPYx (ORCPT ); Thu, 6 Sep 2012 11:24:53 -0400 Received: from mail-wi0-f172.google.com ([209.85.212.172]:62900 "EHLO mail-wi0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757882Ab2IFPYU (ORCPT ); Thu, 6 Sep 2012 11:24:20 -0400 Received: by mail-wi0-f172.google.com with SMTP id hi8so567488wib.1 for ; Thu, 06 Sep 2012 08:24:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=7S6OGtYnle6am26ouDyUkuiNAtzyvWpXS5eFmxgnMOQ=; b=B1l8s0eiB1SVxABUSj7MknAPv7ybxEJMuR0NkaWmnungFFy/PZJ2UEWqTEVAR7/riR +0MK5V8Ogk4RmlpTH5pP7Co4AIKjqA+PrFv6kkVO1eVjcI8zHFPzEVO3mSsVLcHBWNON 2dI//c+gEKKBaJ5Sci67+F2U7veWd4MZsHTOf8DqCW2A9r34LU/HFt3rHeK+asDHXe/k N0zO5c3vPXSczLdQ0K63pe4jp/FI8qyfur8Qx96Om8KabVj0C8eEoR0k4n+jHzO3p16z VHMmQjQ8L2oAKDywfQAGBwzc4Ps5eWFXkwwJOpPEPIvfyjpDxgi6yiI/L+4uQSLDeq37 PrRg== Received: by 10.216.41.195 with SMTP id h45mr1525894web.74.1346945059081; Thu, 06 Sep 2012 08:24:19 -0700 (PDT) Received: from localhost.localdomain ([132.227.100.38]) by mx.google.com with ESMTPS id el6sm4572331wib.8.2012.09.06.08.24.18 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 06 Sep 2012 08:24:18 -0700 (PDT) From: Peter Senna Tschudin To: Mauro Carvalho Chehab Cc: kernel-janitors@vger.kernel.org, Julia.Lawall@lip6.fr, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/14] drivers/media/platform/soc_camera/mx2_camera.c: fix error return code Date: Thu, 6 Sep 2012 17:23:59 +0200 Message-Id: <1346945041-26676-12-git-send-email-peter.senna@gmail.com> X-Mailer: git-send-email 1.7.11.4 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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,