From patchwork Tue Sep 20 10:31:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jianqun Xu X-Patchwork-Id: 12981874 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 66203ECAAD8 for ; Tue, 20 Sep 2022 10:32:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=K7v61ALUKeebxl6RotDCkdq/9SM/U1eApETSbhqby3k=; b=i9cpSbRF5AMTca QrcrqoPlgS6DlGHANdsgku11L+QrY128esPfwM/jB8G3Znk+ZvMp4vtT3S2Y0F/h8xeKygkiMDULf VoYl9BhIi/psvTYzpIR+nQdeOokFHenCyfpJft8AR8DLlYs67LYO9XsAwDphPKbrOuCMBXa7cs4wD fyZ4KB+qeS4lB6kn828ZkbYFz5Xfynt5pjcdolnjahTfe052pNbiyu0M4oZXkA0w8kacDLuezeovT EVSBm3cSwM7oNCdjNPIJLPj3b7JQc/S38XbjT2ioD663RMM24T9B90xmZTbipzQofMlnSDFphYtqW eclvFZYZ0JEkAjF+O2UA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oaaXl-002ysM-OZ; Tue, 20 Sep 2022 10:31:57 +0000 Received: from mail-m11875.qiye.163.com ([115.236.118.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oaaXJ-002yNH-BC for linux-rockchip@lists.infradead.org; Tue, 20 Sep 2022 10:31:32 +0000 Received: from localhost.localdomain (unknown [58.22.7.114]) by mail-m11875.qiye.163.com (Hmail) with ESMTPA id 94EDC280BBE; Tue, 20 Sep 2022 18:31:19 +0800 (CST) From: Jianqun Xu To: linus.walleij@linaro.org, heiko@sntech.de, brgl@bgdev.pl, andriy.shevchenko@linux.intel.com Cc: robert.moore@intel.com, robh@kernel.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, lenb@kernel.org, rafael@kernel.org, Jianqun Xu Subject: [PATCH 13/20] gpio/rockchip: disable and put clocks when remove Date: Tue, 20 Sep 2022 18:31:01 +0800 Message-Id: <20220920103108.23074-14-jay.xu@rock-chips.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220920103108.23074-1-jay.xu@rock-chips.com> References: <20220920103108.23074-1-jay.xu@rock-chips.com> MIME-Version: 1.0 X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFJSktLSjdXWS1ZQUlXWQ8JGhUIEh9ZQVkZTxhMVh5OTktKT00aGU9KTFUTARMWGhIXJB QOD1lXWRgSC1lBWU5DVUlJVUxVSkpPWVdZFhoPEhUdFFlBWU9LSFVKSktPSEhVSktLVUtZBg++ X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6My46Ghw4Vj0fDBwMFwoMLx8d IR4KCTpVSlVKTU1ITU1CQ0NLTk1MVTMWGhIXVREaAlUDDjsJFBgQVhgTEgsIVRgUFkVZV1kSC1lB WU5DVUlJVUxVSkpPWVdZCAFZQUlLSUI3Bg++ X-HM-Tid: 0a835a73c4362eb1kusn94edc280bbe X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220920_033129_615577_0ECAD231 X-CRM114-Status: UNSURE ( 7.78 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org Match to the probe, do disable and put the clocks when module to remove. Signed-off-by: Jianqun Xu --- drivers/gpio/gpio-rockchip.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpio/gpio-rockchip.c b/drivers/gpio/gpio-rockchip.c index 511e93a6a429..1a800f972594 100644 --- a/drivers/gpio/gpio-rockchip.c +++ b/drivers/gpio/gpio-rockchip.c @@ -757,7 +757,10 @@ static int rockchip_gpio_remove(struct platform_device *pdev) { struct rockchip_pin_bank *bank = platform_get_drvdata(pdev); + clk_put(bank->clk); + clk_put(bank->db_clk); clk_disable_unprepare(bank->clk); + clk_disable_unprepare(bank->db_clk); gpiochip_remove(&bank->gpio_chip); return 0;