Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp243840rdb; Tue, 5 Dec 2023 04:27:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IEc3OXHb+A7oEznC9EaN3mRkMYEce/d0ODWu35gv0lbMXj8eUWlYMcresMwAJuxdk7CVC4Y X-Received: by 2002:a05:6a00:1806:b0:6ce:3f02:10a3 with SMTP id y6-20020a056a00180600b006ce3f0210a3mr1577027pfa.8.1701779256885; Tue, 05 Dec 2023 04:27:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701779256; cv=none; d=google.com; s=arc-20160816; b=NucpwD7xtqVWbZl8/MJSSbnN4ox3GzrJto1Hi0H0rTeooIz1UQGmpiSNyIp8qieMmT iBNt876cI4Ohy6zDeQdcXAGd2AjMoTdYsVYgTJe/bj/7P5PT3vWp7GrczdXi7ng5CskE kJxKujlzHZSRb+gwcrt4jVwu1dXWuhFo2YlgLnvEuwqsBlgS/Hhmtw5Zl3pF2eKstE4w DVDqZFlPHB1/i4DRMwgy2gf5kTrrWdzhMw7mSbzg92WRsF2DCu1AmQmBBtzmADVSxP+T AzRZIS0l0BZRkvRnooqiKx++DwtwIGZK4YBBncX9B3Ovvf7Wo7sXMdJPlS6vyXMeNnDU FWCQ== 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=+b1knwi2HMD8mYZhKPz9Sk2fdrSpwI+6fqWXcPr4WD8=; fh=+bOS7EAwdGBDNDi3DApgKxJaZ2RNm60AI+OqdQ0si9c=; b=rrTFQgghmeL6nI3kuOwwQ7ombo+nS2Wf5F6wy2HwVsZjhpXPQw2XuxXJ6RtA3c3+7o add1YF7Y+FGObKx60OdTA/WNG1pO0nfcRexl4qsSOSV20K6hx53rg16XkHbI+jmSR+Lz /K1YyqcOT3CElcjNPGoiIje2SwZgyZhrO3ojz4wiiaHOWQfuacsrFnxVfnVbZO7lmVII xN0kc5iXFN+iSzsqZsRz2LnvoO3hVMVWrh4icX0K2h6t5wpaT8yXM5FdF8SDFMR+zEvU RTaaQ2a3e0c5h1TbsaIzhYJxB+OyUasfHnXn8cF7Z/CCWN0KsuPHDW0dFfwfhrzAyx1v XfMg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id e20-20020a056a001a9400b006cd905021d4si9557743pfv.367.2023.12.05.04.27.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 04:27:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 2B3F98225C80; Tue, 5 Dec 2023 04:27:34 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235198AbjLEM0k (ORCPT + 99 others); Tue, 5 Dec 2023 07:26:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235148AbjLEM0d (ORCPT ); Tue, 5 Dec 2023 07:26:33 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61D08D7 for ; Tue, 5 Dec 2023 04:26:40 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rAUVX-0005XW-KJ; Tue, 05 Dec 2023 13:26:35 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rAUVW-00Djuo-SO; Tue, 05 Dec 2023 13:26:34 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rAUVW-00EhQa-JR; Tue, 05 Dec 2023 13:26:34 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Liam Girdwood , Mark Brown Cc: patches@opensource.cirrus.com, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 1/8] regulator: arizona-ldo1: Convert to platform remove callback returning void Date: Tue, 5 Dec 2023 13:26:16 +0100 Message-ID: <76c7af01e2c8b3ab6585a04bc3f0d163fbb7fdf7.1701778038.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Developer-Signature: v=1; a=openpgp-sha256; l=2157; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=tqCSGHqBxpGncb/+HKOeTjE6jA8FKgj6miulNJehbSo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlbxbnODU3ZgR0fcmS1aFFE63uhc6c35DkU4ysm IwvnJ5XRzWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZW8W5wAKCRCPgPtYfRL+ TqJUB/42N8x71AwQgruQABeImfIN7vEaTkaTthiUERrgXAnkBzZ9gegXAy7pvht0kx7KCwXwYKQ f/m/Xkrf8wXWN+2PAo0aoBsh9p+K4akQOsOuApKCOWItKTNextjtAYmplBZnZnlzBDFcCyX+D9y q5+SdJ9ZXfgGTOEhBIoTMekZawYBDuAaTno7ZTLTPK0X46E2miZttmTywkwuR8jdcx8xWztHdf2 uqz2j8yAzXaxXiPf+vDjO9RjhVw+7OoEZ9vSxqmSwXo8FdZm22cGjZ3NQ49s4fiYdipQGzx9uhV TrlpV9kbWMTQ3P76Tzgr8GKnX83oMIqzv4BoL5d3qpeJEWLS 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.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 05 Dec 2023 04:27:34 -0800 (PST) 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 ignored (apart from emitting a warning) 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. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). 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/regulator/arizona-ldo1.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/regulator/arizona-ldo1.c b/drivers/regulator/arizona-ldo1.c index b465c0010665..4b54068d4f59 100644 --- a/drivers/regulator/arizona-ldo1.c +++ b/drivers/regulator/arizona-ldo1.c @@ -339,14 +339,12 @@ static int arizona_ldo1_probe(struct platform_device *pdev) return ret; } -static int arizona_ldo1_remove(struct platform_device *pdev) +static void arizona_ldo1_remove(struct platform_device *pdev) { struct arizona_ldo1 *ldo1 = platform_get_drvdata(pdev); if (ldo1->ena_gpiod) gpiod_put(ldo1->ena_gpiod); - - return 0; } static int madera_ldo1_probe(struct platform_device *pdev) @@ -377,7 +375,7 @@ static int madera_ldo1_probe(struct platform_device *pdev) static struct platform_driver arizona_ldo1_driver = { .probe = arizona_ldo1_probe, - .remove = arizona_ldo1_remove, + .remove_new = arizona_ldo1_remove, .driver = { .name = "arizona-ldo1", .probe_type = PROBE_FORCE_SYNCHRONOUS, @@ -386,7 +384,7 @@ static struct platform_driver arizona_ldo1_driver = { static struct platform_driver madera_ldo1_driver = { .probe = madera_ldo1_probe, - .remove = arizona_ldo1_remove, + .remove_new = arizona_ldo1_remove, .driver = { .name = "madera-ldo1", .probe_type = PROBE_FORCE_SYNCHRONOUS, -- 2.42.0