From patchwork Thu Nov 9 20:28:32 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: 163574 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp689189vqs; Thu, 9 Nov 2023 12:29:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IHjDkyDbfXc3X5uVDfcq/6NJHUDIe2ZeeoG0lQMnuhIMiYQEEXmceK0MMOa9XTpXOkVSVrV X-Received: by 2002:a17:903:22c5:b0:1cc:4985:fc1c with SMTP id y5-20020a17090322c500b001cc4985fc1cmr6693450plg.4.1699561765201; Thu, 09 Nov 2023 12:29:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699561765; cv=none; d=google.com; s=arc-20160816; b=ODZBVcj84vxDKDpoLy3KJjIchD9CTA0m4jU249YB8hv53aVOrP60xSvs8fHIbJ5k6w kC/1QUBHP3v1E0wjZsvzF/ThzQCnwDd/gXveXy+uXJJy0+lqTBQd4jydJQi933sJAWG4 YERbJoD8j8+dUSuDI4E/k3mGm0jMTNnVgtPwHgrcKERJw9ys5HMr/spIJm9bfGrpSuGC /hp7ZckGAvLCRoXGVJBR/wgxJm293OAPvwjB/WXTaLY2x31i8a/CI8qo9KcGNFzplOaL hPD5BycmAG4WOsUwcTplYJ929aG1FKaU4XdACh3sKi2kjllCAo5npiVhwQKWvu2n7DrE fZgg== 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=gaO2peNBgEp3FQ49y2fJgPmI9sGuAZNLlS98qKvXnKQ=; fh=BC9YdGg9phKw3Gez6b3NhaDP/JKchg9BFOzUixuixOM=; b=DZRidsLb/C7FztJ/uKwYygdZnRnTRYaEOoKD5fM0myZm22hEjOrVGnHXIwI7vjIs/6 90vtGkAMXVScQvPdH1NwWQcK/mGmbRNuwcXazljT2xotdlio/kr/U6UCXsVMSdgJrJuJ 483PYVO/iZfxYqm5rNtxRnB4uVEI320c4QAtQD00witIpumHFNakoCrRC+Kkxa3ak8wz C5T3Ug3AGy+OLBT39HR+v0qcBH/0FVeaipqVzWEDw1joyrRTIGzMMp2gDdrRZznOoR0G bP/r9ciLNcc+9UkikOxdui/CsujbXHaXGZePNmxxU2UvFDOeZFRhWVcjtJ+k3UPBKUPG uHsg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id m9-20020a170902c44900b001b895572179si5239729plm.184.2023.11.09.12.29.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 12:29:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 9172B839744E; Thu, 9 Nov 2023 12:29:20 -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 S1345163AbjKIU3K (ORCPT + 30 others); Thu, 9 Nov 2023 15:29:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345159AbjKIU3J (ORCPT ); Thu, 9 Nov 2023 15:29:09 -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 1637544B6 for ; Thu, 9 Nov 2023 12:29:07 -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 1r1BeD-0002ze-Gr; Thu, 09 Nov 2023 21:29:05 +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 1r1BeD-007rWa-1m; Thu, 09 Nov 2023 21:29:05 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r1BeC-00GGtT-Oq; Thu, 09 Nov 2023 21:29:04 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Arnd Bergmann Cc: linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 02/12] bus: omap-ocp2scp: Convert to platform remove callback returning void Date: Thu, 9 Nov 2023 21:28:32 +0100 Message-ID: <20231109202830.4124591-3-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.42.0.586.gbc5204569f7d.dirty In-Reply-To: <20231109202830.4124591-1-u.kleine-koenig@pengutronix.de> References: <20231109202830.4124591-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1751; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=FFKpIApq6M4HDMVMY1N4u4aY2zqamgYSCbjMD8II194=; b=owGbwMvMwMXY3/A7olbonx/jabUkhlRfhw/3I82cxO40Xj0o6Stap2DN4aX/8m24xqyYvLgP7 48suvCjk9GYhYGRi0FWTJHFvnFNplWVXGTn2n+XYQaxMoFMYeDiFICJHIrnYJiq6rqXJ1rUS6xR iOs/X88Ef1a1Cecdlxet4JzzoOXc4X1HOHUOOEp9kDc1/6PbyZtyImj/qzLJe95nRX3Ocv5/t9V rSh3HRu9XZowx5xZPl+WJV++pP9S91OjlqXLu35HpLsFuk+1NvU7Zzk3ynfq5yimT72XhreQei8 Pp4s2WGbE3eM1ltl1sCzt7bIFHtT3jew7P1Gzz8jVsua4NVywda6bu/v4t9GfDuotnJW+vMdmck r76RXjBco/wn1bLL2hXfO16kerab1M3zcUo5Oj2Kt7p3q/1+6zspUre+ctZ3GOJMam7EXM+a3X6 3vcNduw3G9ick+1V33Rxrdo4ycqt5PmPtgv5Bacjbs0DAA== 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 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]); Thu, 09 Nov 2023 12:29:20 -0800 (PST) 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782119677185197036 X-GMAIL-MSGID: 1782119677185197036 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/bus/omap-ocp2scp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/bus/omap-ocp2scp.c b/drivers/bus/omap-ocp2scp.c index e02d0656242b..7d7479ba0a75 100644 --- a/drivers/bus/omap-ocp2scp.c +++ b/drivers/bus/omap-ocp2scp.c @@ -84,12 +84,10 @@ static int omap_ocp2scp_probe(struct platform_device *pdev) return ret; } -static int omap_ocp2scp_remove(struct platform_device *pdev) +static void omap_ocp2scp_remove(struct platform_device *pdev) { pm_runtime_disable(&pdev->dev); device_for_each_child(&pdev->dev, NULL, ocp2scp_remove_devices); - - return 0; } #ifdef CONFIG_OF @@ -103,7 +101,7 @@ MODULE_DEVICE_TABLE(of, omap_ocp2scp_id_table); static struct platform_driver omap_ocp2scp_driver = { .probe = omap_ocp2scp_probe, - .remove = omap_ocp2scp_remove, + .remove_new = omap_ocp2scp_remove, .driver = { .name = "omap-ocp2scp", .of_match_table = of_match_ptr(omap_ocp2scp_id_table),