From patchwork Fri Mar 4 20:20:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 8507461 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 558C89F38C for ; Fri, 4 Mar 2016 20:22:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8115B20121 for ; Fri, 4 Mar 2016 20:22:54 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9CC392022A for ; Fri, 4 Mar 2016 20:22:53 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1abwDo-0005Xe-Ut; Fri, 04 Mar 2016 20:21:12 +0000 Received: from lists.s-osg.org ([54.187.51.154]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1abwDh-0005S7-U2 for linux-arm-kernel@lists.infradead.org; Fri, 04 Mar 2016 20:21:06 +0000 Received: from sauron.localdomain (unknown [181.120.163.117]) by lists.s-osg.org (Postfix) with ESMTPSA id 3B46A462D4; Fri, 4 Mar 2016 12:20:42 -0800 (PST) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Subject: [PATCH 2/2] [media] exynos4-is: FIMC port parse should fail if there's no endpoint Date: Fri, 4 Mar 2016 17:20:13 -0300 Message-Id: <1457122813-12791-3-git-send-email-javier@osg.samsung.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1457122813-12791-1-git-send-email-javier@osg.samsung.com> References: <1457122813-12791-1-git-send-email-javier@osg.samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160304_122106_136302_52D4719C X-CRM114-Status: UNSURE ( 9.66 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.9 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Krzysztof Kozlowski , linux-samsung-soc@vger.kernel.org, Mauro Carvalho Chehab , Javier Martinez Canillas , Kyungmin Park , Kukjin Kim , Sylwester Nawrocki , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The fimc_md_parse_port_node() function return 0 if an endpoint node is not found but according to Documentation/devicetree/bindings/graph.txt, a port must always have at least one enpoint. So return an -EINVAL errno code to the caller instead, so it knows that the port node parse failed due an invalid Device Tree description. Signed-off-by: Javier Martinez Canillas --- drivers/media/platform/exynos4-is/media-dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/exynos4-is/media-dev.c b/drivers/media/platform/exynos4-is/media-dev.c index feb521f28e14..06f3d75c9a0e 100644 --- a/drivers/media/platform/exynos4-is/media-dev.c +++ b/drivers/media/platform/exynos4-is/media-dev.c @@ -394,7 +394,7 @@ static int fimc_md_parse_port_node(struct fimc_md *fmd, /* Assume here a port node can have only one endpoint node. */ ep = of_get_next_child(port, NULL); if (!ep) - return 0; + return -EINVAL; ret = v4l2_of_parse_endpoint(ep, &endpoint); if (ret) {