From patchwork Tue Dec 5 12:26:20 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: 174028 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp3391668vqy; Tue, 5 Dec 2023 04:27:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IEVeAUwznf1Ba4LCMKGBmyyK8dgT3kpS1Fnuc/hQofj6VRF9/cQhPQKCaIGpBsCA1xmkv46 X-Received: by 2002:a05:6a21:1c8d:b0:18f:97c:9786 with SMTP id sf13-20020a056a211c8d00b0018f097c9786mr5638808pzb.110.1701779238400; Tue, 05 Dec 2023 04:27:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701779238; cv=none; d=google.com; s=arc-20160816; b=rEZ5Ydv9PeyMlwkx697G2r4W4xhIsif33v3q51L8joO+yDWb2Hn8bNVMu+Inpq7IVr Xy/ktxNNNXOb6UR5jGglf9aNXE0DSWcA2bE2n2BqCtNZ8TZCI8x5fYULhTLHCS1tSZvS iDTNZxpveaIztbg95Hy39iE2+fqAzfM6MT0xydHIb35j0g7lSr3WqVm2EiViBxHDxArh f8zjA7qk/XCfFvfyiUT7P6U92+D3MxLVis49yjn3PbtnLEtZXFz8P4996C0aeZZ0mk7p hPh3uPQara11elnxrsgLEVZMjF3Ew2jvWyvh3gJ3hE5vzRddHfPxnyUOCHr13GmZ7il/ XiDA== 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=VZJs3GlxVjVaGsFVhp2UPMoLSaP6rTL6BWLhoFMDviA=; fh=Yizh0STwvmuKUAXlOou9xqxgjBVhxLb2DVtrpboQ5+w=; b=w0y3pHOlG1GKhVYb5VqKYBQjsNgET3SqFZjiy0S9i89okDgCwwn9oSDch+ie1ZfPNE oNdJBNT26jovUEmUmH1diwOF59n2DQmW/hQEEsggbfeQTkPVabiCBn6EQmdxA/UUCdfA jZLOOtEmWN/JywAqAs3BKJMbM0/9DngF5GJ05IU2RrPLgSX0aRlWcOwv3ZxHcWEprMqJ +gJA5MyNwSrTHKCC3CwOPDMlhiVu5O+YmaT5R2EkfAOpuZn4603E1PvkLZeGpVO5jncz Roc9XpXrDNzYc08CcE0zF2Ey2pjTKec7e3XumW+i6Jp03H245qW1FR5ezgQjJ1mXl2P8 kMOw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id f5-20020a056a00238500b006ce54dc2d09si3079653pfc.254.2023.12.05.04.27.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 04:27:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id 8B5A8803BA9B; Tue, 5 Dec 2023 04:27:15 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235140AbjLEM0p (ORCPT + 99 others); Tue, 5 Dec 2023 07:26:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232013AbjLEM0g (ORCPT ); Tue, 5 Dec 2023 07:26:36 -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 2BC2B109 for ; Tue, 5 Dec 2023 04:26:42 -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 1rAUVZ-0005Y1-Ay; Tue, 05 Dec 2023 13:26:37 +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 1rAUVX-00Djv1-LJ; Tue, 05 Dec 2023 13:26:35 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rAUVX-00EhQq-CJ; Tue, 05 Dec 2023 13:26:35 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Liam Girdwood , Mark Brown Cc: Kunihiko Hayashi , Masami Hiramatsu , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 5/8] regulator: uniphier: Convert to platform remove callback returning void Date: Tue, 5 Dec 2023 13:26:20 +0100 Message-ID: X-Mailer: git-send-email 2.42.0 In-Reply-To: References: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2025; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=MfQF9iwHzK7xCZssdcBcprKdoRpEqSRfvgyJg9UlPro=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlbxbrq9fl7uKhfoRDiG7dqJCrt0vg0UWtZzvc/ +ly7sZfv92JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZW8W6wAKCRCPgPtYfRL+ TlwyCAC02HaN2JA3GOM5Pz1awjMRcqAd7FBE3meTNtDblEqQYbRj45gdB3s+eakbwt8OGXe0s4+ IYvp/HN4pzTqf52GEThQ4tzV0heLJDZqsTo8G1zwhTUICI93/Mwsl3JtaYrgj89jASG5I4ZA0+W KLX86oNb1t2tAlyzUQAuC4iqJpD3d8MaQRWhGc7nDRUTP55DdlZ7onsx5ttLvAh5WGYrtD/3+1e xD+ZEps+OeYZUr8Uc/TnLmCg3Lh3NuC9BqUIWA/fW5vt1/8xYF4+8MOuPvcRPXziAUZ0gcEOW4K PW6h57ydJu6eI0TeCsy/nyb3KfjsM499f5xeQtMABzzHO4tx 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.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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Tue, 05 Dec 2023 04:27:15 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784444866421497942 X-GMAIL-MSGID: 1784444866421497942 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/uniphier-regulator.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/regulator/uniphier-regulator.c b/drivers/regulator/uniphier-regulator.c index 1d8304b88bd6..5f868042392f 100644 --- a/drivers/regulator/uniphier-regulator.c +++ b/drivers/regulator/uniphier-regulator.c @@ -115,7 +115,7 @@ static int uniphier_regulator_probe(struct platform_device *pdev) return ret; } -static int uniphier_regulator_remove(struct platform_device *pdev) +static void uniphier_regulator_remove(struct platform_device *pdev) { struct uniphier_regulator_priv *priv = platform_get_drvdata(pdev); int i; @@ -124,8 +124,6 @@ static int uniphier_regulator_remove(struct platform_device *pdev) reset_control_assert(priv->rst[i]); clk_bulk_disable_unprepare(priv->data->nclks, priv->clk); - - return 0; } /* USB3 controller data */ @@ -209,7 +207,7 @@ MODULE_DEVICE_TABLE(of, uniphier_regulator_match); static struct platform_driver uniphier_regulator_driver = { .probe = uniphier_regulator_probe, - .remove = uniphier_regulator_remove, + .remove_new = uniphier_regulator_remove, .driver = { .name = "uniphier-regulator", .probe_type = PROBE_PREFER_ASYNCHRONOUS,