Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp621382pxy; Wed, 28 Apr 2021 10:38:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuAqvkTJNGkT4+Rixk2uyP0XslpPceYJPJeHcPk/D1tDGIavH3KmcyRoMoeA9Vs2ngFGBF X-Received: by 2002:aa7:d9cf:: with SMTP id v15mr12883051eds.358.1619631490309; Wed, 28 Apr 2021 10:38:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619631490; cv=none; d=google.com; s=arc-20160816; b=zMyc+L0f6I9UDqxeu3F1AGmWxwBibbf5CgR73xXsmOwa1Mya2ShQpLe1mVJE96pnux dNBXILZ3bg58LPLnq5UMUyUD9Rlnvwf8eHJ2g7xlbmAHBi1z4bhMOMMhHwq+6ZjvI+YP Cacmnd+dEjgGKxfwOWxZRz+jFUKERA5l1O1P1GbdGJdxUJPSsrKcTFdAsH9LtX+urynM oD0XfpLj9HOWMfm4N6y6UUxbv66Br2KIPOi1jazU3bDDpt/YlOF4dnnDX5/o3g+ZwKVv GYS3s4kDk05jFkAMMJE8X1V4KZj7FK80hYu+3CVQ35yCfNMCmmhcjOQDURaXaeiHnDcw PX8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:from :dkim-signature; bh=VMvfSgnn6oSyhENzNZN7g3TxreG2d2E/GvlVbPp4Nxs=; b=Lx9jMWHVwZ5sVgsKG4E4ciS4aZt164bHjl7aj6ABPPP+rjfT2q9po62xXRn0iD7wM5 AkOHoSmulShB2CfqSdUQwR9NXhI0kZu2nwsa3fJz0HLi0AQ5zrYosrfNpOOSJnSuxPDW AuO6fyk0vUvBk+wQRJ/69H65U8+l5UkEQgByYxUUKuASZPZJS453areIhSebWdnihaii qsgOofdXSP6L5rKZLV7HsgLJ3P563JIwUoLuF1oyX96wkvWnAyV2t4BUE4dc6MhMPtY8 4sAiyfUey05Vd61zsbZ9ycrSZKM7477x1mdVTuvEhp6KKrqwtLXCvAblZHAHd9+3otmG 641g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=f9chViMs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a15si349864edr.346.2021.04.28.10.37.24; Wed, 28 Apr 2021 10:38:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=f9chViMs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240738AbhD1Ozi (ORCPT + 99 others); Wed, 28 Apr 2021 10:55:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:36784 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240270AbhD1Oxe (ORCPT ); Wed, 28 Apr 2021 10:53:34 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2DF1B61613; Wed, 28 Apr 2021 14:52:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619621564; bh=/R60wucnhMxzatTcaaq6aX+wA4KyHRrla+Ogrsx7GxU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f9chViMs3E4W7TC7maIn7wiUQ4uOsIa58vIJZBldqJPCAjN4dA9W5L3AtC/OU1w0L jWb1/AbmXGmQkBJqs6e0NgoMgSyrSOXFzGVp4pPSq7hc79Nm55tTclGe3fAUGnVz5e x3NxLPuPGuGyQvb3SwPzRN/7WYpapNMHH0EzZzWrAyHfvrCMY639oNLPRTXWBiK37p Cvp82r/YZagqgx8ZIs1popTCucIkmm/FzXRdBNq3YkSzojrefzlP1NE2UOBS9g4Ycd fwqF6UO6yrZN8Ort/1+xObArJ+FjzZrPdeXISRO2SggVtVcpe/Vp+xJBG/J0TDIHSv mEN1PCZyD5LmA== Received: by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1lblYR-001Dt7-RR; Wed, 28 Apr 2021 16:52:43 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Alexandre Torgue , Hugues Fruchet , Mauro Carvalho Chehab , Maxime Coquelin , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com Subject: [PATCH v4 73/79] media: stm32: use pm_runtime_resume_and_get() Date: Wed, 28 Apr 2021 16:52:34 +0200 Message-Id: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit dd8088d5a896 ("PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter") added pm_runtime_resume_and_get() in order to automatically handle dev->power.usage_count decrement on errors. Use the new API, in order to cleanup the error check logic. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/platform/stm32/stm32-dcmi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/stm32/stm32-dcmi.c b/drivers/media/platform/stm32/stm32-dcmi.c index bbcc2254fa2e..5f4e1db8cfcd 100644 --- a/drivers/media/platform/stm32/stm32-dcmi.c +++ b/drivers/media/platform/stm32/stm32-dcmi.c @@ -723,11 +723,11 @@ static int dcmi_start_streaming(struct vb2_queue *vq, unsigned int count) u32 val = 0; int ret; - ret = pm_runtime_get_sync(dcmi->dev); + ret = pm_runtime_resume_and_get(dcmi->dev); if (ret < 0) { dev_err(dcmi->dev, "%s: Failed to start streaming, cannot get sync (%d)\n", __func__, ret); - goto err_pm_put; + goto err_unlock; } ret = media_pipeline_start(&dcmi->vdev->entity, &dcmi->pipeline); @@ -848,6 +848,7 @@ static int dcmi_start_streaming(struct vb2_queue *vq, unsigned int count) err_pm_put: pm_runtime_put(dcmi->dev); +err_unlock: spin_lock_irq(&dcmi->irqlock); /* * Return all buffers to vb2 in QUEUED state. -- 2.30.2