From patchwork Mon Sep 24 09:11:03 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: 1496761 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 6FBD03FC71 for ; Mon, 24 Sep 2012 09:11:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752551Ab2IXJL2 (ORCPT ); Mon, 24 Sep 2012 05:11:28 -0400 Received: from mail-wg0-f44.google.com ([74.125.82.44]:52533 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752420Ab2IXJL1 (ORCPT ); Mon, 24 Sep 2012 05:11:27 -0400 Received: by wgbdr13 with SMTP id dr13so3523713wgb.1 for ; Mon, 24 Sep 2012 02:11:25 -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:in-reply-to:references; bh=IXjXdurp7x6apliwZ7q4dFd4wUM5UvFT7EH1RQPoWnE=; b=QcuCEM5GEByF9iN2zi9rR9IRCIzskcIY/JkjrN2a0fu+lwYDeHY1WJ9s4eQJ+8mE9e +A/vGktfLt6auJsBdQHEGh0WFMkSRKfbAgemPre7ic7V3LoxGW7bvvEDIfp+8ZF6aHCU +70+L3FpYKRKkQyF7JXkDtChw2YKfNESqi314+DlTxKSPBFPStaoc5TVfwCrBNnGhrz7 Eehn0ziVg/bioRKElWvIbw8SAKxkhKoMZvNJ/YulOttQuGnsPsFsxoNgO3Uym8AVvi0q 0JUuQeMEjmO9pIdIDRVIHoEbO6UJdWxvBoWox8aqW9+12saZUHX7wfy9WtXwkSftmL73 F3MA== Received: by 10.180.104.200 with SMTP id gg8mr12930013wib.14.1348477885474; Mon, 24 Sep 2012 02:11:25 -0700 (PDT) Received: from ace.home.fr (ppeter.rsr.lip6.fr. [132.227.76.16]) by mx.google.com with ESMTPS id t8sm13817451wiy.3.2012.09.24.02.11.24 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 24 Sep 2012 02:11:25 -0700 (PDT) From: Peter Senna Tschudin To: mchehab@infradead.org Cc: g.liakhovetski@gmx.de, laurent.pinchart@ideasonboard.com, fabio.estevam@freescale.com, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Peter Senna Tschudin Subject: [PATCH V2 2/14] drivers/media/platform/soc_camera/mx2_camera.c: fix error return code Date: Mon, 24 Sep 2012 11:11:03 +0200 Message-Id: <1348477863-6728-1-git-send-email-peter.senna@gmail.com> X-Mailer: git-send-email 1.7.11.4 In-Reply-To: References: 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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/soc_camera/mx2_camera.c b/drivers/media/platform/soc_camera/mx2_camera.c index 256187f..01d7c11 100644 --- a/drivers/media/platform/soc_camera/mx2_camera.c +++ b/drivers/media/platform/soc_camera/mx2_camera.c @@ -1800,12 +1800,14 @@ 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)) + err = mx27_camera_emma_init(pcdev); + if (err) goto exit_free_irq; }