From mboxrd@z Thu Jan 1 00:00:00 1970 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 1FDE1C43611 for ; Wed, 28 Apr 2021 14:54:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E382C61443 for ; Wed, 28 Apr 2021 14:54:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240505AbhD1OyR (ORCPT ); Wed, 28 Apr 2021 10:54:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:36302 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240279AbhD1Oxa (ORCPT ); Wed, 28 Apr 2021 10:53:30 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D03B761442; 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=5AHhx16DJL5gdJqgumKoh72s5QcxkeHszhw8tqlTmq0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mhIeM/Yz3mJe7BR5xUid6vqhmDHSt9Pvbf/oBwQB6skiBZoDlvk3pf+g554ozb945 7HDDOZt4F2I1s/J70C7PXLft8vbDso6Ktloe3oyC/8DumtexbzuZzrgjghZlXJXGAo V1HMQyJGbOSpwkWGq8HTWHKj+BEb7kNKBBII9FexwcCa+8RO+3SWfaMGqDGPSlW3Yf 4TGFpeAeohizyZ64mtY93qmky7iAdNdFYYA8kJlBI4tMZ/lfRrFz2Qc3bwERjuQKlD O1Q51AES5wc31lTrrJxuBPxr5f9fyiTUDp3oLOf90kvrx5ng5HoAXhqBefPKm4zRpw KkSVMEQ/3MRSA== Received: by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1lblYP-001Dpl-Lg; Wed, 28 Apr 2021 16:52:41 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Mauro Carvalho Chehab , Sakari Ailus , Songjun Wu , Wenyou Yang , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v4 04/79] media: i2c: ov7740: don't resume at remove time Date: Wed, 28 Apr 2021 16:51:25 +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 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: 39c5c4471b8d ("media: i2c: Add the ov7740 image sensor driver") Signed-off-by: Mauro Carvalho Chehab --- drivers/media/i2c/ov7740.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/media/i2c/ov7740.c b/drivers/media/i2c/ov7740.c index 47a9003d29d6..ed6904b2e8f5 100644 --- a/drivers/media/i2c/ov7740.c +++ b/drivers/media/i2c/ov7740.c @@ -1165,10 +1165,8 @@ static int ov7740_remove(struct i2c_client *client) v4l2_async_unregister_subdev(sd); ov7740_free_controls(ov7740); - pm_runtime_get_sync(&client->dev); pm_runtime_disable(&client->dev); pm_runtime_set_suspended(&client->dev); - pm_runtime_put_noidle(&client->dev); ov7740_set_power(ov7740, 0); return 0; -- 2.30.2