Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1945307pxy; Fri, 23 Apr 2021 23:55:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxdbQXTtnDVOO8vCAKBaM6n2KnZQXYUDSpl1vdShNjewu6u0YB+n2ztJSBBRnMjemUgMlep X-Received: by 2002:a17:906:cc9b:: with SMTP id oq27mr7830279ejb.81.1619247344135; Fri, 23 Apr 2021 23:55:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619247344; cv=none; d=google.com; s=arc-20160816; b=gptQ7WYXgBgx0MSw7jKURFKf+h7R2PqohXaW48ubo0wAq/+uy/3HpCxO9t+mSQW6tx 7j2tTCvkEgbbYHwMhmTuDz2WWiJxzI0CxR2SKMBjCy6avzip0wNkUk3xDfuD9iQZSYzS pyQ+k/oXZAnR6RyS05QAN4nm88JifSmcPn/ef4XUFdVc07yi8hcSv2w5vhYs3/Cps7F+ 6wFuwoIV6l8ctRbzAWXiORdawIQjlg8MKG0OgTCNaCUWT2XAps4CWLFZB0NjdiTpI2St kkKvT5DgVRyPCvaTzINrPOpSYwyEUzpIntkvIVbUfAnjSpOL9IMz85w+frjlaPwRVCqo sgWQ== 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=QhHrD2hdti/aHywgiNnSlUWoWC/BiCEKr+4+mhJkxmE=; b=Wih1F+ZeTVkrJ3BuziGlYDbvL/Y8IIyH0puDX85KiCJFKyP2pKBsaXPMRkvnyLuJr9 AG975mYfVrbB9wg/4/1qPdPAvvNtaojUZuzS5uPr4oYj/QpsMrC1agOSf6C662X57jna MZqQaxP+qmnQ0ZJYXVkYwaPf965isS1TFPZj/ePU4O8w8IWy62R/bfvx48e7ua7XAvpT IEeuU+OqvHRKsErxezQnkMI19njp2kicQ9gawDpmznt9qFgwH3IabW7Br0arDmXz20BY 7bwRwSqfA5J7KMs1894f2iE9mW4vpkA+d2LyvES9NRZ0e0ZpTJj4lsCRECq0F5ho7rvr 16ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=TGz2XCF1; 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 ju11si7422428ejc.191.2021.04.23.23.55.19; Fri, 23 Apr 2021 23:55:44 -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=TGz2XCF1; 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 S237451AbhDXGvD (ORCPT + 99 others); Sat, 24 Apr 2021 02:51:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:35772 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233614AbhDXGqT (ORCPT ); Sat, 24 Apr 2021 02:46:19 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A8C7F61929; Sat, 24 Apr 2021 06:45:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619246733; bh=73B6Lks3AupUDrJCPSyBZhCBhq2sPf760XjzihM5LGk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TGz2XCF1NBN5v9sRqR1k/Cdld7bRC9Vf+FjW+LutJNOgASes5u5gXs8T9cDHMos6S E3S1wOKCu4N0yFoky6K/LoXIQzj4qV3TiqbxX0+YJsTRdaZZLuZk9WYxMSelsH0Heb n5H7KrmjeD+wBRj9DrdKQu/VlROMxUnhNEDbzAmXdTUz02eucF3KaktGGts3z6n9ac s6l7dacgoXBPyx5EgOR0gfyWvD3cTXDUoLx2sp7AGE7UbraRWRhYMUm7uWOIk+Ryke 1aaDMBwB4rzZ85FdeeY80pNRHKvqJdUhcSlIjI3FE1AOruUpl1U7pddB4RsiVMjFTu DCcSs/MAsQagg== Received: by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1laC2m-004Jgu-QO; Sat, 24 Apr 2021 08:45:32 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Stanimir Varbanov , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH 66/78] media: vdec: use pm_runtime_resume_and_get() Date: Sat, 24 Apr 2021 08:45:16 +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/qcom/venus/vdec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index ddb7cd39424e..347e533ea673 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -568,7 +568,7 @@ static int vdec_pm_get(struct venus_inst *inst) int ret; mutex_lock(&core->pm_lock); - ret = pm_runtime_get_sync(dev); + ret = pm_runtime_resume_and_get(dev); mutex_unlock(&core->pm_lock); return ret < 0 ? ret : 0; @@ -601,7 +601,7 @@ static int vdec_pm_get_put(struct venus_inst *inst) mutex_lock(&core->pm_lock); if (pm_runtime_suspended(dev)) { - ret = pm_runtime_get_sync(dev); + ret = pm_runtime_resume_and_get(dev); if (ret < 0) goto error; -- 2.30.2