From patchwork Thu Nov 9 20:28:31 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: 163573 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp689126vqs; Thu, 9 Nov 2023 12:29:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IHFjbZs+lubzJioIWy6dLhW9BBWpciX26IsaIdWrKYDPGUce0kzt/9WetB+IhncfmcjqrKc X-Received: by 2002:a05:6a00:2d99:b0:690:c75e:25c8 with SMTP id fb25-20020a056a002d9900b00690c75e25c8mr6212298pfb.7.1699561759275; Thu, 09 Nov 2023 12:29:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699561759; cv=none; d=google.com; s=arc-20160816; b=AQcgTa6/1ZWxhJdj6UYChPtal0mwQU9VGXkAKSOPO86MsP18mII8lEuZMYkKDYCl4f 7irsLwIXqPAqlXhOruJffaaLmR1Mn07VfaGrqjSwvHyYQRLWVAjQ1tzjNM0VjQTbK4e4 hLpLuvBqmYRdAuZ16DKNjPzjffvQPyNDE1FnbtmJpCFBxaf0PZ/Tne6DjE82kUZ2UMWh lWN+tMvnT6jjs8JroJB3EoNTf9rDecnHg5eqk0Ad4BCjseQmz9RG4E2yuBDmODGOFlH6 UaVOrSDiVLx7h+U0DocZkzeQSFhxmdvtMrhTnVj91ePLDmfz2DN9qv0CZy9e1/WYsOHX PFUA== 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=6GZI4CZ5vDp1gvhvoVhfjrjwii8NUZTkbenlS272rZk=; fh=28WnUnavaj7JpcKzgn3hu8/ru1TjTcdDAX6hP01XWrU=; b=vKILUFRhmNxO+y7FkZZabZKd+qgfVN+A2+78vxBHOTw/NCYoIkAI0k75QEaiW5Oupo 2hce74XMCt0eDuNZlwjQ+As5SB3FsoPP/epbS5CTUKyx+02oskL0c8A/AEVqjdNpxOC4 XmlFcKmhvNYsDib5KPUPgYahQHTcSwlGP4ePBmJMTxDC4c3AhHgnYCV7SjHmQBIQDAU1 F34+MMGGUfthuO6V1jf1lWuvDWssqoJ4UCsrnaE8XZiAovkuseNFwQt8pH3q8iIrdHOa jHznTBTju4zossppapdQm/vLNZIuA5MiH+PZL0N+Wa9i16K02Q51ViMuV9FbqK+PZ+dr Yndg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id x37-20020a056a0018a500b006935df301a3si16877408pfh.8.2023.11.09.12.29.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 12:29:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 402668391F86; Thu, 9 Nov 2023 12:29:18 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345172AbjKIU3P (ORCPT + 30 others); Thu, 9 Nov 2023 15:29:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345176AbjKIU3N (ORCPT ); Thu, 9 Nov 2023 15:29:13 -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 BD42844BB for ; Thu, 9 Nov 2023 12:29:10 -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 1r1BeE-0002zX-SK; Thu, 09 Nov 2023 21:29:06 +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 1r1BeC-007rWX-Qx; Thu, 09 Nov 2023 21:29:04 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r1BeC-00GGtP-Ht; Thu, 09 Nov 2023 21:29:04 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jay Fang , Arnd Bergmann Cc: linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 01/12] bus: hisi_lpc: Convert to platform remove callback returning void Date: Thu, 9 Nov 2023 21:28:31 +0100 Message-ID: <20231109202830.4124591-2-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=1825; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=5AZNdjzJwHWz0slz9MDShONzNbivb6y7QJLchsJRFkk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlTUDvHN/cjdII1SSU5qZzP2524CDEuqVPHLnD/ Y6lU3Vv1juJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZU1A7wAKCRCPgPtYfRL+ Tm9GB/4mE4RwhXz/CyJzR+mFdS6oldaSkbL0ziI1WpRhyQ6mwKF/uE6Qo6k1XGeUkLiNB2RpB5y Sf4DUeGKHwECLJ/rQ3kKPhpGO2oQN/vtmSOdpc65EpFHWKyEAXFkZ7oKUcbfB+rPptiXo3wQNQo hXzMJwssCkrtmN9NC43lra1MU+qoiD2glFkZi1E7gZLqEWXE+Qntxj4PSN++zWE3NaQiz0xl64B CxD6XrIOhPPWRvpQeUQcP7lkBVBifyr0b4HiSsg2zBfXQawRh7RAn2Tsj1BPxFyi9VihJq9yawf hpGsLG6K24/LN1y1bAgmcOefWFkl7kjiaD+FFduSWidFV7Pg 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 (snail.vger.email [0.0.0.0]); Thu, 09 Nov 2023 12:29:18 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782119671727897433 X-GMAIL-MSGID: 1782119671727897433 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/hisi_lpc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/bus/hisi_lpc.c b/drivers/bus/hisi_lpc.c index cdc4e38c113e..09340adbacc2 100644 --- a/drivers/bus/hisi_lpc.c +++ b/drivers/bus/hisi_lpc.c @@ -657,7 +657,7 @@ static int hisi_lpc_probe(struct platform_device *pdev) return ret; } -static int hisi_lpc_remove(struct platform_device *pdev) +static void hisi_lpc_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct hisi_lpc_dev *lpcdev = dev_get_drvdata(dev); @@ -669,8 +669,6 @@ static int hisi_lpc_remove(struct platform_device *pdev) of_platform_depopulate(dev); logic_pio_unregister_range(range); - - return 0; } static const struct of_device_id hisi_lpc_of_match[] = { @@ -691,6 +689,6 @@ static struct platform_driver hisi_lpc_driver = { .acpi_match_table = hisi_lpc_acpi_match, }, .probe = hisi_lpc_probe, - .remove = hisi_lpc_remove, + .remove_new = hisi_lpc_remove, }; builtin_platform_driver(hisi_lpc_driver); 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), From patchwork Thu Nov 9 20:28:33 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: 163575 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp689274vqs; Thu, 9 Nov 2023 12:29:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IFEKV82wIMwZpr8VKz+ufkXjfojGN1wTCIydqnC0xzt2pMVrAgVYx5EdAP4HhISIxlE4BpH X-Received: by 2002:a17:902:b610:b0:1cc:17e6:5da8 with SMTP id b16-20020a170902b61000b001cc17e65da8mr5473350pls.10.1699561774761; Thu, 09 Nov 2023 12:29:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699561774; cv=none; d=google.com; s=arc-20160816; b=bOBFtWih0eebhrnZ8p/Vh2pvNT+DCgok1fHn/oqTgR0jsAGi6hWH5qzMRn2zHaWO4H gRKDs1qOg9h3boxc1Nq1dJ4BYi/RzJHUg9H2WJ1rTDspbS7cN/isizqtOJBefdtbVrY8 wkL0OsyWf6CIcwurlZbKcgroOX2+1H1t3xcfO/YGX8NVL+nnqRBudzG3xafJVUbeqRQI MOsgjmEHVnXnlUglVqO/M3OVpGQf2OxyNX57Wz4SSRJqDf1uNjIkXk6TrFnt06aYdaIT JtYVGkqdKPTgmMY/7/wzwI1mC11YuOE1ZdduVNX2iDA4Ez6RW5TSUqHGW5XqRCSLhj+y OvJw== 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=X8m+C09y0ow1FO1wCogH6/s51Bwkf3IobHer8dRzRr0=; fh=ytgHdCNAvgugi5rZu1708fP+HXGP+6in4VXKPuQ8Iek=; b=h9BtnwGvQe1Ba7z+tnzqSZ5roIL9441SltoZ2bs96nvZFA0omUWv5i5aAmpqD/+I8t Z1VjoDjtEE0apKw4zQPQe2Fvg0VR02mY/+4OSN9JyjTlQnntxHDVDspHpakJXg4hCcmq CCTAd7RgH/CY6S6iOgwCYFDCs7y9VszrWe/CSXMQSuAtXJv3IWze78mEncs2Em/uHXMz Uf6NGRi6AqVdSIgsDjA84VJnevDdvu0RaMPE4c6evQ4T1cIv5WhF9c8/u4/HtzJ7h4AA JGzOxWQg0S24cbtKEQbgtKEqPLlNhwnzz7iFd4zdGbZx9OtKqBjcopZeoXD+lSjpUSKC /AYA== 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:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id ku4-20020a170903288400b001b89551a392si5366336plb.113.2023.11.09.12.29.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 12:29:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 6F3878391127; Thu, 9 Nov 2023 12:29:33 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345257AbjKIU3b (ORCPT + 30 others); Thu, 9 Nov 2023 15:29:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345220AbjKIU3V (ORCPT ); Thu, 9 Nov 2023 15:29:21 -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 41A92468F for ; Thu, 9 Nov 2023 12:29:15 -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-0002zf-W9; Thu, 09 Nov 2023 21:29:06 +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-007rWd-8G; 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-00GGtX-VE; Thu, 09 Nov 2023 21:29:04 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Rob Herring , Jernej Skrabec , Laurentiu Tudor , Arnd Bergmann , Tony Lindgren , "Sicelo A. Mhlongo" Cc: linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 03/12] bus: omap_l3_smx: Convert to platform remove callback returning void Date: Thu, 9 Nov 2023 21:28:33 +0100 Message-ID: <20231109202830.4124591-4-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=1746; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=zgJm1dlc/UlSS9zetmH5GbvsuMr4qHT3lQphrWzkAzU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlTUDyw8liF78LWnyhFZLru8PNsGZ1t5BmeLGyf 0BHYx1oYjSJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZU1A8gAKCRCPgPtYfRL+ TtsSB/4lgGCQ+t/mONA1F+XnD+DFwmTvwvTCbxyBHsoJ9uUpV+auNZ5K0B0WlzVfMqqDDQWazys Oewf+G4tvcZn3Cr/r7I65OEGZpM/A2wwR6DOr0Vxk49ASXpiik5DaTqrK0sBvMGD4Cpq5B2dFdC 9GTXCisMJb2Ocbbj7ssV5uKEl21yMzv+10pPDCwTLMmLXUk9s5aUB6nL/6o8knNMuPZEDLcmok8 RSuR67bbgUapNxOYgWFwZ9qu6Ra3XHKQlOiCLXQwroe4VqIEG/QCSm+7pGl1fkvC3rZKywWMKq9 185Eh8d+I+slva1fnPV5DRZvTdkYBaIESmhNSzh4SMNuOBs+ 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 (snail.vger.email [0.0.0.0]); Thu, 09 Nov 2023 12:29:33 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782119687387044547 X-GMAIL-MSGID: 1782119687387044547 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 Reviewed-by: Tony Lindgren --- drivers/bus/omap_l3_smx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/bus/omap_l3_smx.c b/drivers/bus/omap_l3_smx.c index 31774648be9d..ee6d29925e4d 100644 --- a/drivers/bus/omap_l3_smx.c +++ b/drivers/bus/omap_l3_smx.c @@ -261,7 +261,7 @@ static int omap3_l3_probe(struct platform_device *pdev) return ret; } -static int omap3_l3_remove(struct platform_device *pdev) +static void omap3_l3_remove(struct platform_device *pdev) { struct omap3_l3 *l3 = platform_get_drvdata(pdev); @@ -269,13 +269,11 @@ static int omap3_l3_remove(struct platform_device *pdev) free_irq(l3->debug_irq, l3); iounmap(l3->rt); kfree(l3); - - return 0; } static struct platform_driver omap3_l3_driver = { .probe = omap3_l3_probe, - .remove = omap3_l3_remove, + .remove_new = omap3_l3_remove, .driver = { .name = "omap_l3_smx", .of_match_table = of_match_ptr(omap3_l3_match), From patchwork Thu Nov 9 20:28:34 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: 163580 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp690368vqs; Thu, 9 Nov 2023 12:31:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IEXrxJdikWAsxHxWOwUxf6lFKQ4px2MqVMXfQac71mdOQAyUiUE+Yr/5/aVW92GqU/2UiDO X-Received: by 2002:a17:90a:e7c7:b0:281:858:a086 with SMTP id kb7-20020a17090ae7c700b002810858a086mr2769028pjb.6.1699561896112; Thu, 09 Nov 2023 12:31:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699561896; cv=none; d=google.com; s=arc-20160816; b=gQooFVpiIo95byX4VKkQTMdAabH+fThJR92TJGjc0zIpfCDr7d8czatbGRxX5arJKT yGex+Kjjm4yo1AyyMvrS92py3B+q6KE5Rstk46rTcRGHiZH7pnxFpNVuuBAVrvTwIiCL 30FxjtrGDo6N+rB6QIwNnCQkolpxUqc/drD28flpSFacYlKDVEb4wbvnA4nDbeKI4+JT E5Tudevz8fFwimIcCdf6bi3BaX0kMuu+cCvJarF9zJSUs4IcWRHEnwNw4D3ptb+DgeoP mY7QQL/7KjE3qikrGUOCdNAz9k4dNhOsxnlzW2S+iRiyG0b/rWd3sSMLibBayVxme4ul HoeQ== 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=iKhGeEagneKG6sH5NKA/G/stiJozrALhS6Ua8ThxJRM=; fh=IPpOo4MAuIDMYj5lnXsOUoonV8gzUQ3LrR5MUq6vDLA=; b=fXgZBefuUHHjyG8TPx+2Y2oszJ97C0nX7rwlXLNGPnCy+NPM1at/rQxQrn/XqeamsY hbkSG26AhdnKX5t0ohrVV1vl819y9s9OD0fq+oEUONNa3T1Zcq4Ofi2K9vu0+mqM4mI3 yfI5hLMvZhlJ+azQCaSjssbpzQqDGpVB4NIbDpYk43z6uUcHSUqqytOoqFhtb80SZU0r 3HG++8XbS04pWbBtZdsKCTXMQrjanJlY6TyTGYCxw8MK952l/Q1ITczedwj2mD5JyapK wN+mYr/ykM1iKNo2DBxJ0eJuvNrlm7Tz8h1WOV3K8as6nPl92DuzFZEcCEvRqbNTAmxV QCUg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id f9-20020a17090ace0900b0026b49c1aa50si2447128pju.111.2023.11.09.12.31.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 12:31:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id E46D8809565C; Thu, 9 Nov 2023 12:31:06 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345263AbjKIU3p (ORCPT + 30 others); Thu, 9 Nov 2023 15:29:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345226AbjKIU3c (ORCPT ); Thu, 9 Nov 2023 15:29:32 -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 7803444BC for ; Thu, 9 Nov 2023 12:29:20 -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-0002zp-S5; 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-007rWg-FB; 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 1r1BeD-00GGtb-61; Thu, 09 Nov 2023 21:29:05 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Arnd Bergmann , Andy Gross , Bjorn Andersson , Konrad Dybcio Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 04/12] bus: qcom-ssc-block-bus: Convert to platform remove callback returning void Date: Thu, 9 Nov 2023 21:28:34 +0100 Message-ID: <20231109202830.4124591-5-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=2068; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=wAGXyo4THEZ3YXfAy6+ytes/4cv/Fu7eWX0o6nDhAIA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlTUDzTrNcskF9F/f7KcEHQ1rf0f1wYIKKo0UFW olFqxNoc1mJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZU1A8wAKCRCPgPtYfRL+ TgRsB/9KhxhY9k0o2+A6JUS7K5v6XNCj4Wzgont+kCkzwMz/YYOJdMy9/JnUbv14K6dc1O3Aww0 tt9LfxAfT3CFQc8WtA5pFIP365Ar9BwyOXvVONlNbJ4NzeuvU6xuKnMco+Q7Wa0cjGpmub+SeA8 2bp2L6R3EGe9KT/Fp9+CxNswZHItWHgw4EwSsEK5yneju39Hgdxiw6E3cdlUc30lR0+FRY07Q0u j0ua1Tpnwn4a+qwxCsziQscqxoXF9PQ770v79b+T2WARxVaZC0eVEC5gwe7mSne70eAIdw+AKnP duc01QYWIctEMduPOoAIKfLVrFc6MMbPFlY0pw328//49g3k 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 (agentk.vger.email [0.0.0.0]); Thu, 09 Nov 2023 12:31:06 -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 agentk.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782119814801586108 X-GMAIL-MSGID: 1782119814801586108 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/qcom-ssc-block-bus.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/bus/qcom-ssc-block-bus.c b/drivers/bus/qcom-ssc-block-bus.c index 3fef18a43c01..5931974a21fa 100644 --- a/drivers/bus/qcom-ssc-block-bus.c +++ b/drivers/bus/qcom-ssc-block-bus.c @@ -350,7 +350,7 @@ static int qcom_ssc_block_bus_probe(struct platform_device *pdev) return 0; } -static int qcom_ssc_block_bus_remove(struct platform_device *pdev) +static void qcom_ssc_block_bus_remove(struct platform_device *pdev) { struct qcom_ssc_block_bus_data *data = platform_get_drvdata(pdev); @@ -363,8 +363,6 @@ static int qcom_ssc_block_bus_remove(struct platform_device *pdev) qcom_ssc_block_bus_pds_detach(&pdev->dev, data->pds, data->num_pds); pm_runtime_disable(&pdev->dev); pm_clk_destroy(&pdev->dev); - - return 0; } static const struct of_device_id qcom_ssc_block_bus_of_match[] = { @@ -375,7 +373,7 @@ MODULE_DEVICE_TABLE(of, qcom_ssc_block_bus_of_match); static struct platform_driver qcom_ssc_block_bus_driver = { .probe = qcom_ssc_block_bus_probe, - .remove = qcom_ssc_block_bus_remove, + .remove_new = qcom_ssc_block_bus_remove, .driver = { .name = "qcom-ssc-block-bus", .of_match_table = qcom_ssc_block_bus_of_match, From patchwork Thu Nov 9 20:28:35 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: 163578 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp690114vqs; Thu, 9 Nov 2023 12:31:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IH+QOewInMJgRCTevPvmc2UZ+rZuvr2N+fo8cbbKX/43/TwlVwYc/ks14RZUrRsNCtlM2Uc X-Received: by 2002:a17:90b:3e88:b0:282:e109:109 with SMTP id rj8-20020a17090b3e8800b00282e1090109mr2773559pjb.47.1699561864615; Thu, 09 Nov 2023 12:31:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699561864; cv=none; d=google.com; s=arc-20160816; b=Xa4DJi6HktcZasC0+57xensJcIXzheMDEmcHMhZhfteBsz5sftFoSPRQy5qljoRNEd 68dVj8PYXBg8LvCd5uQ0JjY3g9BkeuTfyyf5xxKTAujM+ONOCkRy2whqXY+8OiEvPwOq jYXcK+zgc5OkN7vKSFXjROs39PNiWd3w8Xrb3m2b4eE78igpZm8RZZVP2m6PJB3YPMF+ AWvPWrWbhr8FbVTlhlDRAAapvuabrbBJRjisrqJzqPbosJV81SgKPoFmvPSzBBSPGiBr daoPNJHaflITpKwsM360io1/oIT4ZdhA/nDAE/WoR/B37gr+kXaHRc3iRJm8/ZUwEtKY AbFw== 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=jpaEre6aJymCf/x/a9rJ/2Qn+RoDQNTUwP8/qSDeEOI=; fh=+9wDHzWq5n76PyTIFijHLV2IhFuso0zco2bmhDePn78=; b=T2jcNGuXgMOxvZ1eYYOYVyu0Msa9Z6lqDwQyRGs9/A1wjnkleC3McV2G8thInTqsH3 O3maGzD3bQOqlRSGEdX0gZzrVT17YgtLa6pJKRq89dNGvIJcMHvK7GkHzYDY2IKqBJp7 DF9MzEEWcbvcXTVPu7azdeaG0XrJSCA390bXfpW/O8V+2G9U6I3TN7tCu4+RkpqqPN2s Le/rWAsJOyioTTe8o9B4aciPixNAPU9/g3UQ5yjUgiha9JTMLNa1r8Fs9uTS+8wYDvCz Unk6MAw1/IeTPWm1k3rFUVewM6YnK2rWBJAeAaeQJPjvUD9R5EMtp1q4QqATDmBzIhmr 8rDg== 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 v12-20020a17090a898c00b002802da109fasi2330357pjn.165.2023.11.09.12.31.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 12:31:04 -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 9ABAF806500B; Thu, 9 Nov 2023 12:30:13 -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 S1345256AbjKIU3n (ORCPT + 30 others); Thu, 9 Nov 2023 15:29:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345195AbjKIU3b (ORCPT ); Thu, 9 Nov 2023 15:29:31 -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 935BE4787 for ; Thu, 9 Nov 2023 12:29:19 -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 1r1BeE-0002zu-E0; Thu, 09 Nov 2023 21:29:06 +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-007rWk-LU; 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 1r1BeD-00GGtf-C6; Thu, 09 Nov 2023 21:29:05 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Arnd Bergmann , Greg Kroah-Hartman , Liu Ying , Geert Uytterhoeven , Luis Chamberlain , Nick Alcock , Rob Herring Cc: linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 05/12] bus: simple-pm-bus: Convert to platform remove callback returning void Date: Thu, 9 Nov 2023 21:28:35 +0100 Message-ID: <20231109202830.4124591-6-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=1896; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Ox2UR96mQUBphpPQCu2afHS3QOH3355cCf293Z7ZMuU=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlTUD0TmHACrZZ3AsH1FRI415x4vDLXTNjGwR+W w452ENjBoCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZU1A9AAKCRCPgPtYfRL+ TrRtB/sGslx73P03TonkbUftTqrJqMOyxQ4WC5pr+hCbarcjoCMF5U2yhaWGSQ1Ro0wgBDiveYk 0eI6j6BC9b4c+kIOs7vBwqPH2W2ms2L3A7kP6nZUAgxCJykdiCusTROwBKsVcIGIXCmUC9fjLRO dLr2vSJaM+I7TXkxaW7U2B7UxV0Cg+z5PrUXuQbkZXxC2RK5CDNYrxSO0z3i/D1nEV+qxAjzQiz oemf3SUqAMXVNqRpWG0k7NhhZVQZ28EO4HZskEZ9cim12E8/UYIbcEuszQ8X4rAUWNH8lkc1FWq DjTR6eFHVMmHFFsMxzSy6WRbZICUa8R8L710UnTCc7VGqs35 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:30:13 -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: 1782119781486874627 X-GMAIL-MSGID: 1782119781486874627 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 Reviewed-by: Geert Uytterhoeven --- drivers/bus/simple-pm-bus.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/bus/simple-pm-bus.c b/drivers/bus/simple-pm-bus.c index aafcc481de91..50870c827889 100644 --- a/drivers/bus/simple-pm-bus.c +++ b/drivers/bus/simple-pm-bus.c @@ -74,17 +74,16 @@ static int simple_pm_bus_probe(struct platform_device *pdev) return 0; } -static int simple_pm_bus_remove(struct platform_device *pdev) +static void simple_pm_bus_remove(struct platform_device *pdev) { const void *data = of_device_get_match_data(&pdev->dev); if (pdev->driver_override || data) - return 0; + return; dev_dbg(&pdev->dev, "%s\n", __func__); pm_runtime_disable(&pdev->dev); - return 0; } static int simple_pm_bus_runtime_suspend(struct device *dev) @@ -129,7 +128,7 @@ MODULE_DEVICE_TABLE(of, simple_pm_bus_of_match); static struct platform_driver simple_pm_bus_driver = { .probe = simple_pm_bus_probe, - .remove = simple_pm_bus_remove, + .remove_new = simple_pm_bus_remove, .driver = { .name = "simple-pm-bus", .of_match_table = simple_pm_bus_of_match, From patchwork Thu Nov 9 20:28:36 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: 163579 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp690117vqs; Thu, 9 Nov 2023 12:31:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IGKNgs0ReylT41UM4vBl3y13CCKO/Y+EDf8Y/mCf0083BWw69gEuifJcJYMIlXCFputV9FM X-Received: by 2002:a17:902:d4c6:b0:1cc:339e:c228 with SMTP id o6-20020a170902d4c600b001cc339ec228mr7350156plg.58.1699561864861; Thu, 09 Nov 2023 12:31:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699561864; cv=none; d=google.com; s=arc-20160816; b=FInmzaEkCBHZGLITshVZ+3n5eeNtJ5FkxEhnBYWf4k5rXygTgvo/QUIjyj/BlWBXE8 r7K2/fZRFu9PoBwvklrLtku/U6yFAPVgSBTIW2puFQk4+YxOEDpf1SfYI82fDL4efH7v K1U+nL/5PJO5vJm1inTHHU51PAMl722uPGdFwOFudZ7RQQHyycOKUGbz4PSFf2p3CFNP 3gCH2zkWUEATo8d3Im44ExMQTQN2J0WDHI9vXCKqEPzm1VL/nZEp3logcRXDJJ78+WQt OACE9W8VK7k5H30rH5Lo4pocZiNB/lv/eSxI53WeMXhukQRxZskaynbvppN908+9K36t mABQ== 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=oO6rdAJLx7JwzX/kRd4me76Hwejgn6Uw/letA505Tgc=; fh=8tp/+1/f+q1lGX+PqS5vMqXs66KgtcKS4ISiy01MsWo=; b=PhNXlxsiZ5y0hKXRiDRdw5lGFR103m3xNMXQ2rP/VQ9eEhic1Lgy7wiQWOFmpwmbJh +u1cGE3apDGFVE1gsewRIPRW0IsSq7fvi4y9xFfI3jydkHRRITtaRJN0W6h+uC9UGExu TURS2bzLjn25Y7eRWO4J5Hd/7I1rtUGoZ3sUdaIZv4RNjQbqnaFrbwD3xBqb255BO1C7 opfnX/INizDn6nRgOQnViB+EScOeK7bLypTKZbGu12sj3nDskM6CJ7zIIzmJwdd/boH/ HRMc4D2xE197uHnGmO7H1F/poEqa17BXXpAcMO5TsbiM6LkJcT4FLA8gDGWe01BnIeAU iN8Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id n3-20020a170903110300b001cc1af09466si6202498plh.125.2023.11.09.12.31.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 12:31:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id D621C8087DCE; Thu, 9 Nov 2023 12:30:29 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345245AbjKIU3j (ORCPT + 30 others); Thu, 9 Nov 2023 15:29:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345248AbjKIU3b (ORCPT ); Thu, 9 Nov 2023 15:29:31 -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 3DB654784 for ; Thu, 9 Nov 2023 12:29:19 -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 1r1BeH-000307-0E; Thu, 09 Nov 2023 21:29:09 +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-007rWn-TW; 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 1r1BeD-00GGtj-K5; Thu, 09 Nov 2023 21:29:05 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Arnd Bergmann , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 06/12] bus: sun50i-de2: Convert to platform remove callback returning void Date: Thu, 9 Nov 2023 21:28:36 +0100 Message-ID: <20231109202830.4124591-7-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=1726; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=YjxQ9k2VhTNSjPuszXvrypquoQe61zCjR6hyAesl/x0=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlTUD1h/FL212JBtXnUYvTOt6e/oAiPyWOeMRVg MwOBzqtJD2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZU1A9QAKCRCPgPtYfRL+ TtAtB/40Cw1OEL2T46KLdtC6CPWjFjNclqSJ+qr/t4mj2hWDKwQtf0kTynpCe6dsTwfyifEPBfQ d3VgfUp1eO2NYm9OBdHXDl32gc0MDmOoNpdgDKlCc6aYawUN/noK27PmoPWdFuEcm1VyU9uMAuX sR5pS1cctbTPPozjbI4Y43ApHt0iatVbNW2jxyRqQW7Ac+Bi/tfW+R4g2VJqQ3O78mZ3dSY5MLt q7CyCWxnhD1PXANJFoeNMAgGd65yzDtNxJ66WOLbB/W5SkCO0WrqOoVNBIBUmsCU7nTUwhDZUVT hIhBabSoRtg8sz8beNoY1SfoJ4H6moejJnD+pPh8i+i+h+2g 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 (groat.vger.email [0.0.0.0]); Thu, 09 Nov 2023 12:30:29 -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 groat.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782119782100346675 X-GMAIL-MSGID: 1782119782100346675 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 Reviewed-by: Andre Przywara Reviewed-by: Jernej Skrabec --- drivers/bus/sun50i-de2.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/bus/sun50i-de2.c b/drivers/bus/sun50i-de2.c index 414f29cdedf0..3339311ce068 100644 --- a/drivers/bus/sun50i-de2.c +++ b/drivers/bus/sun50i-de2.c @@ -24,10 +24,9 @@ static int sun50i_de2_bus_probe(struct platform_device *pdev) return 0; } -static int sun50i_de2_bus_remove(struct platform_device *pdev) +static void sun50i_de2_bus_remove(struct platform_device *pdev) { sunxi_sram_release(&pdev->dev); - return 0; } static const struct of_device_id sun50i_de2_bus_of_match[] = { @@ -37,7 +36,7 @@ static const struct of_device_id sun50i_de2_bus_of_match[] = { static struct platform_driver sun50i_de2_bus_driver = { .probe = sun50i_de2_bus_probe, - .remove = sun50i_de2_bus_remove, + .remove_new = sun50i_de2_bus_remove, .driver = { .name = "sun50i-de2-bus", .of_match_table = sun50i_de2_bus_of_match, From patchwork Thu Nov 9 20:28:39 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: 163577 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp689499vqs; Thu, 9 Nov 2023 12:30:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IEPYd9KJZLo4jiYgqsWdEUu23tVfMMezM0Nms6t4SeX35A2XwD6smKFbRIcfVsRn+cuGOt3 X-Received: by 2002:a05:6808:151e:b0:3b2:e3d0:863f with SMTP id u30-20020a056808151e00b003b2e3d0863fmr3206626oiw.13.1699561803159; Thu, 09 Nov 2023 12:30:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699561803; cv=none; d=google.com; s=arc-20160816; b=0EQyOpdCP3anwsbw8aaFWLW/tQkXYUJ860S8dZtjIF90/z61h9SAvVz3dFFZvaWU0j l1weLGkwOOhg12dV91faMynuFpzYiiddvmt+ahSSSu+p6XkeUcm4gTrLonZeICsP2Edh mgOb3r8XXM0vh8uJW1s/Sg015e/Kaf6JzrQNiHSbhQnEOrSxYOPH3v1wixpS58iEQ652 iCcirZzm+KbgX4Bdakc49wj0LbjNwHCQCyjHqiTBUIcomZIOpN9sjUhPuiaCaKsgq66r Ci68IUTrm6qXPODv0vsCJBj3iArlSHbzJL7HSrHjeZE1/DS29E0puK14pAbprY0vXBty Kfcw== 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=U6aY4DhqmPR5q1q5RwViTtrlssy3yUCEF25H7/PjiCA=; fh=bDLAJ+56j77yFU0DPQwHv9mNBorHGFxdCrU3vBMS5sg=; b=DHOiTzpM4imgCaGLmlIzfag1qP8bFf4/HiFC+qJBnPFODYaqiN+gW2jYpFpf3hnrVq aA4KUonfjLk6375Iz/ThT+tU1gCxg/Dv0b0B7cvOeY0T3s806N8HqU7MR2bMpvDLnygr aHOOdnxp0S8mUb/fECrL11kBuJueZiIzfJVGo20oDsi4Nr66cfZ8FQCn9BxORu2EhnG/ XliIC6lK52emCAt1hvMrDbFhLUCunGa4r9AACf71Njgjl0nHcDHeOaWG4yAotUlKG/65 9OGGRgxTpGOEhZopUYUa3HMywRoLs3g4atuiNzdeMEkK05Bk2W4RaGVOGmqjFP7TNbzk sR/g== 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:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id v10-20020a63610a000000b0058a4883e6casi8048226pgb.225.2023.11.09.12.30.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 12:30:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id B810F829B3DF; Thu, 9 Nov 2023 12:29:54 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345208AbjKIU3g (ORCPT + 30 others); Thu, 9 Nov 2023 15:29:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345200AbjKIU31 (ORCPT ); Thu, 9 Nov 2023 15:29:27 -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 8431A46AF for ; Thu, 9 Nov 2023 12:29:17 -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 1r1BeF-00030T-FL; Thu, 09 Nov 2023 21:29:07 +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 1r1BeE-007rWz-Mj; Thu, 09 Nov 2023 21:29:06 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r1BeE-00GGtv-DS; Thu, 09 Nov 2023 21:29:06 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Arnd Bergmann , Thierry Reding , Jonathan Hunter , Rob Herring , Yangtao Li Cc: linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 09/12] bus: tegra-gmi: Convert to platform remove callback returning void Date: Thu, 9 Nov 2023 21:28:39 +0100 Message-ID: <20231109202830.4124591-10-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=1763; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=VjQlvlUP0hSc0i1I5jF7v3psby2JMvMAnYEOoHbOgDg=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlTUD5GJFFr2+w/ToJXtwZlVXQtzp7LkRrRw5f5 SCYzSLnqbyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZU1A+QAKCRCPgPtYfRL+ TmaCCACk8lIKtzEjK+HIAmy1UCWEfkh0YtAjwGTgmHGLU/63Bzs7O4EfTlGSgI6CU/WpQd2Z/oT /r/xL1aY6REcPoenUxW+BVtSQcGtBqYiXndadbyVwVDaMqIILZ+56hBkVqu2hoJG/KHagY79d/r 0LldtrxEaP8JmC7P2WQTqBYgkzbRrSesWHx9Sj7SfuXNVDlNLQXsJCnhyu5AUn/1jiSgr6KrdlI XoMbVVk2TDz+BGcFcgVKGaiUM9ZPVDPNtY79OZ9Wmj4VVlEF5x9w2//Qe+beNHlNYEHSCX4sawO pLN2cuvrxwAWCgJJtmEa8vRbXy30siMExPdKvvHYZQdMUr7W 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 (agentk.vger.email [0.0.0.0]); Thu, 09 Nov 2023 12:29:54 -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 agentk.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782119717136777286 X-GMAIL-MSGID: 1782119717136777286 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/tegra-gmi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/bus/tegra-gmi.c b/drivers/bus/tegra-gmi.c index 59919e99f7cc..f5d6414df9f2 100644 --- a/drivers/bus/tegra-gmi.c +++ b/drivers/bus/tegra-gmi.c @@ -258,14 +258,12 @@ static int tegra_gmi_probe(struct platform_device *pdev) return 0; } -static int tegra_gmi_remove(struct platform_device *pdev) +static void tegra_gmi_remove(struct platform_device *pdev) { struct tegra_gmi *gmi = platform_get_drvdata(pdev); of_platform_depopulate(gmi->dev); tegra_gmi_disable(gmi); - - return 0; } static int __maybe_unused tegra_gmi_runtime_resume(struct device *dev) @@ -305,7 +303,7 @@ MODULE_DEVICE_TABLE(of, tegra_gmi_id_table); static struct platform_driver tegra_gmi_driver = { .probe = tegra_gmi_probe, - .remove = tegra_gmi_remove, + .remove_new = tegra_gmi_remove, .driver = { .name = "tegra-gmi", .of_match_table = tegra_gmi_id_table, From patchwork Thu Nov 9 20:28:41 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: 163576 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp689315vqs; Thu, 9 Nov 2023 12:29:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IHnzcNDDFsm5JuhWHC03EIGd1e2Hm4mOYdTjFq77gQy5tzwqyqxh4KG8sLXUvE3ubhSwFbW X-Received: by 2002:a05:6a00:22d4:b0:6b4:d17b:25ab with SMTP id f20-20020a056a0022d400b006b4d17b25abmr7133716pfj.25.1699561779661; Thu, 09 Nov 2023 12:29:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699561779; cv=none; d=google.com; s=arc-20160816; b=igyg9lAfa5HZc1fj3TS2AV0eUoGEMQHQ4naeNHO7J65QcvYW0tLzRQe5gMOOdRmky+ +BK3FngdHwZHed/viRjT4Tdz2Z6Cz6JN51+b4hG7o6lWsoK6AOGtFpYULbGyg8NhaQOd 4QQOLMN6LA7RjZ3fGOeWWFDabCxR6zYrKpbsV2bQPPt84UG+wlLlFjHy7OVj1IiH6pKZ 3VPOR+XZicWOGDl/ZnurcUYTEftYknxeY+zE1h9ct/0+OfudbPVBx7BSVqpuz3SRVUqr sH9SkHMzdYGXEu+wfnpb48pSjGEe05Xa53ME03Yk3ZxreuGNEGla5mU6gQVp3xdIin70 Y+MQ== 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=SniF9f330OuxfxYybA1j4+YdYkjKM2J7s4Otk9dQHoE=; fh=uXaVfmENdLMeDQ2m3i3X1ytL+XdKKJStRehHVQc4rqo=; b=qxcRmMJXtFi9syqATtGBI3efPnvCjuUmdwqPpMUblW29PMqYnAv8RpUZOkYIBm98rl ZV5ibfksZa2pe7l+ebEamIWtxUHuQmCJTPyOWy156Ch+85NCNY3V6ZXslpRBPm6OPfjb PsR9I7StE+P6ZALKzqtj3Ig6QrwPFPvBSRmlUjOCmiTuHB4Iq+O4W5sm+ZFxas+gVw9e m1trhDWX5iWSBGzfdhT8FkBTIkoJYrBhJl7udi6JX51/d2zqKcuIWGsxarsIMA8FhYBA s+0yGWthaXUWOLMhBfDMHKUCsQrGFkbEZukKsSI/m4A7g9rU8WUtM/7RrZhfoBlEDLu5 H+Sg== 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 k190-20020a636fc7000000b0059ccb99a2eesi8148098pgc.173.2023.11.09.12.29.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 12:29:39 -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 BFF5C8311A03; Thu, 9 Nov 2023 12:29:34 -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 S1345225AbjKIU3Y (ORCPT + 30 others); Thu, 9 Nov 2023 15:29:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345168AbjKIU3P (ORCPT ); Thu, 9 Nov 2023 15:29:15 -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 D4A3944BB for ; Thu, 9 Nov 2023 12:29:12 -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 1r1BeF-00033N-OC; Thu, 09 Nov 2023 21:29:07 +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 1r1BeF-007rX7-Aa; Thu, 09 Nov 2023 21:29:07 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1r1BeF-00GGuD-1O; Thu, 09 Nov 2023 21:29:07 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Arnd Bergmann , Tony Lindgren Cc: linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 11/12] bus: ti-sysc: Convert to platform remove callback returning void Date: Thu, 9 Nov 2023 21:28:41 +0100 Message-ID: <20231109202830.4124591-12-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=1758; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=opTk4HTyURjB0GAHXubqOJ0QoyNNC03II0HWbr+XPDE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlTUD7++rpK6UFrsRtYltlQ1hWs00xrWDPQ+PR7 a0yuf2VwZCJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZU1A+wAKCRCPgPtYfRL+ TmE8B/4+R8UdQTyzVId2Y5KghT3jOlnVGcrlwPCYjGXUxBdn5orhi2SpN13OxnlaQcwfOTfyGhz wL9aJEod+w/fRiUVXvW9eDu90T9p9+0w8ZHpe0zV36adsT9hE6lqfyXDNmmOBCNxyia/LPIrfdZ D2jDnSXAHOLKKyXqLqvrVfTXneT4WFz0lkx/P5824KSHMfcZySPfqF+TAn8znuph3KrEc9aj2Tb SxX8sASUIE+NG2neTkASHaYKcsyL57R8lMOg2RC5UxCggM/6Jaq6gnrD4as3JpouexLwLjddOq8 N+GoHau3t/0hOzIVzVSYXhvvFpTzDtHIVlsSX+WgF7qfvSWj 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:34 -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: 1782119692251437743 X-GMAIL-MSGID: 1782119692251437743 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 Reviewed-by: Tony Lindgren --- drivers/bus/ti-sysc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c index d57bc066dce6..490841dbe0d8 100644 --- a/drivers/bus/ti-sysc.c +++ b/drivers/bus/ti-sysc.c @@ -3387,7 +3387,7 @@ static int sysc_probe(struct platform_device *pdev) return error; } -static int sysc_remove(struct platform_device *pdev) +static void sysc_remove(struct platform_device *pdev) { struct sysc *ddata = platform_get_drvdata(pdev); int error; @@ -3412,8 +3412,6 @@ static int sysc_remove(struct platform_device *pdev) unprepare: sysc_unprepare(ddata); - - return 0; } static const struct of_device_id sysc_match[] = { @@ -3439,7 +3437,7 @@ MODULE_DEVICE_TABLE(of, sysc_match); static struct platform_driver sysc_driver = { .probe = sysc_probe, - .remove = sysc_remove, + .remove_new = sysc_remove, .driver = { .name = "ti-sysc", .of_match_table = sysc_match,