From patchwork Wed Jul 24 15:19:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guillaume Tucker X-Patchwork-Id: 169612 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp10396320ilk; Wed, 24 Jul 2019 08:20:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqz7LMcO1uIQPMhFLPQSPZirprX5c+HcZTt30xNyKu4coLBeyDljNpobZazlYD4ZTPnYhQ+9 X-Received: by 2002:a17:90a:30cf:: with SMTP id h73mr89615316pjb.42.1563981608815; Wed, 24 Jul 2019 08:20:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563981608; cv=none; d=google.com; s=arc-20160816; b=WMHgG7DWsVHxQ45tf1INBbtsA6NrnN58WL9lA2wxths2X9HyaJCAHocqVbn1uMWMWD JYOvhH2qvwcbHFmVEBkaafydqb1j8+IsMieeWIsVZhMEOzNQJlnpdCzxz80oyK19H7R8 oHiSUK/CZ88RLMUhcJr+/I9hEanAlII12b1YWxOc8wInYk45Wgd3qyGinQd7FRTk+8Wm Adm5PjItFTzyz6ZMC4hP1+O7aB5kzjY/3u1FV6s/AkAYsXyWIKv659Zq2/ByDCKlYGcV OKCfYb4jnZDrXzsKa8zlrjW76ElOARZenN1CljtTPpnmcRtpeF9U3jqs+i5NMRsz+Gq1 dqtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=mvG0Cx4669ebTQ8sa40V8N+CKr8TkTPwyjkOom5kA/s=; b=dU1o3xdfq9EbjDcQ58MQI6x/1c1/prYVlOk5HTtreq8vjC5bqPTs6qJYT8kg8pX5oK krFaYzljCWMJylFCLHmE3CFbk0gkSLd0jnY3QwmEHCAEaNYEF5HzJKaCdFmFjLz1wShs TI6AU8JelBKilX+9DIsEWp1C9bifqf++IxHfxP4KraAjqaaUTwOGsOnlhQGc3aBuQ002 qqjQIUJ36W9cvgG+IWRNIM3WveapfntOWo8KWcJUX5QMOVyy9JbqkL4YN3usVViaunQS MIVbLxaztwXtojuZyqVLnm08/4rR098zKaJYdEiPOKdKAgwX927cLouNa5G8myBwuDqA oogg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s7si17225942plp.66.2019.07.24.08.20.08; Wed, 24 Jul 2019 08:20:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387607AbfGXPUH (ORCPT + 29 others); Wed, 24 Jul 2019 11:20:07 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:33574 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725870AbfGXPUG (ORCPT ); Wed, 24 Jul 2019 11:20:06 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: gtucker) with ESMTPSA id AF18728B4E7 From: Guillaume Tucker To: Hans Verkuil , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@collabora.com, Guillaume Tucker , stable@vger.kernel.org Subject: [PATCH] media: vivid: fix device init when no_error_inj=1 and fb disabled Date: Wed, 24 Jul 2019 16:19:22 +0100 Message-Id: <20190724151922.11124-1-guillaume.tucker@collabora.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add an extra condition to add the video output control class when the device has some hdmi outputs defined. This is required to then always be able to add the display present control, which is enabled when there are some hdmi outputs. This fixes the corner case where no_error_inj is enabled and the device has no frame buffer but some hdmi outputs, as otherwise the video output control class would be added anyway. Without this fix, the sanity checks fail in v4l2_ctrl_new() as name is NULL. Fixes: c533435ffb91 ("media: vivid: add display present control") Cc: stable@vger.kernel.org Signed-off-by: Guillaume Tucker --- drivers/media/platform/vivid/vivid-ctrls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.1 diff --git a/drivers/media/platform/vivid/vivid-ctrls.c b/drivers/media/platform/vivid/vivid-ctrls.c index 3e916c8befb7..7a52f585cab7 100644 --- a/drivers/media/platform/vivid/vivid-ctrls.c +++ b/drivers/media/platform/vivid/vivid-ctrls.c @@ -1473,7 +1473,7 @@ int vivid_create_controls(struct vivid_dev *dev, bool show_ccs_cap, v4l2_ctrl_handler_init(hdl_vid_cap, 55); v4l2_ctrl_new_custom(hdl_vid_cap, &vivid_ctrl_class, NULL); v4l2_ctrl_handler_init(hdl_vid_out, 26); - if (!no_error_inj || dev->has_fb) + if (!no_error_inj || dev->has_fb || dev->num_hdmi_outputs) v4l2_ctrl_new_custom(hdl_vid_out, &vivid_ctrl_class, NULL); v4l2_ctrl_handler_init(hdl_vbi_cap, 21); v4l2_ctrl_new_custom(hdl_vbi_cap, &vivid_ctrl_class, NULL);