From patchwork Wed Apr 28 14:51:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 12229045 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 15D04C43603 for ; Wed, 28 Apr 2021 14:54:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EB95C6143E for ; Wed, 28 Apr 2021 14:54:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240414AbhD1Oxw (ORCPT ); Wed, 28 Apr 2021 10:53:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:36324 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240283AbhD1Oxa (ORCPT ); Wed, 28 Apr 2021 10:53:30 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D8BEA61455; Wed, 28 Apr 2021 14:52:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619621564; bh=v0N3nXsqMajMGBVdnEBF4DR9l7FpjhgT+LyWaPFGjVY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Lgav0xx9qLJD809kGwduHIweCAI4kyiXZBtlMOR7b6LhS+8aCwOYkFJGkMfoF7v+Q AjRZ4gb9KUesndsx3yjJSug0jySNhwmgQ+YyzUeAEo18ELZwgLgBU6W0foVwSMUUH1 oMH2fdfOIlUEsN43n3X2l1gBlg+zDvVhjYQU1KEP8BO0eW2VqhN66dYD/0Oq4gXZLq nmRmXujydgjQw/ZeGPN8LvJlrOCDMzeCyUobLxkAo32giYjTcwrCJLNzlqrdZTwxqY PK0w2NVajkQjcT/X26f7Sgo/0F34OgVrjDuqF+huVNWA9pmq45XwidyJ9pJvbXiSRi bWZQhP/eVeijQ== Received: by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1lblYP-001Dpp-Me; Wed, 28 Apr 2021 16:52:41 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Akinobu Mita , Hans Verkuil , Matt Ranostay , Mauro Carvalho Chehab , Sakari Ailus , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v4 05/79] media: i2c: video-i2c: don't resume at remove time Date: Wed, 28 Apr 2021 16:51:26 +0200 Message-Id: <4af597b4d09d874308a23680cf3fed4a31a1674a.1619621413.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Calling pm_runtime_get_sync() at driver's removal time is not right, as this will resume PM runtime. This is clearly not what it is desired there, since it calls pm_runtime_set_suspended() afterwards. So, just remove pm runtime get/put logic from the device removal logic. Fixes: 69d2a734c5dc ("media: video-i2c: support runtime PM") Signed-off-by: Mauro Carvalho Chehab --- drivers/media/i2c/video-i2c.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/media/i2c/video-i2c.c b/drivers/media/i2c/video-i2c.c index 0465832a4090..c9a774f4c8d2 100644 --- a/drivers/media/i2c/video-i2c.c +++ b/drivers/media/i2c/video-i2c.c @@ -893,10 +893,8 @@ static int video_i2c_remove(struct i2c_client *client) { struct video_i2c_data *data = i2c_get_clientdata(client); - pm_runtime_get_sync(&client->dev); pm_runtime_disable(&client->dev); pm_runtime_set_suspended(&client->dev); - pm_runtime_put_noidle(&client->dev); if (data->chip->set_power) data->chip->set_power(data, false);