Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp3008754ybh; Mon, 16 Mar 2020 14:01:40 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvdhbthaJOF4p2mSWKK/uGMYfOagR933rXoiJEPXPOBTDQbozPRbZraiEqYYbIhF+ygdsys X-Received: by 2002:aca:2b04:: with SMTP id i4mr1092732oik.61.1584392500215; Mon, 16 Mar 2020 14:01:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584392500; cv=none; d=google.com; s=arc-20160816; b=NSQIdIRwJK364gVvlaKns5C5ngxHGW069sD6A0YB4Ff88Hss/4ynKhXuEeT8gWCAhr 3PrDTaQoi/zCUWKdf1YIsQyEGcUt2Z2dZaMfq/n27a7y+QagkbyKSd/T4ptq72i+Tucd m71bwzmjBBYFnFZLu6AiucHtyk1DHXffBya3IPZGlDBDXxPgY9gMk/BGxZVTyJJraduL w4W+ifU0rq2ANLovwieTPcME+Y/ns3MJGwrpoGClOtNH4CiPdVisvEv3U1AW3EdR77Kk KUsqevONcreYMSuo/LJh3vUaF57iAF+TkTQBmGBAJTOL9uE8wvE34PB/RYncO1G3EqrE plbw== 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=Q+kzXZWni8Z5Rvsm3/s21wpcUwd8RMdH8mIP+jayXh0=; b=R+UFSB3HFdaUOUlQP/UrUGHxRwMhxXTnBI0KxbPl0OK8lj4K3mTuGLRu5lJunJXkTg rrT5gDATNah795BQ31OJoPZp+8AN1pLq7TXk9agVOM8Ur+vYuFfCIhpohkqHlAHS9jNB i7NVoSqhXbJhp8fFBSHDkN9pxXCl/FvB+cwVFWvzo8rGDDv0a8mKiqqz0fbec2y8oZIg oz5tbpV9+RsdQgrS7lJ2rg2tOBLrQOot1J0MCKs6RYG0iUODfC4VGYsOA9EVQ0h37Ig1 1y4LhoM2AREgyMElirDcwMhaSW1fmuvWhk40Y68BVSgAG6Wxw+rl/YDFahnSp92Tp2wd 9E2A== 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 e11si463360oie.254.2020.03.16.14.01.27; Mon, 16 Mar 2020 14:01:40 -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 S1732649AbgCPVA7 (ORCPT + 99 others); Mon, 16 Mar 2020 17:00:59 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:52468 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732571AbgCPVA6 (ORCPT ); Mon, 16 Mar 2020 17:00:58 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: koike) with ESMTPSA id 0CE48291A70 From: Helen Koike To: linux-media@vger.kernel.org Cc: mchehab@kernel.org, linux-kernel@vger.kernel.org, tfiga@chromium.org, linux-rockchip@lists.infradead.org, hans.verkuil@cisco.com, kernel@collabora.com, Helen Koike Subject: [PATCH v2 1/2] media: staging: rkisp1: cap: fix return values from pm functions Date: Mon, 16 Mar 2020 18:00:43 -0300 Message-Id: <20200316210044.595312-2-helen.koike@collabora.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200316210044.595312-1-helen.koike@collabora.com> References: <20200316210044.595312-1-helen.koike@collabora.com> 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 If no errors occurs, pm functions return usage counters, so they can return positive numbers. This happens when streaming from multiple capture devices (mainpath and selfpath). Fix simultaneous streaming from mainpath and selfpath by not failing when pm usage counters returns a positive number. Signed-off-by: Helen Koike --- Changes in v2: - Rebased on media/master drivers/staging/media/rkisp1/rkisp1-capture.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/rkisp1/rkisp1-capture.c b/drivers/staging/media/rkisp1/rkisp1-capture.c index 24fe6a7888aa..967bd05b4507 100644 --- a/drivers/staging/media/rkisp1/rkisp1-capture.c +++ b/drivers/staging/media/rkisp1/rkisp1-capture.c @@ -939,7 +939,7 @@ static void rkisp1_vb2_stop_streaming(struct vb2_queue *queue) v4l2_pipeline_pm_put(&node->vdev.entity); ret = pm_runtime_put(rkisp1->dev); - if (ret) + if (ret < 0) dev_err(rkisp1->dev, "power down failed error:%d\n", ret); rkisp1_dummy_buf_destroy(cap); @@ -992,7 +992,7 @@ rkisp1_vb2_start_streaming(struct vb2_queue *queue, unsigned int count) goto err_ret_buffers; ret = pm_runtime_get_sync(cap->rkisp1->dev); - if (ret) { + if (ret < 0) { dev_err(cap->rkisp1->dev, "power up failed %d\n", ret); goto err_destroy_dummy; } -- 2.25.0