Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1839263pxb; Mon, 13 Sep 2021 06:41:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLjMeKl9eOCci20GKT78WdrlkukT8LIxHWlsxtTVolB9k6KgMchJ2HidXIS46KOIUjMsio X-Received: by 2002:a05:6638:14cf:: with SMTP id l15mr9757645jak.8.1631540473235; Mon, 13 Sep 2021 06:41:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631540473; cv=none; d=google.com; s=arc-20160816; b=PJ8gDplqT1IBc90LgL9MLviajRq3qFehiyK6PAwHi8unmpMkTXJtEf2pbxwselM0WJ xIy00CMynytlStVmkYGhD/X/HpO+fSR9Y6uAbzVDi4wJcuJrMVSPqLdm0obOMTRXMP4X PwQmMt4sQG+Hk6f8BC7gQkbOSqq0f9faSSsjDCc2HyXaxiSjHe3GrNPAOGvXbMTPhXHu t+sEJGFdP8IQ59DI/MLi761YFUXyLGwJKp908dwEvv6l+BrZzL+KBTRmiZ0eSYJ25+6H SX69nAEt2oK9zJuWIPlmsxdea3CPHLH19oTT1l9rG35sDCzcAYibVJPpIv/WbhDXnZyb 9jNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=SH2HQkzoHbH6vxS67FC5dpmzfLP+SGkQIuQIpG5cwl0=; b=Gu7I40I+/Uh7SgHOaJbHo09kAoFs9sRaAtlNkIuz9af5Ae5qeAG3hlzC1drBuhS9tD Ft4NrIUWx+QLR4SPmU33GGXOKrqO6rnzDAALP6AvUNt2MSAjXs6Ct/Osekp8S86eInxd IbDQHMoOfYzUPzaq+9Ve3+nAphs2WmCr+2rIBHnwPItHv8Z7wCDnfNDrYsk6fK00Gjxr WeyOZelIC0KkwksnAAdufsQyoanCI7emRGnwLei+b8uf3DwcilKyfjGbZYsxzf640n5/ HGWgh0NBMQTRzbJ+y6sHfHlJdbDurP4GRjJ5uWyaWlIYUakp8hUIWzKz8KCDtEVWvtkz D8Kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vdsnq+RP; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n10si7073499iog.43.2021.09.13.06.40.59; Mon, 13 Sep 2021 06:41:13 -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=pass header.i=@linuxfoundation.org header.s=korg header.b=vdsnq+RP; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242321AbhIMNkv (ORCPT + 99 others); Mon, 13 Sep 2021 09:40:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:34434 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243172AbhIMNfD (ORCPT ); Mon, 13 Sep 2021 09:35:03 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 278BF6138D; Mon, 13 Sep 2021 13:27:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539627; bh=pLAPbPviZiRS8pmnWmm1gDYEsm7lgwqAVHmflSZM65w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vdsnq+RPtxqofkq33cFst57BjoPHesyt2WBC+8dmZeQJabx3UrhOOembFuZK0s/j1 ZDAl9//YTfzvcHr5XLF4kC6U7qEZwO3hm2utBOdqZvpPrtP7ci7cK7PP/NmO8GTSjq GqjzM+rPeTd+xwRpuFKiw8opRCB7X2gt6fzhVVR4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ezequiel Garcia , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.10 096/236] media: rockchip/rga: use pm_runtime_resume_and_get() Date: Mon, 13 Sep 2021 15:13:21 +0200 Message-Id: <20210913131103.619911420@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131100.316353015@linuxfoundation.org> References: <20210913131100.316353015@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mauro Carvalho Chehab [ Upstream commit 0314339a0a49f4a128b61e5e1a0af1df6e64a186 ] 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. Reviewed-by: Ezequiel Garcia Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/platform/rockchip/rga/rga-buf.c | 3 +-- drivers/media/platform/rockchip/rga/rga.c | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/rockchip/rga/rga-buf.c b/drivers/media/platform/rockchip/rga/rga-buf.c index bf9a75b75083..81508ed5abf3 100644 --- a/drivers/media/platform/rockchip/rga/rga-buf.c +++ b/drivers/media/platform/rockchip/rga/rga-buf.c @@ -79,9 +79,8 @@ static int rga_buf_start_streaming(struct vb2_queue *q, unsigned int count) struct rockchip_rga *rga = ctx->rga; int ret; - ret = pm_runtime_get_sync(rga->dev); + ret = pm_runtime_resume_and_get(rga->dev); if (ret < 0) { - pm_runtime_put_noidle(rga->dev); rga_buf_return_buffers(q, VB2_BUF_STATE_QUEUED); return ret; } diff --git a/drivers/media/platform/rockchip/rga/rga.c b/drivers/media/platform/rockchip/rga/rga.c index 9d122429706e..bf3fd71ec3af 100644 --- a/drivers/media/platform/rockchip/rga/rga.c +++ b/drivers/media/platform/rockchip/rga/rga.c @@ -866,7 +866,9 @@ static int rga_probe(struct platform_device *pdev) goto unreg_video_dev; } - pm_runtime_get_sync(rga->dev); + ret = pm_runtime_resume_and_get(rga->dev); + if (ret < 0) + goto unreg_video_dev; rga->version.major = (rga_read(rga, RGA_VERSION_INFO) >> 24) & 0xFF; rga->version.minor = (rga_read(rga, RGA_VERSION_INFO) >> 20) & 0x0F; -- 2.30.2