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: 820751 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2086.outbound.protection.outlook.com [40.107.215.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5937A18A6BC; Tue, 20 Aug 2024 12:17:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.215.86 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724156255; cv=fail; b=VDvQ8DVjp/60Rg7JBJlQQ99KtBs9VUlbv04aESQduQPc+LPUk4JZ0kwCCLiWcXupVq+LmbQuuLF7ynP+//igDmknwwkFZILLKKyIuZDmvoNHh3YNAgWCUYGQvSX7DzqbIwIaFRbJZIK+CzEYRFlXQagIC3LcrH7tGb48hUVT9mo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724156255; c=relaxed/simple; bh=xtYHtnW3Cvus2ZUNj/ZD73lscSyH0t3YKJzXTCzOjBU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=IKRJSnkl191ylqcfaq8N2pdA027jcjgpoW4+YyXjRcj8jg89YanJvY8KM7k/nFvbJNmNm5VsKX6Chm2jgwxOfdg+5A7FmG92ap5u60GA4ASz7b+lri+NBqAeqnmBE43M0+WLtj2qPVWxfDVUOu+BrDk5FMKYTbis13qMQfNZ5vY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vivo.com; spf=pass smtp.mailfrom=vivo.com; dkim=pass (2048-bit key) header.d=vivo.com header.i=@vivo.com header.b=eqawLTre; arc=fail smtp.client-ip=40.107.215.86 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vivo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=vivo.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=vivo.com header.i=@vivo.com header.b="eqawLTre" 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) Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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+gMP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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: 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 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: 822857 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2077.outbound.protection.outlook.com [40.107.117.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2610818FDD7; Tue, 20 Aug 2024 12:17:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.117.77 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724156258; cv=fail; b=nixCx1SEjxbcd6W4uMdbgRF9dDZsAeaeO5oDjhL6cVqay+oieJ4Ar7jRwkdUhNauk4M1eNxGZgoQJsIdSh8CDyc/jF1dv8jhY+nfHSK05Yh9lsAq9sgpXtU05vKxK8ZS4+fYW7cEhIsfr5WgK4mK7SQGqLXVYkfWZUURG11H/5o= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724156258; c=relaxed/simple; bh=sm5olNZevsVl6BzIz8ApFjJv2uI9qOZ3rXqb2n8N7w4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=hhW/Go+tjYu16eN6YZK2hUGpoYUFpNHTKhytf/auZyA+r7OvfJKHfw9lDtf8A88hTzkqIZpQuXEUzO6m6DgMsERY7MkcExd5VI0OwOMtuEiFxozN9sObY3RPaHpot6nJ2eahv+qV044hY966TOUBiK38Tm68SBUFeMRPQG5E2gg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vivo.com; spf=pass smtp.mailfrom=vivo.com; dkim=pass (2048-bit key) header.d=vivo.com header.i=@vivo.com header.b=on0gT67k; arc=fail smtp.client-ip=40.107.117.77 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vivo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=vivo.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=vivo.com header.i=@vivo.com header.b="on0gT67k" 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) Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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+lvd6zTxV/voEXTf69U4y0MuB3hkh/k3D7g3eVEizvjpN794N95Omxgf+1VZYVZKfNzZ8VyS5/ga1C9isIK4ZWqzZQFdMQSidsdLgmAI8MAx4YPwWA/V2FqlIRy2xSaDhJaNfWCxiG/mbErr+o+MeGK43InHKuakxm7k4c3K9e783zP7qeV6BbpNJDB8tOJaRmFdqM3LiFDLtyxP/0kACoOWc4eoWA4xFuQ/M8ECIFD7MPB8rcRJPya6GIy6fg4Ac1rVZRf1T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Jgs3U/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 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); }