From patchwork Tue Aug 20 12:16:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rong Qianfeng X-Patchwork-Id: 13770054 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 CCC09C531DC for ; Tue, 20 Aug 2024 12:19:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding: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=XHP4teSQ5F5zOPyfclpHySQ9EVrCPdichgnicjDfqjg=; b=IRMJy9ps07ey9X4oubdRErexmq 2pmOdD5SvaNE848RBRdAQIRD3QmPx4l7I5lNdIax7PJrgY6zAhxoIg20FN9zJ6R6btEXKH86yDXxE hvVAA6J5BOXoWOm/hKkvdeCBIHAU+SRZtNCclugY7G0BBL/V+6Y+tfIocoFQYz8TSqyGukwoBTLXk aDOMIqVwqF1+IE8+YPc0UXMo0SR5GsnYqYxHCAo30I3BnPZRgoY3m7rBDBRALK7JBAJgm2joTr7kk SxI016SGKHuR2w5JVWzyIlCHznt613d4HEPTTlLTuq170sl8iTzRZoC6Rw3gs39r31rMKuX5BSZVB sJScsLLw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgNpH-00000005ACi-38F8; Tue, 20 Aug 2024 12:19:03 +0000 Received: from mail-psaapc01on2062c.outbound.protection.outlook.com ([2a01:111:f400:feae::62c] helo=APC01-PSA-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgNnw-000000059pF-29Sg for linux-arm-kernel@lists.infradead.org; Tue, 20 Aug 2024 12:17:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=EQycSoH6YiJ6kur2uZ/d/BZKiW6OuiiQkr0NON/N0h22EF4TP50/4RsRuUgriEs30gFsEkVBy3gsbrjTdvTSK1eT/oGG1GSzSwcw8lbB6ve1SlPpxO8k8JYScNaYTJ+Um/nKyHU0RW+Blm0Kf/H/f7vZWJbD7msgB8m2YIx5zQ6ZxE+/DpImkQ9k3NBX7Xl5vYXDzOgBph14EBAvezwRk1S+1Ywv6ViLuvuZxOyGGgZ7xLRGPnIVuvy0j0IY+BBlhEqyedgO282OctrpptQWX7h78r1YjjH3KUN7c3txzsYzlQYzaeB9jSKSm9/p2MRieJ1i/GZMZSxtbzqAJS6dHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=XHP4teSQ5F5zOPyfclpHySQ9EVrCPdichgnicjDfqjg=; b=LCmdrgu80VdKIs8EwU1AxAVM0bRpTVMWfH3OTEdS0klQLZhjv1IzTUEzYxL6ifVEkzo5WDTsl+6b3tryiV8c96In0LdRD1XCgkJzOeSvj09+ubB0bu9f0FibgJuo3xZOjeJNwjJge7J4mv1jyU982+D3KoBNzUCsNOrHBqs32e/SGPr/Z4vx5z/CtsMB0khROZFW4Wcp4aiTxYwondRmMH9hMLDZnMtRaaH8VjMcWbytplH1vvOmw/WFq6Jns50LfvV16RYHLXNeT6Ljb4YGL4jaGdrUoosnjNvwDwP1z988TS8gyyAPQ/3AYMMZoQ5e8f9rw97FxFUFaBmgGAV8hw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XHP4teSQ5F5zOPyfclpHySQ9EVrCPdichgnicjDfqjg=; b=eqawLTreUn6U+GpjSTbnOO+zJq0Z5V7x/hmzAp27agd/RHJ4NfzdxAT7C4SM57pdyPuIei8L0ozFqHHtM5jwYKEG1Sg6N+oDwz1HXX49z90jvDNOR4N/O/LTEFpBhTxzVSEgvozbXVRM4cducexTsDaRA2vzxQbjK2R7tVFCG4wTz3+yOsWj//0m5RR6tLai8TFZGqrjo3EOIylZa3dh9yJOHAhc+kHgOZpPj9WMMJz7v0lcC7R/IwgavXx+SI9JPJdHu3lhTp0caxz6OyyYLr5CaYsqpEOngEZduq3QgoMCN0SjkFnBOVxm3GPDj+y8YnmHzdbysLcsDCsLBPq8tQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SI2PR06MB5140.apcprd06.prod.outlook.com (2603:1096:4:1af::9) by SEZPR06MB6285.apcprd06.prod.outlook.com (2603:1096:101:130::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Tue, 20 Aug 2024 12:17:29 +0000 Received: from SI2PR06MB5140.apcprd06.prod.outlook.com ([fe80::468a:88be:bec:666]) by SI2PR06MB5140.apcprd06.prod.outlook.com ([fe80::468a:88be:bec:666%6]) with mapi id 15.20.7875.019; Tue, 20 Aug 2024 12:17:29 +0000 From: Rong Qianfeng To: Linus Walleij , Bartosz Golaszewski , Shubhrajyoti Datta , Srinivas Neeli , Michal Simek , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: opensource.kernel@vivo.com, Rong Qianfeng Subject: [PATCH v1 1/2] gpio: stp-xway: Simplify using devm_clk_get_enabled() Date: Tue, 20 Aug 2024 20:16:50 +0800 Message-Id: <20240820121651.29706-2-rongqianfeng@vivo.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20240820121651.29706-1-rongqianfeng@vivo.com> References: <20240820121651.29706-1-rongqianfeng@vivo.com> X-ClientProxiedBy: TYCP301CA0063.JPNP301.PROD.OUTLOOK.COM (2603:1096:405:7d::8) To SI2PR06MB5140.apcprd06.prod.outlook.com (2603:1096:4:1af::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SI2PR06MB5140:EE_|SEZPR06MB6285:EE_ X-MS-Office365-Filtering-Correlation-Id: 3d53f3f8-dc2c-48cd-f901-08dcc1120fa4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|52116014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: ZpuIU0b9WyTkZiZw016IXml+uKjvuz3jymAgRjtZCUjhTClcX2aiCJWUOROMl6G31O6tw1kyrdJqMwiSp+nsXw3ZnY2SK9SWFm1FnGYZGsAfcg+kMvDdULG/ORkp+y0ExXtlMj3oLo/6Vlvk/WWmsriXiB9MIwEMZ6JlfVSfXa3SvZCXEH7RrVy4RtfORbb3crbdslmt8cKP3j8w34qlN1s0Pf/PVmLQftKYO2Y9b5XXSg/R9dpJBlkkvgVgmaMwvMbiEibZRSRiPfpP0S4fCDgYGUvt3E5X5C4pTmB1sublBn9q4VagzZ7VK9jjHDISuGL8cRDI9phDRfrNAxBiKCnsamF8Am/BWVdwKpLtf6muiUq2EId2di/hMJePa4fbAOrDE+gMPYJMVzrUGR6w+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NSPM;H:SI2PR06MB5140.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(52116014)(1800799024)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: hlF9GTvuGal0K4ITNFcZnFrPkXaMHBrhAmKe9TAeCkytrR06NYljWJ4dk1BoybmD5XbSMsLiXBI3gMLOQ9vlofzvM2/QNu8BFlhnZwOrVUWDYTka0B7YDBuA5WGIDeQ3dU3/NfA8nbyQpe8MBpCeyYPgeBDGaBQv84wg1TRxzhyPOB9uheZX2iIyzfUZ67bt/GMj+9WVwtu1CB05WF2TDzGACCxIn4elb+cbR9K9238MyDIAakWRuHQ9rI9lAcELYPHyO1EM9knW29zrGY059WY8FcBqZXEuRSSq214vCAuBNFCRgu4oIZmpI92ynCdS8kMGCWUX04pXNDk5jA+dB1/V0YM4NTWOQ+mkTGm9c/gycHeJhRL/xO3tYkmf/sMXqmujo/iR6jv4eB7run8GlVftQmbKMyYDapI0tNl3HyD5e2bydjI1piEmEpQZpjfwq8nRsowYbOs0ZhWMF3yHdpPRX5oar7Kyl7JLdGs7TyOCFY+GBkJ0NzUv/2bIXC359SIhyvspZRhmlTrbdqDcJMN1dfDaPbaHuSFuxXPhyajBe9UDgK/hgckFOA6CLEPm9NcAQjnDrPOR56puoTJV9hEyXg+cw9zFi9G72RM3tTlgxsiTuAwV5gpnn/KxAHyAxu1YoCoxuuPp+Ns7CJH/94iuU1xvi49McB85AeLMddp8CzxWCAhag8ZG6ZkSYlFVRFwUBcbo8QsqGK/5ejyunveOW2BaK7kkwoRGnQs9dQmJ6PSbechOuWBGI3EXFqz9oinajMGCUuIbf9Kb13sG6ca4omVt0zZH/ysa6V3be1ZHHoS5PWkSAAh/az737pNNzZr/p1DAGEkS83hy/ubaHMjwMUT6X9yId90AVYxCqAjgxVgO1F43cGdD/K87BBssQvoJcM2LggPGmAN12Vxb7+UQvrqXzbekMRNJmM5ISgmjdJhAJcIRgRahzsiGlKJv3B7oIgNS4M78NUJDlnWj82ljbuzRDaqzu9jwpt7KRAELHqxidmQSZTZemGzrztHVnp9zqc2//jEzcYTYgkIYr/7hGal40lTQzG22lddw9DYmH96Qhs7j854IkxF3iOWGlO99AlMFBmEpegStGnKZ9jO4yzbuT2IItHZsOmYQZMSdhr6rctFGHQz1gbf2xIw546p4TpVq/WKRob2DA1lytezJlb6OoP2vWhIdodweCqwByoC/tOxk1wdhtMqAzZG9UiKrP/KZ/S2XUrfFWOX3koGNLMtdvDDK7AirKeUiIjTZ8ZEZyKihQiiTMWXfMQ8b1v16saOg3fUW4EhmqT9mvidXeBf66xkZ2mGEtt6bgkyZjECx5KzMFCo12m5QkoX/M+GV9vTM6ptamdBkWZ8w39R+3i+D7knW0ejjaRtGo7duKDJOyhN/S01vVDa2Q8bshXj+A7ktZJgbfRFPQZ2/RtQLC2V3sm9k6tiTu6Fiz3Fztp5yf6Ji1R3cgWPa2H2jsPtuHUJTNYBa++OKTDgwE2AlNsZH3Jj/t1kaQZR4sP8pSw231O5C0ZVH6hbngSFqzWEYurJficsWTADTvI7ajQwAyH8S0qM6LPx1QafEQ6jsqLsptUu0mooCNM3KQ7ks X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3d53f3f8-dc2c-48cd-f901-08dcc1120fa4 X-MS-Exchange-CrossTenant-AuthSource: SI2PR06MB5140.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Aug 2024 12:17:29.7749 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: RKdlKf3iJdYFiRCh2XaCH7e85hMIflcD7OcAIoWdeAHPsQW381gm9I7N291TpMv2knMqNGUGl0WdRHlVL4exOQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR06MB6285 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240820_051740_577801_C81A469E X-CRM114-Status: GOOD ( 10.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use devm_clk_get_enabled() simplify xway_stp_probe(). Signed-off-by: Rong Qianfeng --- drivers/gpio/gpio-stp-xway.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/gpio/gpio-stp-xway.c b/drivers/gpio/gpio-stp-xway.c index 053d616f2e02..5a6406d1f03a 100644 --- a/drivers/gpio/gpio-stp-xway.c +++ b/drivers/gpio/gpio-stp-xway.c @@ -296,23 +296,17 @@ static int xway_stp_probe(struct platform_device *pdev) if (!of_property_read_bool(pdev->dev.of_node, "lantiq,rising")) chip->edge = XWAY_STP_FALLING; - clk = devm_clk_get(&pdev->dev, NULL); + clk = devm_clk_get_enabled(&pdev->dev, NULL); if (IS_ERR(clk)) { dev_err(&pdev->dev, "Failed to get clock\n"); return PTR_ERR(clk); } - ret = clk_prepare_enable(clk); - if (ret) - return ret; - xway_stp_hw_init(chip); ret = devm_gpiochip_add_data(&pdev->dev, &chip->gc, chip); - if (ret) { - clk_disable_unprepare(clk); + if (ret) return ret; - } dev_info(&pdev->dev, "Init done\n"); From patchwork Tue Aug 20 12:16:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rong Qianfeng X-Patchwork-Id: 13770055 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 3BF9FC3DA4A for ; Tue, 20 Aug 2024 12:19:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding: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=W0rBOixmHhBRzgZtRhFnHD9FtysGBoIxatHpLsF4YD4=; b=jwk1U9ChARaQ/+XS2EXtnlbMwM hi+Ewd+IgSl33Siqk0u0wBorCMoatLGzvznoXdfRggrKbtleMTSDEVZb0ctSlM4EOBlU4QknqwDC5 6e46Z12dStM1m7pAmgDXPax6KGHxEIiphhwpt16JE3dRjV2a1+Gtk5vhCkVDL+jSdo1xCEyfAZ1qp yq0aB9lNyPANvyVJ5CSexMy0rnIoWAh8ISvHBCP66oOGM+6kFqfvrY+a1jKXmfLGXNwOkXDSvLPib DzhcJE7b7pdG4mblpgmOQ5CzYVCNL352I0ZlJ/UYw93drArdRxVzyzLvl8ZyTq+UWtNmc1n68I1av a2vlKUeQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgNpx-00000005AQI-2if6; Tue, 20 Aug 2024 12:19:45 +0000 Received: from mail-psaapc01on2062c.outbound.protection.outlook.com ([2a01:111:f400:feae::62c] helo=APC01-PSA-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgNny-000000059pF-0sD0 for linux-arm-kernel@lists.infradead.org; Tue, 20 Aug 2024 12:17:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=BsAhsAKBWD0uu9npFSJuY6POnjXOAQOWeC9rZgPUUlBWhqyHw0rICgt3qWevaVRDT0+9L85hvZgTs/XoWWsalAD2GwHvttNA0u1l3nT40EWnMLKGloyI3mKa53+C4Gc7hU65omigW9MDkBpOP98MmE54+L0f++SPl62BScIEhI4M/qg8npW2JNoBhpdJPD8L2BJLPCyJklUOPl3zD5suUwin524QWaDLz6xaWEeOFzwCITBwaz6I5HD9TvjnnmHY49kLrSJc78edVB9wOwcnT1nq9/NjM6YkH/jLQB4DfjMsDc/PLEB7UL0mkpklNB35c0HCVcpO5jm+IorXGaC0hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=W0rBOixmHhBRzgZtRhFnHD9FtysGBoIxatHpLsF4YD4=; b=oPY1OWJAhMmKCqYRIkW6SDlhulZA0Oe9ZNUY51tUF2jLuJRQJrrV1IVOavVSwoYv8O9YRgke6juyyq+lNMUTidXhquzJYJQuQ8bhi1vR/HB8LmwTYKGpJ33d5WH4+Q8reOrx4yz+UDbswQqlkjkUz/rrXhnQhyzywe4efcRefp/AVOhH2PxrQK6CyerAP3RP1psdockhoOWRHSeTTI74LF517ZLOUlueaahnBjR6yFbnyDp9dPlT34ylWpyvKCgBWlsYaXV43q1+g26jM58yQp7f/K0FW2hf7Jbb2OnLvxzyOfVRMJEnvj/RRTUv2KBwmx84zKSVfQnHd2i3ApJSLQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=W0rBOixmHhBRzgZtRhFnHD9FtysGBoIxatHpLsF4YD4=; b=on0gT67kGoUgYvtAYyevzyH4VaS9d+xO1y5/Mw/q8cYH6OdSZywi0RR68lClu93VclqrPndCLwUMWE7jnqRlKMUnxrqTD7sDYO4huCv0MigPo1Vd3SiiVrwU4enKwoupxJuy+x5yEH1lj14XTeMkgKnpRtpNJ3mgNhJW0SsEmxIawhHr9xcDKxVGqS0wchfxVeD6vF7x7XFpwMHaLAmn9DcAMVcOiemYMH6WJ57BPlBhMzSbNiZn//OU9sr6IBHJtGHF6YpBG7OxO0yrJ2l6TD6eFPUDcJ5clJT7XELmEkx9jwEoXvgWWUI2lFY4njflZOQv9tncQETF+UGRFQYzqw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SI2PR06MB5140.apcprd06.prod.outlook.com (2603:1096:4:1af::9) by SEZPR06MB6285.apcprd06.prod.outlook.com (2603:1096:101:130::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Tue, 20 Aug 2024 12:17:34 +0000 Received: from SI2PR06MB5140.apcprd06.prod.outlook.com ([fe80::468a:88be:bec:666]) by SI2PR06MB5140.apcprd06.prod.outlook.com ([fe80::468a:88be:bec:666%6]) with mapi id 15.20.7875.019; Tue, 20 Aug 2024 12:17:34 +0000 From: Rong Qianfeng To: Linus Walleij , Bartosz Golaszewski , Shubhrajyoti Datta , Srinivas Neeli , Michal Simek , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: opensource.kernel@vivo.com, Rong Qianfeng Subject: [PATCH v1 2/2] gpio: zynq: Simplify using devm_clk_get_enabled() Date: Tue, 20 Aug 2024 20:16:51 +0800 Message-Id: <20240820121651.29706-3-rongqianfeng@vivo.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20240820121651.29706-1-rongqianfeng@vivo.com> References: <20240820121651.29706-1-rongqianfeng@vivo.com> X-ClientProxiedBy: TYCP301CA0063.JPNP301.PROD.OUTLOOK.COM (2603:1096:405:7d::8) To SI2PR06MB5140.apcprd06.prod.outlook.com (2603:1096:4:1af::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SI2PR06MB5140:EE_|SEZPR06MB6285:EE_ X-MS-Office365-Filtering-Correlation-Id: d4d06f54-b4ab-46fb-46b9-08dcc1121255 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|52116014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: JU71w8VHQXHznrz2XdYpyPoHzMeGhNo26jf5GtWXmv5OcqoQbGX5Ldt/mrccOxM3si4utr3ieTTea8HIUXpmY9Ha5/223HPRp82CkSNkogcJmwIGL3AmlidkFSEBsnGWfNmIH5qVh+cxsxaN36/rIsm8TZuaYbw30bofAO74Dt58W6BxVTibveIe71W8iPgCeTqSYD/U5j3m9R8yad9snHJDVQk486fDSt/LGE3PttYYAQeYJ6i5KOYBkNWFO/q+yAgK9wrQrE8v3FPSXGVKDvTarnbJIpXs2Ijfd/ei//yeNqPduxCS/XMw6mf1PvpCbRORg8e0yQcvtqVlEFVLf8o6lIuCh84/HRHrIliwVS8wsPyIx21ig2a14ewCwUJ4RgBH39+BnarbQB9OM3yvPSeoeTF7y6UX/vkkVoPTHxZXKkjYfltLn6kC6wIzzj1iv0gT3jbphnFSjbLDMjLwi8/cQ/Vq/wnAtmOiacycxL3X9A0RmKSW0nCCJo4XnJxcuwQDk784O/bnzPhYLFGM8f2RJlCcEwu8RaQQXfpP3d5GEo88eUj9pjftKELExiwt/2k92xPyCuFPDJy6v/sTd6ktcpfYo16xORzc7ElcD/NXAkkTn+oLrxoU5apbBhAufYuUXH7L+E0FKmASe/pylgk+5y2OjbiikEGql7IhdBKjW9EqD3Rnrtx7OY5VIevt2IV6lw5WEqHLiY/bQLSde5VCZcXWIhPRZ6+r3qn7cQBY+CfgwE8veBoGQxJxpTx8ye2QXPzPWZrRHDDMQ6SCo/4eqmFm5vh0BD/woKz/9+CAyXLBnXityzPEmgraV6P2bLlBKHSRcQWTqQoARBsY6BVMv+OgxhrFpg+htqayGiw3IG+5Hj8VMoMOxR0ZMnGK2U5LTqkYijKnRndVAtiiN1JtXrvR6WTlWQR0a6sxfRdfhFbwJHXftDqn9ouz8GYkur38SsOICrpoGpTcuv+YnanVofsTjjb5lpjq/a3H1PDR3ehsx+HYWJgYaFw0r80DsjiRpPaimPtoNqR7iMleuEmpsDv/Drw59wR8C1YjS1EiXTB7aMprknHWwEUx/62OKtCnmb8mTVtans2QD0jvwEqIHi+6zPJixyxz3EtuR/KI+PWcpRGE/D3c+23ndeVUs/bIaAw5/8KIFHhOeZyZHOp+ONqoouIpgaRreKv33k9nXxttGjN/U/NDKhtRxHvKOFZbO6Dkj0Jk4P1J2H9DAl39rXc2jlW+YMRPuxMtR2EL2VcdsBn5U3VNO6sd+HfVyyoQuviAHVwzBtqP3PjQ8GPfQhxAM+kRWx/IRkvaj4O6uKXJYQAB91ElhQ+5bnuFzCazYWIjiDFcm8Blld7+c2aDjv/AWVVYZRJidmh77kHM1P58UeIN3Pj+o89K2D77kXa/cJ2IkkbpftRvBtoN2g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SI2PR06MB5140.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(52116014)(1800799024)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: GkdLRLaMdI93ZrA3O48C+lvd6zT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LOi/3s9hxNoJKz8RJp7Pmf0y1RL1bD8kf/muzsgXBl6rgi7/7npJaJOBzO9Vyjtsqqo+1Xus0hD4koGpgfWR6brtZFGSE5pOP/EbnxiinTXHTeITPh2Vuzgpe7SiWKSIQLfKo9gccyAGdNkFIFp0vpxkpmAFjvVHP4aKeiZ5t0wVoOqm8bWTehRN99gySOvz0hmgSW0U0NRceJSlA83dudUWxqyKS3UW8AO/jtskDfUiUFp5Z6IiAHXQNPs7a6HJgs3U/LB/ZiPSLJnAj+7Pu3ECCfN0y9BYYB3g58fERzw8H/3x4CxVmRDeh41oJ92yf8WZg/3KpOb1eP5Tj8+5Q0XpNAO/l/X29xmlZsKL1ZoHUSjB9t0cff2rlKHya89BCfa+vccq4TzZKnsBsaVdaHH2y02HLf5Nz7+YbZdpAJqDSZLMEnLnaAGH5ti0YUSlP0zMT9ItUOpcAS8iW0HJUpR4G/tdSWlUKjX2O X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: d4d06f54-b4ab-46fb-46b9-08dcc1121255 X-MS-Exchange-CrossTenant-AuthSource: SI2PR06MB5140.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Aug 2024 12:17:34.2469 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: bg3GwGnrVVPJqqcBA2jyfxntuoq1S8B7b9P990ZdJD2QKwKpZ6jsiPA/VNUtUfWWzU28t3iS5aq6GnI8QzG+6A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR06MB6285 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240820_051742_281125_94293D3E X-CRM114-Status: GOOD ( 10.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use devm_clk_get_enabled() simplify zynq_gpio_probe() and zynq_gpio_remove(). Signed-off-by: Rong Qianfeng Acked-by: Michal Simek --- drivers/gpio/gpio-zynq.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/gpio/gpio-zynq.c b/drivers/gpio/gpio-zynq.c index 466e23031afc..1a42336dfc1d 100644 --- a/drivers/gpio/gpio-zynq.c +++ b/drivers/gpio/gpio-zynq.c @@ -940,16 +940,10 @@ static int zynq_gpio_probe(struct platform_device *pdev) chip->ngpio = gpio->p_data->ngpio; /* Retrieve GPIO clock */ - gpio->clk = devm_clk_get(&pdev->dev, NULL); + gpio->clk = devm_clk_get_enabled(&pdev->dev, NULL); if (IS_ERR(gpio->clk)) return dev_err_probe(&pdev->dev, PTR_ERR(gpio->clk), "input clock not found.\n"); - ret = clk_prepare_enable(gpio->clk); - if (ret) { - dev_err(&pdev->dev, "Unable to enable clock.\n"); - return ret; - } - spin_lock_init(&gpio->dirlock); pm_runtime_set_active(&pdev->dev); @@ -999,7 +993,6 @@ static int zynq_gpio_probe(struct platform_device *pdev) pm_runtime_put(&pdev->dev); err_pm_dis: pm_runtime_disable(&pdev->dev); - clk_disable_unprepare(gpio->clk); return ret; } @@ -1019,7 +1012,6 @@ static void zynq_gpio_remove(struct platform_device *pdev) if (ret < 0) dev_warn(&pdev->dev, "pm_runtime_get_sync() Failed\n"); gpiochip_remove(&gpio->chip); - clk_disable_unprepare(gpio->clk); device_set_wakeup_capable(&pdev->dev, 0); pm_runtime_disable(&pdev->dev); }