From patchwork Sun Mar 12 16:15:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 68399 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp797914wrd; Sun, 12 Mar 2023 10:00:32 -0700 (PDT) X-Google-Smtp-Source: AK7set96vWuRm1zTFAd9ya7Bzo1wT47UEWKWHBiiAmNctIC8p1n8p6hREucTr7htpv/kNy9fHDSH X-Received: by 2002:a17:90a:c089:b0:23c:fdb9:b528 with SMTP id o9-20020a17090ac08900b0023cfdb9b528mr1379021pjs.27.1678640432562; Sun, 12 Mar 2023 10:00:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678640432; cv=none; d=google.com; s=arc-20160816; b=lgY7HCtmU8PZ6FSF6xYqpKhpNtuWWfxsxcxlNI7orRQXsB/gYt/tGmhsN5I4mMId4k KZXXrku+F+zT0jg7Z9d1JX98WNzfUkqZc4LKPlwOFb05wKxwRjI6apQal1lF47NPKGyS 7MJZImpE+lqxiHhBxZM+AmaG07840RDgeZGle4HC8onoE0T7cgrrXGtFDcapMeB1XzEI bDz1AIkAKO52pEc0/Ho5WAY/XYoImgA4fnJF5AKjAXMzV/EHlH2W4H0/B2VEPicZrvMT BtPwqTFqbDJIAstAKLTPa9GTAgYxgHgp0cmXYbf+ytuUuYI0JINzBZiRRvTndXSf9QGJ KNfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=i9fiZ9v84r8fbuLW7di7da4ZPqCHWXDxwIjJ0Ueth2I=; b=sJHgBb00rInxWxqbD8wQJvRmjnvIyal/Og8gwV1xKCyVkiv8BJtDE3p2joUCxn/66M xbPGIa252Or3Ttn+gABuhPI4IrowuYdG3bze1LdRxVyiEPyKD0GIGWTll3V7lMSaGVP7 VJFVBNFvJ8C75b0wXsEkx/TttzRhGUMSQhOHBiC2+xDZVOgK9s+V1FhWsO8Lo6kBXYOj VQjJJTz9LgCFQoK0fgJZQUxrTHMWmrnIV/Yq763StcVqyYA46D+YJk2ET+kXPU+J+PGg TtM3ScqohE5DTCEUOVeoNTXY+DxxeaaCr6dn3dHs8VZcCDa4I7+G4AF6RGwUFra0lFIe 3vZA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q44-20020a17090a17af00b00230cb79e2b3si4351585pja.104.2023.03.12.10.00.19; Sun, 12 Mar 2023 10:00:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229819AbjCLQQn (ORCPT + 99 others); Sun, 12 Mar 2023 12:16:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230176AbjCLQPg (ORCPT ); Sun, 12 Mar 2023 12:15:36 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 179A537F25 for ; Sun, 12 Mar 2023 09:15:34 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pbOM2-0007sv-AH; Sun, 12 Mar 2023 17:15:26 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pbOM1-003f3l-Lj; Sun, 12 Mar 2023 17:15:25 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pbOM0-004K9s-OY; Sun, 12 Mar 2023 17:15:24 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Michael Turquette , Stephen Boyd , Michal Simek Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 30/30] clk: xilinx: Convert to platform remove callback returning void Date: Sun, 12 Mar 2023 17:15:12 +0100 Message-Id: <20230312161512.2715500-31-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230312161512.2715500-1-u.kleine-koenig@pengutronix.de> References: <20230312161512.2715500-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2836; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=/rDzIBzAtm47A0FxuDgmfod8dN7hBzvdh87gyR+Fj/4=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkDfqMeEK/Vobkf/pVhqxwG+ebhdSRP3oQMNj38 1vbndIn9E6JATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZA36jAAKCRDB/BR4rcrs CXpUCACNQrNswFWo36ck3lJDYrbCZWoN+NTLA8bb7Lnp5R518DWanFyN7Ob2xVR+cm7JbRBnUt6 +SHI2YkPMJhU4kyoqmKi6++mJNF4H+si9Za3s4K4b2Rc2QFf3dIPuXnJB7kBXdJ8f59WNcREX6Z bEnw7wr5DPw6HlsXs2nbPV7KfDYOQ8m9mygkhVfzBN4XFg1FDtP0WQUtJ8MkiY8I0bF5DpcR/Yl JJVrDMs3A5o2hV06M++8YQQgv7f0DY6F0yU8HMBDkT8+edEXBokTBP8btq11qqmd3cNLifEGvjz 7Z+UysCJaWNU0ym20N6wgFHIY+/7sNcT9HfT2+lEc05uAU8l X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760182069984166400?= X-GMAIL-MSGID: =?utf-8?q?1760182069984166400?= The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/clk/xilinx/clk-xlnx-clock-wizard.c | 6 ++---- drivers/clk/xilinx/xlnx_vcu.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/clk/xilinx/clk-xlnx-clock-wizard.c b/drivers/clk/xilinx/clk-xlnx-clock-wizard.c index eb1dfe7ecc1b..fa829c01a444 100644 --- a/drivers/clk/xilinx/clk-xlnx-clock-wizard.c +++ b/drivers/clk/xilinx/clk-xlnx-clock-wizard.c @@ -593,7 +593,7 @@ static int clk_wzrd_probe(struct platform_device *pdev) return ret; } -static int clk_wzrd_remove(struct platform_device *pdev) +static void clk_wzrd_remove(struct platform_device *pdev) { int i; struct clk_wzrd *clk_wzrd = platform_get_drvdata(pdev); @@ -611,8 +611,6 @@ static int clk_wzrd_remove(struct platform_device *pdev) } clk_disable_unprepare(clk_wzrd->axi_clk); - - return 0; } static const struct of_device_id clk_wzrd_ids[] = { @@ -630,7 +628,7 @@ static struct platform_driver clk_wzrd_driver = { .pm = &clk_wzrd_dev_pm_ops, }, .probe = clk_wzrd_probe, - .remove = clk_wzrd_remove, + .remove_new = clk_wzrd_remove, }; module_platform_driver(clk_wzrd_driver); diff --git a/drivers/clk/xilinx/xlnx_vcu.c b/drivers/clk/xilinx/xlnx_vcu.c index 54b44debfd3e..0786f15ebbe8 100644 --- a/drivers/clk/xilinx/xlnx_vcu.c +++ b/drivers/clk/xilinx/xlnx_vcu.c @@ -702,7 +702,7 @@ static int xvcu_probe(struct platform_device *pdev) * Return: Returns 0 on success * Negative error code otherwise */ -static int xvcu_remove(struct platform_device *pdev) +static void xvcu_remove(struct platform_device *pdev) { struct xvcu_device *xvcu; @@ -714,8 +714,6 @@ static int xvcu_remove(struct platform_device *pdev) regmap_write(xvcu->logicore_reg_ba, VCU_GASKET_INIT, 0); clk_disable_unprepare(xvcu->aclk); - - return 0; } static const struct of_device_id xvcu_of_id_table[] = { @@ -731,7 +729,7 @@ static struct platform_driver xvcu_driver = { .of_match_table = xvcu_of_id_table, }, .probe = xvcu_probe, - .remove = xvcu_remove, + .remove_new = xvcu_remove, }; module_platform_driver(xvcu_driver);