Received: by 2002:ac0:a874:0:0:0:0:0 with SMTP id c49csp603226ima; Fri, 15 Mar 2019 09:46:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqy/EEGZ/BiWx9vynqO4Kb392wVmXTJ5FwUxFPxcjH3mv1HH6sLmxXWK35l1x13zvl50zte5 X-Received: by 2002:a62:f94b:: with SMTP id g11mr4086554pfm.199.1552668374709; Fri, 15 Mar 2019 09:46:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552668374; cv=none; d=google.com; s=arc-20160816; b=o2a6eRedzdD7PqJCx6Dm4q/Q74gNr3pp+x4yZ6b2jrKWGQQCP08TRptP60S2cxtSV+ ocW8WhihiqH68ZYSOtJoPmX/cOF8DyZK55EPNo4BHYrygpR9RGO340unoK0ib4A+4arn p5OPMtQV/i7V4KGdRxVX+xFQSQXrBgW730QJg2Bl3VVyShOCLoIeH95fe07jhwS9N7tc dCsJTdz0ZvgR5xrXfjH+P18opXFbGMLLVYPVLdgRdWotJYNfPd295FdK3/1ySOw+gReq 7hNXI6IuW1lBOjqK9S1Rbt2bQxCp9V+b9PRACphaffMzu0fzbYR/+6VMqrk66+Kl+Dtb zgXQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=P48DYeOG/QJts3r6LzTQrSxrMaop4EOnzOutGC6tOMM=; b=ihg6ztGxf6Cjn9MTmIIniYeZ+/k1SQbspl+w85MnkXGiJOc9vDMKjlTqbd/EMPj5gB OKNQuOC76UUlq0QhQlZMAI1Pb1Bk/JMrctuU7LairvnPjHZuKd8PSa2Kok+iMBVJj+5H reJflHrOkni41Deg6jo0Xb8XZwJrLwG0I9W5s47IyWPpXn93FWb4THeZ2CwWgVgVCU77 SIvR3ZzVruftoYORKx4WGvNEg9nz5nk/iCbK2RTUbHHLBALvPpmEfSqmQ3R2LUhrlsDM TCdEZTj+9WKqGJd2ng39i5fwqeh3KtlSLErsfyj+/1ecLCAZvf7GZTCjQpYahhNsxoFc BYIA== 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 s198si2062107pgs.582.2019.03.15.09.45.59; Fri, 15 Mar 2019 09:46:14 -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 S1729695AbfCOQpL (ORCPT + 99 others); Fri, 15 Mar 2019 12:45:11 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:48986 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729678AbfCOQpI (ORCPT ); Fri, 15 Mar 2019 12:45:08 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: tonyk) with ESMTPSA id 725B8260215 From: =?UTF-8?q?Andr=C3=A9=20Almeida?= To: linux-media@vger.kernel.org Cc: mchehab@kernel.org, hverkuil@xs4all.nl, helen.koike@collabora.com, lucmaga@gmail.com, linux-kernel@vger.kernel.org, kernel@collabora.com Subject: [PATCH 03/16] media: vimc: Check if the stream is on using ved.stream Date: Fri, 15 Mar 2019 13:43:46 -0300 Message-Id: <20190315164359.626-4-andrealmeid@collabora.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190315164359.626-1-andrealmeid@collabora.com> References: <20190315164359.626-1-andrealmeid@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Change the way that the subdevices check if the stream is running in set format functions. It uses the *stream in vimc_deb_device, the more appropriate pointer. This also makes easier to get rid of the void* and u8* in the subdevices structs. Signed-off-by: André Almeida --- drivers/media/platform/vimc/vimc-debayer.c | 2 +- drivers/media/platform/vimc/vimc-scaler.c | 4 ++-- drivers/media/platform/vimc/vimc-sensor.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/vimc/vimc-debayer.c b/drivers/media/platform/vimc/vimc-debayer.c index 5f84cb38f0f9..f72f888ba5a6 100644 --- a/drivers/media/platform/vimc/vimc-debayer.c +++ b/drivers/media/platform/vimc/vimc-debayer.c @@ -270,7 +270,7 @@ static int vimc_deb_set_fmt(struct v4l2_subdev *sd, if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) { /* Do not change the format while stream is on */ - if (vdeb->src_frame) + if (vdeb->ved.stream) return -EBUSY; sink_fmt = &vdeb->sink_fmt; diff --git a/drivers/media/platform/vimc/vimc-scaler.c b/drivers/media/platform/vimc/vimc-scaler.c index 3102febefd63..6e88328dca5c 100644 --- a/drivers/media/platform/vimc/vimc-scaler.c +++ b/drivers/media/platform/vimc/vimc-scaler.c @@ -158,7 +158,7 @@ static int vimc_sca_set_fmt(struct v4l2_subdev *sd, if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) { /* Do not change the format while stream is on */ - if (vsca->src_frame) + if (vsca->ved.stream) return -EBUSY; sink_fmt = &vsca->sink_fmt; @@ -334,7 +334,7 @@ static void *vimc_sca_process_frame(struct vimc_ent_device *ved, ved); /* If the stream in this node is not active, just return */ - if (!vsca->src_frame) + if (!ved->stream) return ERR_PTR(-EINVAL); vimc_sca_fill_src_frame(vsca, sink_frame); diff --git a/drivers/media/platform/vimc/vimc-sensor.c b/drivers/media/platform/vimc/vimc-sensor.c index 44a75099ce7f..e60f1985edb0 100644 --- a/drivers/media/platform/vimc/vimc-sensor.c +++ b/drivers/media/platform/vimc/vimc-sensor.c @@ -141,7 +141,7 @@ static int vimc_sen_set_fmt(struct v4l2_subdev *sd, if (fmt->which == V4L2_SUBDEV_FORMAT_ACTIVE) { /* Do not change the format while stream is on */ - if (vsen->frame) + if (vsen->ved.stream) return -EBUSY; mf = &vsen->mbus_format; -- 2.21.0