Message ID | 20230312161512.2715500-28-u.kleine-koenig@pengutronix.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp789107wrd; Sun, 12 Mar 2023 09:34:53 -0700 (PDT) X-Google-Smtp-Source: AK7set9W0mU7LZbZkQ1E5axqr4ckG+AUZ6hYfmOANNnt9aGkyymJEtCXfjChPuNkQfwj6DOsv8id X-Received: by 2002:a62:1a48:0:b0:623:2557:d914 with SMTP id a69-20020a621a48000000b006232557d914mr2861417pfa.24.1678638893559; Sun, 12 Mar 2023 09:34:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678638893; cv=none; d=google.com; s=arc-20160816; b=jlmNuBiSu6HcL9CW1n+5GY+Ues0qr/BvI2v5T7WlD9AAyjhPWhLXGcprDkB++DwPoh 5ewnZ57oVbJdF600Eqv2Ea7GO1dKsOB9+X7nJLivjkEXtRtM8aHJZYlkf6wHckUBOzAs B7V3zNFdNhFiq8Q0C9BsodEYayMpl67eagymyMA3G1oWzHWrfLVp/sDcahlIuTNKGDJ9 BA+1Ri2fuiNTTmwvhG9nMchk85zlbK9Lpol9Yh/XIGWud0CA4i2GbNdH2nRoXhQHkQA7 zgoMiPRKczg6Fk/bRrtA0AxMebAQ32YecXMtHfM7NlZb50lSiBIu0vt+e7bvi3YRSsY5 ObaA== 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=Ha4NvjnMLWl1+EUXVfeqaVe85BnljgSTDagvMhI6kVg=; b=W2sosDgvuJx+H0bUmxdS94/zyk0seDKifPXcJLE0oPRcRYsweHh953uJbgtBWeLo6v flqqZXqt2UzuLKuGu7mR2Z0tHAjDYFPRFFnYkST83hH2l0QontzQK0a4Y6GkmIY8VXGu 4n+imPbKYe1qv4xSfHRx5je4X70O2lVFsBVtsb2hgMHd0Vf88wl2jAlxIlFXnYK41wvr MX6x0FoLGxKts81bwtx4nUJX55YRnicutA/8SbvDbcKPVjrDTKPaMawSYcNforklkY0Z +jxQUiEhIyLgHj65ztSajmb1GggMuTuDAzKKWalqkUDt0A072PXU45xE1O0QNkI0EbTf 3v0w== 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 v20-20020a634654000000b004e22265da03si3557035pgk.652.2023.03.12.09.34.27; Sun, 12 Mar 2023 09:34:53 -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 S230238AbjCLQRA (ORCPT <rfc822;realc9580@gmail.com> + 99 others); Sun, 12 Mar 2023 12:17:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230237AbjCLQPv (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 12 Mar 2023 12:15:51 -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 217A9367C4 for <linux-kernel@vger.kernel.org>; Sun, 12 Mar 2023 09:15:37 -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 <ukl@pengutronix.de>) id 1pbOM1-0007sf-Uk; Sun, 12 Mar 2023 17:15:25 +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 <ukl@pengutronix.de>) id 1pbOM1-003f3d-Bl; 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 <ukl@pengutronix.de>) id 1pbOM0-004K9h-4q; Sun, 12 Mar 2023 17:15:24 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de> To: Tero Kristo <kristo@kernel.org>, Michael Turquette <mturquette@baylibre.com>, Stephen Boyd <sboyd@kernel.org> Cc: linux-omap@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 27/30] clk: ti: Convert to platform remove callback returning void Date: Sun, 12 Mar 2023 17:15:09 +0100 Message-Id: <20230312161512.2715500-28-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 Content-Type: text/plain; charset=UTF-8 X-Developer-Signature: v=1; a=openpgp-sha256; l=1546; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=+eDcQI6Zb4aIs7d9bJFFkkDfJcRJeMKqXpNyUgVrxUw=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkDfqAWH+TKlTmHEM6RxOYZ9/tjSDti0OgQsMd8 3lfr5mcv2GJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZA36gAAKCRDB/BR4rcrs CUW0B/4jNY4NiHQmjbgaA87O5C1kRpCQk+LmocZoMsFOsC0tZJxOkF/iopdO1LZvnd6RO/TFNtL 4sHa7kuYCq4fzdCigy8ArkO4qcv3qjWbHjtF9IaIkRnfFQ5Q1xwqfuonhrhGANm/Lc9l823UMGV VMqyTVphe/dudZ8iH2wbqbyXsxosUjCbDg54p1tVjIRr9NwPsx8gc5ecRq4oP61hOcXBVXY2Z3g waRxdIPA0Pgllstt5/4O3iQl/Yd8o3L5a0lGs4x2Ov/sA8RjdSmqqOXwrxTfTE0MEjVhIACueWD AOC1aazeB2ueFvzfFAzgZPKfA4u1IKoDpyUS6Y2BNREilAg6 X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: 8bit 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760180455964972075?= X-GMAIL-MSGID: =?utf-8?q?1760180455964972075?= |
Series |
clk: Convert to platform remove callback returning void
|
|
Commit Message
Uwe Kleine-König
March 12, 2023, 4:15 p.m. UTC
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 <u.kleine-koenig@pengutronix.de>
---
drivers/clk/ti/adpll.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
Comments
Quoting Uwe Kleine-König (2023-03-12 09:15:09) > 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 <u.kleine-koenig@pengutronix.de> > --- Applied to clk-next
diff --git a/drivers/clk/ti/adpll.c b/drivers/clk/ti/adpll.c index f5e7e2049241..6ecbba4342c5 100644 --- a/drivers/clk/ti/adpll.c +++ b/drivers/clk/ti/adpll.c @@ -931,13 +931,11 @@ static int ti_adpll_probe(struct platform_device *pdev) return err; } -static int ti_adpll_remove(struct platform_device *pdev) +static void ti_adpll_remove(struct platform_device *pdev) { struct ti_adpll_data *d = dev_get_drvdata(&pdev->dev); ti_adpll_free_resources(d); - - return 0; } static struct platform_driver ti_adpll_driver = { @@ -946,7 +944,7 @@ static struct platform_driver ti_adpll_driver = { .of_match_table = ti_adpll_match, }, .probe = ti_adpll_probe, - .remove = ti_adpll_remove, + .remove_new = ti_adpll_remove, }; static int __init ti_adpll_init(void)