Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1945471pxy; Fri, 23 Apr 2021 23:56:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXTZ2wFLCqD2uO0kimk5EryG3Q+S/WyRss/loSX/pfDS5q3wyGr98/sOam06N/SieCrYKQ X-Received: by 2002:a17:906:36d1:: with SMTP id b17mr8278670ejc.235.1619247366551; Fri, 23 Apr 2021 23:56:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619247366; cv=none; d=google.com; s=arc-20160816; b=o2UWtU7QkO9KJbGB16D9oBO0lulXh6+JyU/CZqe9vgEK4ra8qq/s6Nzn3fFPYPmMli 7hHQCmRUspXl51KaCk4+WbEE1Qo2qVf6EqMfW34xAMrNpvCj4UfrXrAf4TBatsSXwV/7 u6sPF7My83M4LBwWLLONdPpMPMFNpSddxDmHC+JXVkMzkrloIh4heo7v3R+zbqbrkox2 ShhrQHE6qTPDo19D+xjptd+ZgSEoRlgjqdjcl8nnr+KD+tteZ1nPSO0IUhPQQrp6n3V5 s8YgdwEzKXrRF8jNbTQNx2mj5EqmV7WTbs3/crTUWTNbN+HZCpmaAgK3giAxDeo0WPDZ 0GrA== 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=YFI67N2tc3Y0cm/3bSsfNBBSD5VQRVJXdtVSoLk8IB8=; b=z0vBATzO6kMhU1k5xlGim7M6cVUV2lb558gIVCMd3JAOE2q+GfL7UMwR8Q8LZWrZ+t NClJVeW3qLBdtJTdz58qctFJwxqCMAWIXjef6vd04+0CatbI/YNOaR27NvDCXTQNtH6K C5wCIEoRWupTQLze0nTtCZY8K+xGS0JwRjLlRR7PDnXrwWbnqkCmCbfjYuOmeutmwn4Z O3UtIfp/yJuKU9O7TP1BnBV8AvrBp/8qXxBjOzbFD5V1X7TFuq+lGhL6AoiM6TZQ9ugj NA3adGWIEPT+jQ5YvFWK/UTlFrWoAJ8qmHhTqx4LomGRjQNUpkf/eCQqKlQkYaXDeOAR B3eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=ptCG4hLU; 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 a4si6853793edq.154.2021.04.23.23.55.42; Fri, 23 Apr 2021 23:56:06 -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=ptCG4hLU; 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 S232663AbhDXGwO (ORCPT + 99 others); Sat, 24 Apr 2021 02:52:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:35760 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234473AbhDXGq1 (ORCPT ); Sat, 24 Apr 2021 02:46:27 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D46B961943; 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=1619246734; bh=UPiG7WjyXSC7rjSk7XmxEwGay8JCnhR2MqRqUi6k0z0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ptCG4hLUA7WpUVdM3fjbS9LgdHDMYl+UBbr8i/SGdbyQ3V5CP7xWc+6sBzit0enAe ZN6fU5dW7dhZ/7DPsIds2VIuU0RHIvjXixgzb4t1Rq9hKYF+T2Vhx0cn3I58b56Agk PsfZj/kiuHQt6/FW8vaIMrtSKh01Lid770t0jCTT0b78It/lTbazJtWxExAqm6D6P6 5N/D+JlQhvgQEVWDcGjwufa7ykIwPmS24kV/EYbwg6iOAYbrjFJrxm2VXO/pcdfjwO WtgOLn+4JrME+7cgreOnj/hGcPZAjgKpJM3dc75eejotRd+3KrGY0ghp3N18yFBcH+ DdyEcF2qOnyQA== Received: by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1laC2l-004JfS-Tv; Sat, 24 Apr 2021 08:45:31 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , "Paul J. Murphy" , Daniele Alessandrelli , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH 36/78] media: i2c: imx334: use pm_runtime_resume_and_get() Date: Sat, 24 Apr 2021 08:44:46 +0200 Message-Id: <07cca2da63bfe905e3c4dc9c51945ead79c63572.1619191723.git.mchehab+huawei@kernel.org> 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/imx334.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/imx334.c b/drivers/media/i2c/imx334.c index 047aa7658d21..a5a03bb4a6ae 100644 --- a/drivers/media/i2c/imx334.c +++ b/drivers/media/i2c/imx334.c @@ -717,9 +717,9 @@ static int imx334_set_stream(struct v4l2_subdev *sd, int enable) } if (enable) { - ret = pm_runtime_get_sync(imx334->dev); + ret = pm_runtime_resume_and_get(imx334->dev); if (ret) - goto error_power_off; + goto error_unlock; ret = imx334_start_streaming(imx334); if (ret) @@ -737,6 +737,7 @@ static int imx334_set_stream(struct v4l2_subdev *sd, int enable) error_power_off: pm_runtime_put(imx334->dev); +error_unlock: mutex_unlock(&imx334->mutex); return ret; -- 2.30.2