Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1944387pxy; Fri, 23 Apr 2021 23:53:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtMP8sg8lgZVP6Zvs04ff6b+Dzvj3AbdZ9HB8m021O7GQ4JLXy1GsIoWUORtPKKse687kY X-Received: by 2002:a17:906:5652:: with SMTP id v18mr1005299ejr.457.1619247195104; Fri, 23 Apr 2021 23:53:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619247195; cv=none; d=google.com; s=arc-20160816; b=rYOW0uRHMs+fbG8Xt8qVZA18ES5XAQNCtPAMxmbd04taaWuWFGmgCO8jl3GM1EHEym G/rd7sacPvd1vvyBjO3aQyVqdADrlBHVAXxKA8xLdvxX3mLZdpDu5z1sGVtoysrQ8Yz9 IoOypitogmWBHViyCO7RYQHAf6HVqIQ7b3LgjYuhMWLKIG0zBqfilYvHICx3mi1TCVUB kYQPNyLQOy1tOXNn2C6kmvT8OSSav0MiQ2CuqrsBrwJJTt47BKswgy4lkDeJ+JbzEzvJ WaYEIwPNh2gvRhPAnu6wLkmVtaT/KLIX75B4KOXXm9f8JGTEwh5ssjAsZ9C8PTiAnF47 BY8Q== 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=tWC98gV1RItDDbsDGxY/cuT3KZgUL732sUSdtE94n3E=; b=O4a3nfoktc+hwoxmOJ/OwJuNscQQShLHVpFSoS3PAd7H9GsIaawDFCmFLiKsuAKYYf ZM8IONvCmnMdhzj4Ven8qCe/CyKDrpkB6/GfkgFU26J8pFhdA/JyDdrziy7Z4JpfyRdO T4qvA/1DjyTPR/NM8Jbtt6342eLaCj184v8tWTXmnIduCUOKZsgL0xdXyvOaxS9ctOAE 9ninZ3zOOJXQg9jDCdbal3eH0bZaX0Mb5scN10b27bKr1Mq3YSxask0N+AGbjsX1rGFZ er5ionmVsc3eFwZUg1pKAMj3/pcgu71fdKhCkULDHn42hoDgJaB3dO51rmLDk4CfbWq7 QWUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b="bGdQ4g/g"; 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 eb8si8305684edb.103.2021.04.23.23.52.50; Fri, 23 Apr 2021 23:53:15 -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="bGdQ4g/g"; 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 S244430AbhDXGtV (ORCPT + 99 others); Sat, 24 Apr 2021 02:49:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:36102 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233148AbhDXGqO (ORCPT ); Sat, 24 Apr 2021 02:46:14 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 84FD561883; 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=8oeNDL2f6ftikmJG74aEJuwd7JVkpDOtWW3l23y+D78=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bGdQ4g/gJyNCz0LQj8u6n88WF7b0S6Xu1onkMcimk0a8pYtXgt5y8lsdHl7CXibXW WQ0sjPDTr5dBBuLUspweR54JOJ/T42D/qGzELI525e6tL2SnzGv18Q1xkpVdX4p+Px q1VC8dwYBevkatfxeEgZWGGQYJmKdEU3tZOwlRFMysVkdxdply4b/3CT7c342vgbPy QpYmYA2uAtPONuJVdElIVuoFZoVLsH50HPtvscqomyh49H9TTwNJGYgk/LbEXJiIhv N5essxLY7swKsUZBTl3dVMXiPPOK2F3EsVASQ/kD7wb6cKv+3ITlDwuHscSdR1DIoK 4EDxQdVXqNA1A== Received: by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1laC2l-004Jf4-MS; Sat, 24 Apr 2021 08:45:31 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Mauro Carvalho Chehab , Sakari Ailus , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH 28/78] media: i2c: dw9807-vcm: use pm_runtime_resume_and_get() Date: Sat, 24 Apr 2021 08:44:38 +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/i2c/dw9807-vcm.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/media/i2c/dw9807-vcm.c b/drivers/media/i2c/dw9807-vcm.c index 438a44b76da8..95e06f13bc9e 100644 --- a/drivers/media/i2c/dw9807-vcm.c +++ b/drivers/media/i2c/dw9807-vcm.c @@ -130,15 +130,7 @@ static const struct v4l2_ctrl_ops dw9807_vcm_ctrl_ops = { static int dw9807_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) { - int rval; - - rval = pm_runtime_get_sync(sd->dev); - if (rval < 0) { - pm_runtime_put_noidle(sd->dev); - return rval; - } - - return 0; + return pm_runtime_resume_and_get(sd->dev); } static int dw9807_close(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh) -- 2.30.2