From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33F7DC43381 for ; Sat, 23 Feb 2019 00:17:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0087020700 for ; Sat, 23 Feb 2019 00:17:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550881033; bh=ce8yEH12ufAnMxjpcBfLb4aRGnc/dJA5vSDD9LGcV0A=; h=From:To:Cc:Subject:Date:List-ID:From; b=ibIBtjw1Qx4KEHx3kUSQ5u49EBb9An4JqNkKQSgQvsV36EjOQNWkZR+eACacj1w+O 6f+PyOGP497DUPKYpY3ek+z0Z2+tUQy0IaSIgPsdxCfEhu63P26IIAfOD+yBfqpl85 4xZNFVdX1fLXWMSLhvdi40MGy94Dm5SL7oPhFajc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727414AbfBWARL (ORCPT ); Fri, 22 Feb 2019 19:17:11 -0500 Received: from mail.kernel.org ([198.145.29.99]:33234 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725811AbfBWARL (ORCPT ); Fri, 22 Feb 2019 19:17:11 -0500 Received: from shuah-t480s.internal (c-24-9-64-241.hsd1.co.comcast.net [24.9.64.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 87093206B6; Sat, 23 Feb 2019 00:17:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550881030; bh=ce8yEH12ufAnMxjpcBfLb4aRGnc/dJA5vSDD9LGcV0A=; h=From:To:Cc:Subject:Date:From; b=LyWswE3ZpOCO0sX/KUo0XZME7B6Otbu0dXf20u6HY5brahP/6umaUhLEvL1laLYSr Ixe0w7vPdpUk2s0D0WNTobNA3Y5QLFPK8UX791LWWBzLnEmtkhjOILdFEGCtV2sMTu gzMPVRZrUSereCeuHjS1Lt8VtW8aRZrUyLdK+gVY= From: Shuah Khan To: mchehab@kernel.org Cc: Shuah Khan , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] media: replace WARN_ON in __media_pipeline_start() Date: Fri, 22 Feb 2019 17:17:09 -0700 Message-Id: <20190223001709.21486-1-shuah@kernel.org> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org __media_pipeline_start() does WARN_ON() when active pipe doesn't match the input arg entity's pipe. Replace WARN_ON with a conditional and error message that includes names of both entities. Signed-off-by: Shuah Khan --- drivers/media/media-entity.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c index 0b1cb3559140..757c641b7409 100644 --- a/drivers/media/media-entity.c +++ b/drivers/media/media-entity.c @@ -436,7 +436,10 @@ __must_check int __media_pipeline_start(struct media_entity *entity, entity->stream_count++; - if (WARN_ON(entity->pipe && entity->pipe != pipe)) { + if (entity->pipe && entity->pipe != pipe) { + pr_err("Pipe active for %s. Can't start for %s\n", + entity->name, + entity_err->name); ret = -EBUSY; goto error; } -- 2.17.1