From patchwork Tue Sep 4 16:14:27 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: 1403281 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 7B175DF280 for ; Tue, 4 Sep 2012 16:16:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757159Ab2IDQQU (ORCPT ); Tue, 4 Sep 2012 12:16:20 -0400 Received: from mail-we0-f174.google.com ([74.125.82.174]:50446 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757290Ab2IDQOw (ORCPT ); Tue, 4 Sep 2012 12:14:52 -0400 Received: by weyx8 with SMTP id x8so3734440wey.19 for ; Tue, 04 Sep 2012 09:14:51 -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=doESQjXHoeDLzrKda8QUp32V4ul64eNlGHLswR2r3E0=; b=AUDP71vh/dAobFOulVLscg7cDjY52ZZtw7/CO5A3CfQrqehIdWwEUdg8JwwnsQWJBq Nd6ChARzcW8hgPR7Y85K4p+NT4jkDbAoK6wpiCdeONVUvVkLYMFQgFWjuUPCLsu4/Q9H jwvY5VxnNJgbdTmxgV9az0Hrl6JutJnHWMSpE8SNjo4524XzJ2u6ElKLITSCnqpd9qlB R2F5NiiDZ2CCfOoxhplB6PmcOdxVtrRfluz+sm6iIykFFAC+SLLrc5jK92CtPN2yyU9+ jSjKeBK1ZNO+0W9oKJjPGqnQ6s3CgKOAGVsKtSDRmq3VU38Hwhw1ehAQBffgJVxjL8HK nltQ== Received: by 10.180.19.166 with SMTP id g6mr13325561wie.13.1346775291012; Tue, 04 Sep 2012 09:14:51 -0700 (PDT) Received: from localhost.localdomain ([132.227.100.38]) by mx.google.com with ESMTPS id l6sm24969613wiz.4.2012.09.04.09.14.50 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 04 Sep 2012 09:14:50 -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 3/5] drivers/media/platform/s5p-tv/mixer_video.c: fix error return code Date: Tue, 4 Sep 2012 18:14:27 +0200 Message-Id: <1346775269-12191-3-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/s5p-tv/mixer_video.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/s5p-tv/mixer_video.c b/drivers/media/platform/s5p-tv/mixer_video.c index a9c6be3..f139fed 100644 --- a/drivers/media/platform/s5p-tv/mixer_video.c +++ b/drivers/media/platform/s5p-tv/mixer_video.c @@ -83,6 +83,7 @@ int __devinit mxr_acquire_video(struct mxr_device *mdev, mdev->alloc_ctx = vb2_dma_contig_init_ctx(mdev->dev); if (IS_ERR_OR_NULL(mdev->alloc_ctx)) { mxr_err(mdev, "could not acquire vb2 allocator\n"); + ret = -ENODEV; goto fail_v4l2_dev; } @@ -764,8 +765,10 @@ static int mxr_video_open(struct file *file) } /* leaving if layer is already initialized */ - if (!v4l2_fh_is_singular_file(file)) + if (!v4l2_fh_is_singular_file(file)) { + ret = -EBUSY; /* Not sure if EBUSY is the best for here */ goto unlock; + } /* FIXME: should power be enabled on open? */ ret = mxr_power_get(mdev);