From patchwork Wed Dec 27 21:02:29 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: 183562 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp1666057dyb; Wed, 27 Dec 2023 13:04:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IEhWD/EMPtxk7mqhskaKLJV5QzoehvU97w16GG+t9Km8/y9RchpYvelJgh7qlXR6zsJVoxF X-Received: by 2002:a05:6a20:1592:b0:196:4680:5de9 with SMTP id h18-20020a056a20159200b0019646805de9mr126546pzj.84.1703711075249; Wed, 27 Dec 2023 13:04:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703711075; cv=none; d=google.com; s=arc-20160816; b=qJG7VmU5AiDaQ/fijAHRyQYyG0/6J0hhiq5IfKKDOovPTTDEAj32dH+tkJeJLU6+5J TtwNqCEJeI/2S7LkY9hevmcN+NLAGk6d+R7V4Zgdh9CERqjl8laIvoAdFVL/jwuM9wG0 3N+Lo1kKjvWhhuk/5S7j2Viskqcbxv/HByxVGvHEuoMnVW+y8KkEBaGIzHypxcJw7kPQ +Lvx3vyeRAsu0CeOQ122Yb1wzFkrxAlvU3DwJ8UDBl+y7WH4Fx5hPMZiwwbALIdPWtQv bBD5JV4+aZbolsb3ZlpC3ueY1PhdzWbD7+W13Pc3+mvy7SL3psZXyeQMOP+qlQ49vOMA Ct3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=Slb4A2s7t32EWnQ+QxsWp6pCdhuqWr8djZdjXRe0I5k=; fh=9apTFCoTOjehv4Wznv2mb2xpDvZrq4o37EMnyVq2a9A=; b=vOqohOQtaCeU2lK/wr+dk4FAZsLFgnDPhe61yQ/OzQTF7pTfFbRdSvJbyagNec0oEG Q1C50Vy3lUD58GOv0VthOgggzQWkW010HL+1GxC48h7l+r4qpeR25t9myIbiJd9bsJD+ DLda/dsv0pEDbcFv0/+ZjMuMCH9lEGDBGxGuLdk/ZD+ej7pC9Z6HC+J5tTfy/HmSIHMc YBG4lr+yHEbWhtKEaKJVmQ06dLHT9d6HlB2mAN+l8k2i7SwZibf//4eH5lrbv9CRSwyL EQ3uXfmLfs2FZQ0lUk9jccNPy/TNYqMACXVKof8rCFkZloKACTN8FF+ZvI+iQVIHt7OZ ErxA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12262-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12262-ouuuleilei=gmail.com@vger.kernel.org" Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id il4-20020a17090b164400b0028c40644383si7167075pjb.68.2023.12.27.13.04.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Dec 2023 13:04:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12262-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12262-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12262-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id E8C83B22943 for ; Wed, 27 Dec 2023 21:04:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 23F7349880; Wed, 27 Dec 2023 21:03:04 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5681147F53 for ; Wed, 27 Dec 2023 21:02:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de 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 1rIb3I-0000m3-U9; Wed, 27 Dec 2023 22:02:56 +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 1rIb3H-001wEl-Dx; Wed, 27 Dec 2023 22:02:56 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rIb3I-001ZVH-1S; Wed, 27 Dec 2023 22:02:56 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jassi Brar Cc: linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 01/12] mailbox: bcm-flexrm: Convert to platform remove callback returning void Date: Wed, 27 Dec 2023 22:02:29 +0100 Message-ID: <0350a37650c27dddd81514627f51ce8278979428.1703710628.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1940; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=FFehYL1Gn3qYjpBCEFKip15UQ3w2S8PSDK17hMiB7oo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBljJDmW5WaRVDaTExhDJ2dHaJ0e/+Dtkte2R0Sk UcrLi9+EYeJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZYyQ5gAKCRCPgPtYfRL+ TgTTB/sF8nPHGkF89/EAWpe4KhSmfHU92qIjexhsoHCpltQJKdVDYAWXYP1cLRYgyM8FBlGuSDy pgTiX/bzMpQpWvlafPN6DdE0nDqA0ix7J5HFh3V4IPNDCriCjDG2l19h3IBz80p+poBdNgpXmuA 69mz/ep4fooRJRQVLdmOI4WnyEktgWjdpf3mYij6lIdCWFXYZvKuRjCfpnUeDLjjUOKneVkQ5gc 8sJe/aIFhWSfTrS5dChE9W4MTSHD0FvJw/K2Cmh/oJIkUSCjP/qTQ0RDzXpAv5wQkkwU3hwOErQ F+dNjjSzrJfg5dhJtcadg8SySzyYwx73I3ZO2hm1V8jT+zxE 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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786470544133967146 X-GMAIL-MSGID: 1786470544133967146 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/mailbox/bcm-flexrm-mailbox.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mailbox/bcm-flexrm-mailbox.c b/drivers/mailbox/bcm-flexrm-mailbox.c index a2b8839d4e7c..e3e28a4f7d01 100644 --- a/drivers/mailbox/bcm-flexrm-mailbox.c +++ b/drivers/mailbox/bcm-flexrm-mailbox.c @@ -1650,7 +1650,7 @@ static int flexrm_mbox_probe(struct platform_device *pdev) return ret; } -static int flexrm_mbox_remove(struct platform_device *pdev) +static void flexrm_mbox_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct flexrm_mbox *mbox = platform_get_drvdata(pdev); @@ -1661,8 +1661,6 @@ static int flexrm_mbox_remove(struct platform_device *pdev) dma_pool_destroy(mbox->cmpl_pool); dma_pool_destroy(mbox->bd_pool); - - return 0; } static const struct of_device_id flexrm_mbox_of_match[] = { @@ -1677,7 +1675,7 @@ static struct platform_driver flexrm_mbox_driver = { .of_match_table = flexrm_mbox_of_match, }, .probe = flexrm_mbox_probe, - .remove = flexrm_mbox_remove, + .remove_new = flexrm_mbox_remove, }; module_platform_driver(flexrm_mbox_driver); From patchwork Wed Dec 27 21:02:30 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: 183561 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp1666047dyb; Wed, 27 Dec 2023 13:04:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IHZ24emZFgdKmpluKPXLwgXQ819Aml1rTGkM/Jj2BW4tL/017LmTD1BhxtkS6N4Xfsm1FRw X-Received: by 2002:a17:903:2344:b0:1cc:43af:f568 with SMTP id c4-20020a170903234400b001cc43aff568mr9875644plh.6.1703711072956; Wed, 27 Dec 2023 13:04:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703711072; cv=none; d=google.com; s=arc-20160816; b=z31ckfQGPWxyBhvLRSoOPjGZH+xUqzJrlac8B7SX8GS3miRW404hiYDOa1ljGaPFd8 Gwdp5JZBUOdntQZ9O4MohToT4baqrBqnSVm9U1YCSRmt3m6Vhb0Zq5awseNHLsjKgE7v IksDqSSR8tzt0ylzy/sO9/iUQrTwBMVezefi/lfm6tGQ+LnVig2bb9rssty+iZsmqhf8 J7PHIPSMdevB/1YHGvofqdkXfplnIIIdrq0ys2OFJKG0jhELUekzezMWS6XiliH/ZaX6 6u6j4IhvT6FiDXxyfZp0seM/rKroqVLIolvHmvWhB0/n2ZscARD9vnrOf8XJxQwp/XXh jopQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=VxQVfVniJXSlLdT1ccceUQpoauyNN4Vc69mlNk2EhJw=; fh=9apTFCoTOjehv4Wznv2mb2xpDvZrq4o37EMnyVq2a9A=; b=FDAqOhYcoglxNwg2jbgZ0rQFpTLtnKQaJrzhR1g/pUjYMC21pzr0zYv4LwT2g56yYD dE/dP8ADZ4iaSjT8LRJhmkGc/wwhR7xDGh/BL8W+ANfnoM9x3FODnrWCcB7L+CiilquI 5do+s7W1A7rmMTQSXFA5HokTopIK3uW38b2vkx0cgC2xUdpxKs5s3GNgTRoAHtnx7SGt 6vZafMUWYr4tFtnaICxFpV+kt4RvJHkg8Z4Roj6Y/5Qd9lqS0gDOmYxXuSGWx6Y89J6X v8iDPWN244Ca0ATWZw+oIOPDiFaM2DkBv0s6WF8X4KoZuu8CXrBE+8jfOBh0G7l2m4Aa utnQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12261-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12261-ouuuleilei=gmail.com@vger.kernel.org" Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id a23-20020a170902b59700b001d3ed5570e6si11657049pls.531.2023.12.27.13.04.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Dec 2023 13:04:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12261-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12261-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12261-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 6A796B2291D for ; Wed, 27 Dec 2023 21:04:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 187A2495FA; Wed, 27 Dec 2023 21:03:04 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5684B47F78 for ; Wed, 27 Dec 2023 21:02:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de 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 1rIb3J-0000mE-6J; Wed, 27 Dec 2023 22:02:57 +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 1rIb3H-001wEo-Md; Wed, 27 Dec 2023 22:02:56 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rIb3I-001ZVM-2I; Wed, 27 Dec 2023 22:02:56 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jassi Brar Cc: linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 02/12] mailbox: bcm-pdc: Convert to platform remove callback returning void Date: Wed, 27 Dec 2023 22:02:30 +0100 Message-ID: <44de4bb380b6af0be33eaf8cf96d767ed7608a36.1703710628.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1741; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=jveChMb3h44uByjcawnGUpyLJqMmp76ass0nnH1hY1A=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBljJDn9BM0ryFt/JmZOCM418wpd3Zmu3v/321/P Jf/1Sq+17qJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZYyQ5wAKCRCPgPtYfRL+ TnbMB/4+AiEoxUh4Rj3VweDs+RMtUOGfU48l2YhH2whN8mjFzIAIUrGWD1FPU1pWsVgejCeGcur ++/ur4Y+cw1CSQX1UXjG4Bh6GtrMxxHxX9c/j0ElXYRi3MkKKZDL7j60owkY2jJiTOZo86hMLie osli7TD/G2Wc9455gUr+hYc2xeMT5i/ZpHCakvPGNXDQ9tb+42b3h9qyWzsmcvyKgW8Xk10+yB4 4ccmNxkf6rg7U/kZnsZM6sxNiGryMiNuqdUlgq3XMwtSkJBAiwjbAV98aZTPFK8aL+yU/3dAOvs n/KCoRFLdmXgVVqQMxv/hI2lED7vfaXec4jFRRa3dGLaJX39 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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786470542009160949 X-GMAIL-MSGID: 1786470542009160949 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/mailbox/bcm-pdc-mailbox.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/mailbox/bcm-pdc-mailbox.c b/drivers/mailbox/bcm-pdc-mailbox.c index 778faeced81e..1768d3d5aaa0 100644 --- a/drivers/mailbox/bcm-pdc-mailbox.c +++ b/drivers/mailbox/bcm-pdc-mailbox.c @@ -1605,7 +1605,7 @@ static int pdc_probe(struct platform_device *pdev) return err; } -static int pdc_remove(struct platform_device *pdev) +static void pdc_remove(struct platform_device *pdev) { struct pdc_state *pdcs = platform_get_drvdata(pdev); @@ -1617,12 +1617,11 @@ static int pdc_remove(struct platform_device *pdev) dma_pool_destroy(pdcs->rx_buf_pool); dma_pool_destroy(pdcs->ring_pool); - return 0; } static struct platform_driver pdc_mbox_driver = { .probe = pdc_probe, - .remove = pdc_remove, + .remove_new = pdc_remove, .driver = { .name = "brcm-iproc-pdc-mbox", .of_match_table = pdc_mbox_of_match, From patchwork Wed Dec 27 21:02: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: 183565 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp1666066dyb; Wed, 27 Dec 2023 13:04:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IGrM5mFUFgEwXrckjBKEdVrA78+UDnUDM+jJtJqT98Z/mAZb7Ph0lMit1v7JjU+jIjnfzQ9 X-Received: by 2002:aa7:998e:0:b0:6d9:a856:ec9b with SMTP id k14-20020aa7998e000000b006d9a856ec9bmr6917459pfh.25.1703711077542; Wed, 27 Dec 2023 13:04:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703711077; cv=none; d=google.com; s=arc-20160816; b=BnYcvaaUOG5YTBA9X0K6U2mC/bd1HcIcQ8AcETZh7u28vl/E4fmTS8YXCy3lqpjMOT y6MaKSZRPqpIKfDrGprABVbQ//6iboumGTrI2djfJ3Nm2ZmRRNBaEAC37tJxUE8NW3Xr +ia6ueuINpX4ciPFwFVefZSn9u+cwcrVONqu8EyWdviU9CAYlMNMaYGzXM3XE1Oj37Yx GOwx/zaFp4RxGgNQROhR3wQbyPdMO+t2dOhKyfa7IBh7JStI6LUemGSlBexxiDUX+BI/ MnACnHJOx2uDENBqZvsrr3jXxdhmhNJBawxHR0K3s1FN4/6BITJ3COPzdOGA6mVW8gRc YsEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=QPgSQGtHC0iwqzU7zRiU2EM3jg+35c1QbIzYsPSzag0=; fh=9Ymq9WTXqHRlhbTIgATkHrbGXdIaHSZtaGutPygdzak=; b=XYb9z5/SjRpArUG7NWrHHYVrG3hBmemuHc3yponGw4BlEZOF9moxZFdZtPjGPvq9/y 7SYsrmzlvsicr9oylNVolgG6ppxUWfvqaaZ1EO01iP+ygks7LQPZPnRrox3MgrHIAxTn mzPt0xxzNHoo5ZC0lqREFCmuHPl9YVl+f+HaIT2uTuXiQO6blCt0u719VT77r1FySo85 IfFPsgJGT7dB6Z9i0F9UmilTPJ9qWgkhqSWoZGmIf66OoKyfgch1MJqrkHohVqO6c6gj 4k1lprYe/61B4OMOh1HKlg53ohWP0I/fNfzH/2wYSyeQC7goDmcFYU0UGc3K+/tTjSnM aP8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12264-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12264-ouuuleilei=gmail.com@vger.kernel.org" Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id p8-20020a63e648000000b005cd88585706si11583599pgj.828.2023.12.27.13.04.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Dec 2023 13:04:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12264-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12264-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12264-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 2C125283EAB for ; Wed, 27 Dec 2023 21:04:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1DAF249F7E; Wed, 27 Dec 2023 21:03:05 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5A37F481A5 for ; Wed, 27 Dec 2023 21:03:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de 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 1rIb3J-0000mR-JU; Wed, 27 Dec 2023 22:02:57 +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 1rIb3I-001wEs-02; Wed, 27 Dec 2023 22:02:57 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rIb3J-001ZVQ-01; Wed, 27 Dec 2023 22:02:57 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jassi Brar Cc: Shawn Guo , Sascha Hauer , Fabio Estevam , NXP Linux Team , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 03/12] mailbox: imx: Convert to platform remove callback returning void Date: Wed, 27 Dec 2023 22:02:31 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1729; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=tu7OGIAh4t5eSo5RkymTUYbo/0xSaIoNAc2ogwnsVgo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBljJDodYLH7tkz1QmIENibmLSj5ppFvhRT8H2EQ iVhsDahxNyJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZYyQ6AAKCRCPgPtYfRL+ TgfFCACPAWNWZETI1tvYwCrw2K4KfE4KqyAXJTss7x7RZKwriOCHeV05ZuvPw3lhNC0qyk9FoZj Z0LwpZq+kn4+yHziqi6i05zT71n51CZNdTQ2kSm6fMd4XxYlC/O5FGYKcOMLLTx7LBQZ7HuiYYl ZsK0Av6p9SLZbIkW770H8l8YmXbFb1ICniZ8xda0nUV37u9lToGXiH1jPdgHP3GdSbL9YsoCqxS PqhBOziRKbN6KRzm8SMjAn9YEbOYXd9KV6PjldGpuiwpv0UGDjlHeRi8u9I0KQcwrHaJuo/BZO6 OmITM3R0hpu1/G7u9Cp7S8D1+F6aoc6rSHhFi4GcNsFCEynj 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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786470546817448571 X-GMAIL-MSGID: 1786470546817448571 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/mailbox/imx-mailbox.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mailbox/imx-mailbox.c b/drivers/mailbox/imx-mailbox.c index 0af739ab571c..656171362fe9 100644 --- a/drivers/mailbox/imx-mailbox.c +++ b/drivers/mailbox/imx-mailbox.c @@ -903,13 +903,11 @@ static int imx_mu_probe(struct platform_device *pdev) return ret; } -static int imx_mu_remove(struct platform_device *pdev) +static void imx_mu_remove(struct platform_device *pdev) { struct imx_mu_priv *priv = platform_get_drvdata(pdev); pm_runtime_disable(priv->dev); - - return 0; } static const struct imx_mu_dcfg imx_mu_cfg_imx6sx = { @@ -1070,7 +1068,7 @@ static const struct dev_pm_ops imx_mu_pm_ops = { static struct platform_driver imx_mu_driver = { .probe = imx_mu_probe, - .remove = imx_mu_remove, + .remove_new = imx_mu_remove, .driver = { .name = "imx_mu", .of_match_table = imx_mu_dt_ids, From patchwork Wed Dec 27 21:02: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: 183559 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp1665455dyb; Wed, 27 Dec 2023 13:03:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IEBq9a/2GzWhSTPo7z3rwzmb6lDlgnZEZAFEAq8meERPjs5Zq5yXUiaFViFRMYa/MHpX5rY X-Received: by 2002:a50:c018:0:b0:555:3b23:1d60 with SMTP id r24-20020a50c018000000b005553b231d60mr1673665edb.51.1703711009663; Wed, 27 Dec 2023 13:03:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703711009; cv=none; d=google.com; s=arc-20160816; b=aRLIxL0nXInOXew2wz78cAPXydjuvn8c09/U5wneT0HNMpMmGdxfi37f7XSg+kmB0F 7efy9OSdHGUgfzKgJ/I8nXJfqPe3URjpas82K+xe6LWDpFZJ+L/TEUzAfsP5C9eXvbMw xAfvvr2532H4NWA6d5U+jkG9qJlwzRjnD+oW1Cdw2sZUdHhlyqfrdk/0s1mBm75RKyzL uk4WerDeAaUZdXT8qZp2H9QWuYAzPIRQn4eMWIGfrKTa+5TQhmHkn/0x8mizZrM/t8oz AK3TbJasMI+WH3XXRX3Fo96SwMLgWsPAAkoGe5hQzuRJVALYFMYJ7NemMyrxEF8RoGHO jwFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=GL5PB6fSFH6vkmrxY+bh/EmaqAcTkBrj5oOpcerlx50=; fh=9apTFCoTOjehv4Wznv2mb2xpDvZrq4o37EMnyVq2a9A=; b=DTrPmMUABiZq5LDBi9hTGEgTO2Cw2rQJhR+apA+BVgiSl6EFgNCjHY4fvv0TaLdKO7 mO8DPtKffGT8lGTQUovamDolABp2z7QRvr2xNMTcO9RgONGB5xmHYJFi+85Hz15URVKH WvLfUwbJ1MrojP1h2ipIAYtLuK7MkHobxeMGj6atq+d1V6oXfF3yQE1k4DVhQpihxDop nD2yNeWBzCh9wM1iF8O8nacieOl14kNSjNCQdhySLNKvoHV31Lsi4Zob67NZS4QdqL+l rDpdLaY/7YusYCUMF1RDWe5G6uDhyNK5OMD/gl6/yFiWKl6cV7V3gKBvf7v7cWyHy6dY LIeQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12259-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12259-ouuuleilei=gmail.com@vger.kernel.org" Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a3-20020a50c303000000b0055511698b5bsi2016044edb.387.2023.12.27.13.03.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Dec 2023 13:03:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12259-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12259-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12259-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 4B11F1F22FCF for ; Wed, 27 Dec 2023 21:03:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 283884879B; Wed, 27 Dec 2023 21:03:03 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D547A47F79 for ; Wed, 27 Dec 2023 21:02:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de 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 1rIb3J-0000mc-Nc; Wed, 27 Dec 2023 22:02:57 +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 1rIb3I-001wEw-7j; Wed, 27 Dec 2023 22:02:57 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rIb3J-001ZVU-0m; Wed, 27 Dec 2023 22:02:57 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jassi Brar Cc: linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 04/12] mailbox: mailbox-test: Convert to platform remove callback returning void Date: Wed, 27 Dec 2023 22:02:32 +0100 Message-ID: <919a9e77958e3a9fee3e473fd714c4add2991b33.1703710628.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1875; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=2Acds6dO5piUOAVFehlpJWz3DbSbQSTHBdOgG/XhSGc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBljJDqNnoboat7qdmB2aD1OkkF8K0e5IDZbr7Lb NgGvZfkKPKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZYyQ6gAKCRCPgPtYfRL+ TrtbB/kBNSNYr6CiYZ5+Iqb+3kPQ5dPw3J3J17sxWCdHG2fK1X3m7VoIK6/E2QiRHQDMjthjFdg 1HDhwGWDkklLUXI5okyKPtdeWPHixZXx1joX8U9Zfm3AqmUlPen+bl6HypkPDENKqwUn9Z78Cwp skP7eDM0aCZ3zWk2G5u4rY6GlO7vtvTJLQTAADtS2ein/bi2V3KJixCQ96ss87nXXE72jR4QGyS /Gu0AuWDVay78xUapUcBsladtb7IzUNGmn4Y1PnjTwThtNx6ZtRiLf/+IeJFK9HUyYPGLJP9yTi z0dKoLmKwQOCsR+jxXlUMd8NBSZDrxR/Svh1b35sSKK+DUvE 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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786470475440669367 X-GMAIL-MSGID: 1786470475440669367 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/mailbox/mailbox-test.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mailbox/mailbox-test.c b/drivers/mailbox/mailbox-test.c index 22d6018ceec3..3386b4e72551 100644 --- a/drivers/mailbox/mailbox-test.c +++ b/drivers/mailbox/mailbox-test.c @@ -418,7 +418,7 @@ static int mbox_test_probe(struct platform_device *pdev) return 0; } -static int mbox_test_remove(struct platform_device *pdev) +static void mbox_test_remove(struct platform_device *pdev) { struct mbox_test_device *tdev = platform_get_drvdata(pdev); @@ -428,8 +428,6 @@ static int mbox_test_remove(struct platform_device *pdev) mbox_free_channel(tdev->tx_channel); if (tdev->rx_channel) mbox_free_channel(tdev->rx_channel); - - return 0; } static const struct of_device_id mbox_test_match[] = { @@ -444,7 +442,7 @@ static struct platform_driver mbox_test_driver = { .of_match_table = mbox_test_match, }, .probe = mbox_test_probe, - .remove = mbox_test_remove, + .remove_new = mbox_test_remove, }; module_platform_driver(mbox_test_driver); From patchwork Wed Dec 27 21:02: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: 183563 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp1666059dyb; Wed, 27 Dec 2023 13:04:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IG3TCdP5xFaIIR/Arf4KlmVYw88yPm8PqrCXZFY0zC7n/ohbqO0EhldExMLregYpb/5zfMc X-Received: by 2002:a17:90a:ca8d:b0:28c:59d4:328c with SMTP id y13-20020a17090aca8d00b0028c59d4328cmr1475366pjt.0.1703711076233; Wed, 27 Dec 2023 13:04:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703711076; cv=none; d=google.com; s=arc-20160816; b=Y66gpYcWzjaTUC84CpEokPZ7Q7HrM6oEhHWd/PiMKj/F+4fMYuePPWnhoao5P/9m05 AgrhCBY0+s9yCshgZ6kdNU+8O/aA3aYnWpwcM3IhWmFNVmsgelQRKfMB+L2tMms/JATN 95obw7autgoet8Grtz2689XRK5bdKZ3fYNodd5Rj1shRzfKlhC475FaOVz0Rt3ePyATT GA7tCG2NiJobPj4zgSz84R6Mbcalvy357aUsVS6zlw+RnORw7ngAe12AM/f+3TM7Smux QIblX9+DdjzLUB8nDBp1LNy/dcNfWBKQb9LQZHFxbwkVzKBcqR3CJHRAz+9dj520nLrh Xdwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=v1RYVPQ+cqXrvts9368eCgn6SwF8b/8GqQCx7e5T4sY=; fh=z4HjrJwmYgM1r117KhxHSIDUwLCVz2Y2QOLaNoy+ED8=; b=T2L4xN83ubhJG9MFxhwUjdYUS4QB9+kpbqmxIDgtrMD9UOpfZxxVJ+o8capKW/tIeq GahqVNeWKjCVbkLBO3MQrKVBm3lV65q1q/1JXahOMbj3En3dgL/S9cpE4a4+FNoe7gpl 4ZW/a63JMrzfK2wf9vyb9m7/gu8noMz9vPJm4XOxGGrinaE9t+ZpAuJSckwP1vZENYqR rLqaSM52fiJAKkzhxV1oDwV4HR+Xb4eqALqVrMLkKPVpwSPzPJn47mJNc5HQk6lgvX9n ObHoFFgZEj4xszzdwi/doiYyRURmRCbsrTl3WDGGiQyylTdfEPJUpGlu3q5pg6qg6p/9 F40A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12260-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12260-ouuuleilei=gmail.com@vger.kernel.org" Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id m12-20020a170902db0c00b001d3a491ae3asi8656128plx.538.2023.12.27.13.04.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Dec 2023 13:04:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12260-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12260-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12260-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id B608FB22A07 for ; Wed, 27 Dec 2023 21:04:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 24ED049881; Wed, 27 Dec 2023 21:03:04 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 966F347F7C for ; Wed, 27 Dec 2023 21:03:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de 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 1rIb3K-0000pG-42; Wed, 27 Dec 2023 22:02:58 +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 1rIb3I-001wF0-KN; Wed, 27 Dec 2023 22:02:57 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rIb3J-001ZVY-24; Wed, 27 Dec 2023 22:02:57 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jassi Brar Cc: Matthias Brugger , AngeloGioacchino Del Regno , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 05/12] mailbox: mtk-cmdq: Convert to platform remove callback returning void Date: Wed, 27 Dec 2023 22:02:33 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1853; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=gNPFN0uAuZF4HtjtcHLTvZm1u6vrMLv8Z7jJatbefZk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBljJDr7aKKKkVi7JPQZLLyFYy5nVbjgdGseMIZH +nO7DQaZKSJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZYyQ6wAKCRCPgPtYfRL+ TirnCACWp3emXtbPKi6jzWJqse5aOSB0rU4Fj6ztni02KHtV0f8QZ8mlamimBQs1wwAFg3JamtL vtLD4W2EKwQr/k7CfonS4FAniuFJo5arz0+UqychTpBJ9ZY1vjHltDudQ6NyiqSbuNfEQ9znAID QYQCNrizRfXOn+Da8HpY0QMUoj3HEsb3SyzjnE8dDrM0aZcGGcUlKbKUq5ZzPKBEbYgKxVB7VCi ZkKEV1DeW1j9lqvyr6x6b9w95nbTQiClhVqqDKA0jEgJkeZDfpnRVaMXM9cz6uVPhREyAUtTDQ5 6JE6oYD9RAd4NQ3d/t5saKBBj1HXwkt1vcbwzKv24K8YHXqc 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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786470545101609815 X-GMAIL-MSGID: 1786470545101609815 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/mailbox/mtk-cmdq-mailbox.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/mailbox/mtk-cmdq-mailbox.c b/drivers/mailbox/mtk-cmdq-mailbox.c index de862e9137d5..c9009b729ab2 100644 --- a/drivers/mailbox/mtk-cmdq-mailbox.c +++ b/drivers/mailbox/mtk-cmdq-mailbox.c @@ -367,7 +367,7 @@ static int cmdq_resume(struct device *dev) return 0; } -static int cmdq_remove(struct platform_device *pdev) +static void cmdq_remove(struct platform_device *pdev) { struct cmdq *cmdq = platform_get_drvdata(pdev); @@ -378,7 +378,6 @@ static int cmdq_remove(struct platform_device *pdev) cmdq_runtime_suspend(&pdev->dev); clk_bulk_unprepare(cmdq->pdata->gce_num, cmdq->clocks); - return 0; } static int cmdq_mbox_send_data(struct mbox_chan *chan, void *data) @@ -761,7 +760,7 @@ static const struct of_device_id cmdq_of_ids[] = { static struct platform_driver cmdq_drv = { .probe = cmdq_probe, - .remove = cmdq_remove, + .remove_new = cmdq_remove, .driver = { .name = "mtk_cmdq", .pm = &cmdq_pm_ops, From patchwork Wed Dec 27 21:02: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: 183560 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp1665981dyb; Wed, 27 Dec 2023 13:04:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IEcz3mr4Y7ObQRxoz/vy+3hNBtdAAldb2QzHlclnnrv7VPr4RodRTeu+TqT1hPbd/l8XiOi X-Received: by 2002:a05:6102:4704:b0:467:2aa9:83be with SMTP id ei4-20020a056102470400b004672aa983bemr1165587vsb.19.1703711064108; Wed, 27 Dec 2023 13:04:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703711064; cv=none; d=google.com; s=arc-20160816; b=RoHcpLsYlxwk+bAjMWgJuBy8RZoYl8vsIUNc14RFwArglEmzifRi3YkDmwY5r0lA/v KeXPL5Ok63KQt9IPMDQ8e3MkVQbYE+GhTtZEuco4SkiNg7zr//I5v9YXMKewDQZkODsg xm0S3Dos8WEEoMzSfot/Y5lk+JBMrB8W+Gvh4a3dOpKC8ApyREOx4Jnq9eYbOgLmEGiM v8QmqkK1Q1dPYM9M2C8TN9FTrz2bxmcplXtRsKLkbQxHXQx2NwubRaGM24FZ2usl7MWQ ySiRW0wjzk5p7T/iwDmzQxomGf99Djiy8waicnfyfqzNOYVBkbXhW9nuM8T9u8sICwhQ 8kTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=gnOvMUG7ElqmexHtlC83aYMX/sHRc/KbJXc0tiD4u0g=; fh=9apTFCoTOjehv4Wznv2mb2xpDvZrq4o37EMnyVq2a9A=; b=T1cRp2KhniXIJ54W9y4FsiMkFTsEqhwWSeLy2lN3+jRkl5/FqES8HMK5UHl9EamOun zyblPFV2Aaufi8c6aJBl3yAEsR6LjdLHWzFHY1slyS/ncTDIuPyrUqz8z+W+d6ZBKKqX go5GCmSB455sGWSnWFE56I1wDI5B7ivAoP3uEgpMJwoJSOUQ3hNlHvOoHlsYiO4Emfjx EavoMzIRB5AvQI/xtJXm6uq58fdM/5B7/rTfF76Wak2xVwDhSgLN9rzL6/GL4+AIrsQs qgVCCnKcRmwGtaTNB3Lyu8PO1c5J+OYEX3ZuUTUBWUEgqiQ5hukF9o+FrIhUWFmr4mbn Uy6g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12263-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12263-ouuuleilei=gmail.com@vger.kernel.org" Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id jn19-20020a05610219d300b0046705547387si762061vsb.657.2023.12.27.13.04.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Dec 2023 13:04:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12263-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12263-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12263-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id DA56B1C226CB for ; Wed, 27 Dec 2023 21:04:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A5492498B7; Wed, 27 Dec 2023 21:03:04 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 950A047F7B for ; Wed, 27 Dec 2023 21:03:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de 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 1rIb3K-0000qs-Ib; Wed, 27 Dec 2023 22:02:58 +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 1rIb3J-001wF4-0r; Wed, 27 Dec 2023 22:02:58 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rIb3K-001ZVc-08; Wed, 27 Dec 2023 22:02:58 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jassi Brar Cc: linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 06/12] mailbox: omap: Convert to platform remove callback returning void Date: Wed, 27 Dec 2023 22:02:34 +0100 Message-ID: <466062f1ff1438a22f79260f529a1c2cc233a150.1703710628.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1656; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=j0aEwW5V8+ktwBY7iIhfiCa+CFqdltoLToqYeqCXqXY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBljJDsFhgpgYrjS7XbMKMaLE98yrtDfwKEB3n+Q RZes6RQi4GJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZYyQ7AAKCRCPgPtYfRL+ Thh1B/wPx0HuQZFnGjuuBLvOPrEQwVIO3XWlHql/3OUqpVyaTHqSr9XxEJAM/xYz1+NEPKr0rpb QsPcpQVRd8C6cLnAKwcbsnBkVBxf2w4r+9bNnSPShf1odyY0+oF4Ifz/VwdPQLe7DihdRiaWqQS QtTH85MbKOjcGE/1+Fh/M++/dtBtHGW3aJsUAFHCJZAhwRdJBBSBAT6NYVJHgBuD746NLVnnwZb ifijaU2zEYJBWSnJRlOgEIcA94rNIx7WdUkF4ex72eRJG63SMrovOSgqrgkczx9BxIKSGJRIMKs UmK7PW8zUu2S8TxwerNew41UPZtFCcBY3Lbz26L0uszRl5Ck 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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786470533027742676 X-GMAIL-MSGID: 1786470533027742676 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/mailbox/omap-mailbox.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mailbox/omap-mailbox.c b/drivers/mailbox/omap-mailbox.c index 792bcaebbc9b..c961706fe61d 100644 --- a/drivers/mailbox/omap-mailbox.c +++ b/drivers/mailbox/omap-mailbox.c @@ -865,19 +865,17 @@ static int omap_mbox_probe(struct platform_device *pdev) return ret; } -static int omap_mbox_remove(struct platform_device *pdev) +static void omap_mbox_remove(struct platform_device *pdev) { struct omap_mbox_device *mdev = platform_get_drvdata(pdev); pm_runtime_disable(mdev->dev); omap_mbox_unregister(mdev); - - return 0; } static struct platform_driver omap_mbox_driver = { .probe = omap_mbox_probe, - .remove = omap_mbox_remove, + .remove_new = omap_mbox_remove, .driver = { .name = "omap-mailbox", .pm = &omap_mbox_pm_ops, From patchwork Wed Dec 27 21:02: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: 183568 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp1666476dyb; Wed, 27 Dec 2023 13:05:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IFtyr66DEqDvug0Ea3av6d5s044fO83kd2Jf3UzSp6Yt8IrQwURAujBcBttYLgUHlYHuafG X-Received: by 2002:a50:d594:0:b0:553:627f:4e42 with SMTP id v20-20020a50d594000000b00553627f4e42mr5942772edi.62.1703711125407; Wed, 27 Dec 2023 13:05:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703711125; cv=none; d=google.com; s=arc-20160816; b=qOe8mkI49ZeYXn88RLAFdHFXqGy7UITMppr/+iptf6jCHP+BgjFKhMHx8xcWo50HHg s+nD3IgyB6KlQrunAS9lwYFSPSS1YB/h6V/3nba2XUkd4oq2w7y2g8VDydxGuXzaC5/K vAkXVBmcUKd1l/UGRLFBMjj7W2wvXypts8GAfJULbPhaAfcfYMNtb+4owX7RzGr45GQ/ Hqk4m1gggHEHj8r59qjGd/3sgyEIdVDlME+BOBNVQ1Iuxw6qe9HuHmXX9ThRmCFtlRFq fTdrYeSFF6lkbtWJFSZzTC6K822jI387/Ko2WFdiqRuCVJ+GUGZRD+QQGe7Tu9sNvnec LSOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=br4nwhG/7+sedI80hlhJVXD6xzDkEs9QoRN6ghrfY1Y=; fh=ax4FSYr9I1SdS8MqkaWGX+cj0c6MLVEwxkFmfLyvOTU=; b=rVrStMuAMQMoce7GzLMCppfYumSmYYz6BCmATA2DPQIVXzhnolb7edpaI+sHYntfE9 3xit7BrvAr9Ajp4nx7ZYzh4XcK4kONNAKyLmDMp67h3moIkszelgs6EYQDY/Md8IpB0W BFZ5sfb3crLj9UHrm6AaL8IkIQXPHbyhrbKoko2lJ6kjVMs+rfapkf86lsbT0uAOtp3e GJuDWGGPDQvzLZVRykDHhOPEO0SeAVN9sxXx3L62kEtd+HJtKy77geeiQHPKprzrTSlt ft6cdseBUePXYfZzRPJuifT9sp8gWo/8r8C0OFD5/vzeGu6Ej0QgOf9BmcHTlSbiXx6J sYUA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12268-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12268-ouuuleilei=gmail.com@vger.kernel.org" Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id cm12-20020a0564020c8c00b00553dcc75efdsi6450520edb.584.2023.12.27.13.05.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Dec 2023 13:05:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12268-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12268-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12268-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 0BC8D1F2319D for ; Wed, 27 Dec 2023 21:05:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C99494C620; Wed, 27 Dec 2023 21:03:07 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B3DC8498BB for ; Wed, 27 Dec 2023 21:03:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de 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 1rIb3K-0000rD-QS; Wed, 27 Dec 2023 22:02:58 +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 1rIb3J-001wF8-9E; Wed, 27 Dec 2023 22:02:58 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rIb3K-001ZVg-0x; Wed, 27 Dec 2023 22:02:58 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jassi Brar Cc: Bjorn Andersson , Konrad Dybcio , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 07/12] mailbox: qcom-apcs-ipc: Convert to platform remove callback returning void Date: Wed, 27 Dec 2023 22:02:35 +0100 Message-ID: <9e4c20de4cf16ae8cf03a1844a000a17e4ed1990.1703710628.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1902; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=05Aw79eBvCAd2KreU2oJxdpnDsDvRhiwGd7aMF2V4do=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBljJDt5XSagpy/f9wKNc7ifFv9CjOCUmtb4pRYN d382lA2HM2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZYyQ7QAKCRCPgPtYfRL+ Tho5B/4slMPTrECJh7cRwJNM5OG+HFXibTK9phg2cNi2f7oFi7RzX2fHVe+2AmZCnAAcbvyoCJy VbfJtdkERRfrIwYPGreUAMLJiDfwK4QezgiiIYg/1jmyxYMNL6n07/XOaxndXs1u6tKXXxzbTVa RYtrMvs6DmlFtMSAY6cuJB8tetw2vri+kr/y+yZmM0xB11VFFdQ6LjscPx9VfgNWD04zywbopch mR/QzVVI4U2sHZ1wCJZgExf4tPAyt62l25ytPz8KCYUEBkpbtxm/NmCtmrqRPK2e4lswZ3AsfuZ AiF1GElyr3260sQUDKdC/dfAIGfzSO4dZXcR8RYRiYsGBMOn 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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786470596630709274 X-GMAIL-MSGID: 1786470596630709274 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/mailbox/qcom-apcs-ipc-mailbox.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mailbox/qcom-apcs-ipc-mailbox.c b/drivers/mailbox/qcom-apcs-ipc-mailbox.c index 79136fb62f01..7d91e7c016ba 100644 --- a/drivers/mailbox/qcom-apcs-ipc-mailbox.c +++ b/drivers/mailbox/qcom-apcs-ipc-mailbox.c @@ -129,14 +129,12 @@ static int qcom_apcs_ipc_probe(struct platform_device *pdev) return 0; } -static int qcom_apcs_ipc_remove(struct platform_device *pdev) +static void qcom_apcs_ipc_remove(struct platform_device *pdev) { struct qcom_apcs_ipc *apcs = platform_get_drvdata(pdev); struct platform_device *clk = apcs->clk; platform_device_unregister(clk); - - return 0; } /* .data is the offset of the ipc register within the global block */ @@ -169,7 +167,7 @@ MODULE_DEVICE_TABLE(of, qcom_apcs_ipc_of_match); static struct platform_driver qcom_apcs_ipc_driver = { .probe = qcom_apcs_ipc_probe, - .remove = qcom_apcs_ipc_remove, + .remove_new = qcom_apcs_ipc_remove, .driver = { .name = "qcom_apcs_ipc", .of_match_table = qcom_apcs_ipc_of_match, From patchwork Wed Dec 27 21:02: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: 183569 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp1666556dyb; Wed, 27 Dec 2023 13:05:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IHW4dvXYjraqjB2pltD3nGgkn16638Pne6vxco8IbxjbnCwelmzBU3qx0rlHXpxcR9+cDkR X-Received: by 2002:a05:6214:2b0e:b0:67a:62c5:a5dd with SMTP id jx14-20020a0562142b0e00b0067a62c5a5ddmr13987521qvb.11.1703711133470; Wed, 27 Dec 2023 13:05:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703711133; cv=none; d=google.com; s=arc-20160816; b=BfG3X3gaaBTUcJkxXEUksyWVAbplNC8dEPPLUe631yquXFIUVcvri1XVdFuwV5/Fi8 0G3YtX1L1fSfTGpv93e3uHYjVAbZ1bMBAJ3pAhT2HcsljzeC0QwyVtxbPN1va9nzKE91 TAGc6iDmzA0c5Rkn4SdmKrUriBBGZFj2ONSSO1AFWVllZi+ZkuIdL3eHnkB4888ESSxb IoW6pPcxAyPBJ619apqf065UovDC6T2pC05lImnKX/r89Abn3MN2uXVVB/t7h/6nGgiA uqnKYb13iYQDp1RIdFxho+ReLp2xCNB9yuwaPc/RI1CbhOyrOaM3oHV9XNG6OFgvBk5L zejA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=s947bkXreEXWAD9fIotmVYPMT5K41KgqnZIzMLPzYTg=; fh=y/icm08suM9rP22pqdQlCfWVvFQcNPYJgMd3x1qLZ3w=; b=xBhtUsdw94z6xQxDFlZSEdWpYN4+J/O8KJWSNeWx8Lm0boYqeHnbJUQrjUzo1PLp8c cWmTHf5usjM/fti4K5fjG3A4QmSSzprCy+eeScF4pGVklk8IUe5V1iBtYIlvG2u546Sn SbUeXDydnNRTl4QhQE0XFphbWIBj4VdvxkHWAlXCx0yAa+kbDJC2wNZ0PkIxQkmlxVtV 0RtAs5NbhN+vR9HRLs0bS9m5wKWWSQV0ltYO5H2cOpvNcvqxob921YhhdOYfv4SbL8c+ tcfatUTzOuGfk0wr+R0K2Aliqi2wTqKtWK0aRu+/wW3PgqI1mKutWhYsMkMdv3G7gEaO 3tCg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12269-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12269-ouuuleilei=gmail.com@vger.kernel.org" Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id b8-20020a0cc988000000b0067ed2267b72si15325315qvk.275.2023.12.27.13.05.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Dec 2023 13:05:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12269-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12269-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12269-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 460761C226B3 for ; Wed, 27 Dec 2023 21:05:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 41A1B4CDE6; Wed, 27 Dec 2023 21:03:08 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4E33D49F8D for ; Wed, 27 Dec 2023 21:03:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de 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 1rIb3L-0000sJ-2D; Wed, 27 Dec 2023 22:02:59 +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 1rIb3J-001wFB-HN; Wed, 27 Dec 2023 22:02:58 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rIb3K-001ZVk-1k; Wed, 27 Dec 2023 22:02:58 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jassi Brar Cc: Bjorn Andersson , Konrad Dybcio , Manivannan Sadhasivam , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 08/12] mailbox: qcom-ipcc: Convert to platform remove callback returning void Date: Wed, 27 Dec 2023 22:02:36 +0100 Message-ID: <515f199e83af8a6295d38f0127be230bbbd6098b.1703710628.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1791; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=dQ7xAWwAr+m6oeIQoY8ovO5/17i2OHqeN97W+/12Du4=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBljJDufzD2oU8+z6pomHH+G4A8o2UtNr9z9PhPb vptCsZeZieJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZYyQ7gAKCRCPgPtYfRL+ Tq7pB/9Dmb/jKMl6/r477Ic9N1qIMXfrf4k1YWh8kVn7VLU0tzEVL5PeORJkHj5yqzysrPTJyTf G88OGmEFNY5XtxMN/p4IpCnkixdN0ZR1EWm6uCQhsLhJwwwsuGsJodiXkfDT6fSjIedCH7nDyAE dZcXeVoWOjztd+8ps5A3NYZkXGg7gAQP40tblN6PIIwMocxKsGLNhKtt71tsf61wu9SMTUMmgwl QwyWpfrV1MOUrtwmwW+DHBh2a6TvxNX7iWVBRYnzFIpdGj/OqHJURKPOdMYNXifhfstSrbWcQCI r78rzCbFkV3luWKwxJVYlsYlLH64Q9wlWKDEUgllPAHT4bMn 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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786470605671089002 X-GMAIL-MSGID: 1786470605671089002 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/mailbox/qcom-ipcc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mailbox/qcom-ipcc.c b/drivers/mailbox/qcom-ipcc.c index f597a1bd5684..d537cc9c4d4b 100644 --- a/drivers/mailbox/qcom-ipcc.c +++ b/drivers/mailbox/qcom-ipcc.c @@ -326,14 +326,12 @@ static int qcom_ipcc_probe(struct platform_device *pdev) return ret; } -static int qcom_ipcc_remove(struct platform_device *pdev) +static void qcom_ipcc_remove(struct platform_device *pdev) { struct qcom_ipcc *ipcc = platform_get_drvdata(pdev); disable_irq_wake(ipcc->irq); irq_domain_remove(ipcc->irq_domain); - - return 0; } static const struct of_device_id qcom_ipcc_of_match[] = { @@ -348,7 +346,7 @@ static const struct dev_pm_ops qcom_ipcc_dev_pm_ops = { static struct platform_driver qcom_ipcc_driver = { .probe = qcom_ipcc_probe, - .remove = qcom_ipcc_remove, + .remove_new = qcom_ipcc_remove, .driver = { .name = "qcom-ipcc", .of_match_table = qcom_ipcc_of_match, From patchwork Wed Dec 27 21:02:37 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: 183567 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp1666241dyb; Wed, 27 Dec 2023 13:04:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IHSrSMkCW5Q/0CbF4j1q2EAOVlRgrYVVXoqxS4QSigvRt7+w0BoQyXH5oMfib4Pntzd6Bci X-Received: by 2002:a05:6830:2701:b0:6db:bcb5:a070 with SMTP id j1-20020a056830270100b006dbbcb5a070mr7567285otu.62.1703711099074; Wed, 27 Dec 2023 13:04:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703711099; cv=none; d=google.com; s=arc-20160816; b=X4hS4knhqjDc75Cm/fHMszE2MTBd5hk1eI3u5hNEG4deoMAf+rPnvxcvMSAXMsVMww gjrbWPUcCQsxP7ZRWxtR3wTkmDFK42w58xSkMd6q9lVtyb8X2GFkSikR/oxrMELfPu/m Pk+DqBALKk/e7DrQkzrOomJaVwM4tYnk4iUeFtktM6QLTL6Efnp5vMJE6TxZ5JtP9pEN f/JKcmv2fkIS2Q8AcSsdnelX2eUyrgHC0UGdXBoG4SypARa6o+d15+yLtN94hHup7VIS 5Bkvqr/OtGPsuLYlLuYHHQC1kObDRZjtKURGlW6NU3T0r1aKb9KfR0TbmJORioTBCXCq 6u+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=9tWKVUt0zpPnxmOqo1b98Fq7RU9hgHCaHGKYrftecUI=; fh=3HD5gbcuezV2Fxmhm9lMok37LCQIkIT+lPM9O6eCte4=; b=Q+G8zNzUFxEt/aQrY8LtYBhzoKTTPNX8pcrGZEfuBwlAky+ZIrh+XU4b+5hnSROg6c 8M96pQbC/bc+9ruE9A3gL/mZCT6/bOF9dwmtckyPqUyZcVqE5dtNHgpzfAh/0FUBTSKN 8vku5YL/QeeGN4e7ehzYcwMfOsd8dbo11KlJ7PtPpiIFAmPg7w3dpF4PCs6MTbbapB9m 9ZEk/p6Ep9V8Xlq8WagkmlDhgZzm4YN5hEr4RMMRTK1jiFbnqPqQaH+DQIC2aIdSsoco N1APlq3VUwV+HdrfxvsuYnHxjvFfHdcsP6+Fm78+fi+T6kemRaPG6pQgXQ1cM3t+mkea 72Fg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12267-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12267-ouuuleilei=gmail.com@vger.kernel.org" Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d11-20020ab030eb000000b007ccab350867si928692uam.48.2023.12.27.13.04.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Dec 2023 13:04:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12267-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12267-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12267-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id C00291C2274A for ; Wed, 27 Dec 2023 21:04:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2270F4A993; Wed, 27 Dec 2023 21:03:06 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B0021481A8 for ; Wed, 27 Dec 2023 21:03:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de 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 1rIb3L-0000sW-8N; Wed, 27 Dec 2023 22:02:59 +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 1rIb3J-001wFF-OL; Wed, 27 Dec 2023 22:02:58 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rIb3K-001ZVo-2S; Wed, 27 Dec 2023 22:02:58 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jassi Brar Cc: Maxime Coquelin , Alexandre Torgue , linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 09/12] mailbox: stm32-ipcc: Convert to platform remove callback returning void Date: Wed, 27 Dec 2023 22:02:37 +0100 Message-ID: <3189b81c29e185e76e87a150051e5e73047b76ea.1703710628.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1799; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=3bDUjGjP7wzxKyoJxgukH0hU9Cj6FBrYyYL2xQFaSUY=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBljJDvHB8PRK2f+cN/dTeaPhGdhFq1chpZPlaNJ Nus1qGLwfuJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZYyQ7wAKCRCPgPtYfRL+ TnzaCACaIsH1woq68S42H2f/RVHXYiWQHTDmhEhk9nRfPyPMnH/LTY8QR4960J3vS3E4YlzpXD4 e8Fb9Pdn1otwdBaCiCKQ+jFxD5fN3gs8DxO1augzsYhBFFAbiOSlc9dTXbVwVSuISPIxv2eoz5S NBKQsfEydrR5UQymLJYcXo8qJSBg9XGyLpacTXFoTAx1ip1ShhIXCruPrt6bD3uWj3E7NQW8Fre oqDT36vI+j2waULDBWz24J47yHOTscUVw6D5s07bXWglA8P7CAsV/OSDSI94I0AVfnQLBr0rkzi /l1jNsQFzbe93BCZEb8sEpXrBKcYUp6KjT19THwhl5UaysP0 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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786470569556758202 X-GMAIL-MSGID: 1786470569556758202 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/mailbox/stm32-ipcc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mailbox/stm32-ipcc.c b/drivers/mailbox/stm32-ipcc.c index 4ad3653f3866..1442f275782b 100644 --- a/drivers/mailbox/stm32-ipcc.c +++ b/drivers/mailbox/stm32-ipcc.c @@ -331,7 +331,7 @@ static int stm32_ipcc_probe(struct platform_device *pdev) return ret; } -static int stm32_ipcc_remove(struct platform_device *pdev) +static void stm32_ipcc_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -339,8 +339,6 @@ static int stm32_ipcc_remove(struct platform_device *pdev) dev_pm_clear_wake_irq(&pdev->dev); device_set_wakeup_capable(dev, false); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -381,7 +379,7 @@ static struct platform_driver stm32_ipcc_driver = { .of_match_table = stm32_ipcc_of_match, }, .probe = stm32_ipcc_probe, - .remove = stm32_ipcc_remove, + .remove_new = stm32_ipcc_remove, }; module_platform_driver(stm32_ipcc_driver); From patchwork Wed Dec 27 21:02:38 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: 183570 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp1666612dyb; Wed, 27 Dec 2023 13:05:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IHaHNIIM/6p2SUKFkvJKGEfl6jCASDQrA7KDu5c1q3InbsD4ZP5BmZjY0sEhWsh2QbAz4ll X-Received: by 2002:a50:9fa7:0:b0:554:d2c2:8d4e with SMTP id c36-20020a509fa7000000b00554d2c28d4emr4426409edf.37.1703711140038; Wed, 27 Dec 2023 13:05:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703711140; cv=none; d=google.com; s=arc-20160816; b=cOMy9b2EyZXP9AkN11DwjLZfmUr3LE8PkEupNtkNu7JnmCqqpwch4LIfj+MsPtJ3P6 A4m/nzqZBYd3XVLAxBd+XKfCdB1UyBZJYENCR6c0mIx0HaP+yT2WFDC2/iGRuCyi83hA mBNVFDDHjsynchOi1OpI9fxu1qziAvz7MMY2fBcwxhnc4H8OoJ6FpMFgANgQLcZbkfoE CWq7Vf/hKiDp10OeI72dj5j8cPwTwAarnlKORSIWQPFXfKtxo73KM/fxEUR0XNJ11otd Zi2JtaIXbrYZ51KmtSbV/sVLb3jwJs6WiOINlIIO+RSGjWJZiVAx40lzizXemBDQBIiY CKpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=ZMfHATbexAadZcA6X4BGrhKCUZWPCrXSgj6aAqFtKYE=; fh=9chBk7rP0At9vpKOtJJ+hb9FjsBdhkqafrLnyi3Jhvg=; b=DnDNn8AS55xOQRpo/+PFvP6o+eL4gwVncY4thwpsRLzI2UCt2GcG0qAaWv8TD5hOAb h7RW9BBgoTcWbb8ADyAAURETmrMkbSn6i8VTEI5TagS1TRepB1JRR5tH8iBcaGX0Ti+I 119s/XhgBBDaS89XNUOfh8lGTH/pg7klorGh2iSeO2GDpG023v5D2obAP1qhiN0sZFJ9 bnl+a7iL+UA79XjXucYevYEMGYl98tLuwg3NMYP3J4Mdl+tSVJ9sAYq5WNChOXeGFDe8 OjJYShr15kk+06gLK3smbxnF2dYS4b2t98KlcBHnqP+O8cKpg/yC6D4vMCb1XQ6TxKbT XjXg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12270-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12270-ouuuleilei=gmail.com@vger.kernel.org" Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 17-20020a508e11000000b0055400e1f047si6568203edw.311.2023.12.27.13.05.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Dec 2023 13:05:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12270-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12270-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12270-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A5E041F231D0 for ; Wed, 27 Dec 2023 21:05:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A39784D59B; Wed, 27 Dec 2023 21:03:08 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EE9B34A980 for ; Wed, 27 Dec 2023 21:03:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de 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 1rIb3M-0000sn-1M; Wed, 27 Dec 2023 22:03:00 +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 1rIb3J-001wFJ-Uq; Wed, 27 Dec 2023 22:02:59 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rIb3K-001ZVs-36; Wed, 27 Dec 2023 22:02:58 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jassi Brar Cc: Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, kernel@pengutronix.de Subject: [PATCH 10/12] mailbox: sun6i-msgbox: Convert to platform remove callback returning void Date: Wed, 27 Dec 2023 22:02:38 +0100 Message-ID: <2db7ef94aa35587980697405ec373e0b7bb70466.1703710628.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1881; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=N/W8lZej+FeOqTdwnnoNmYqEIad8ynzkdcOjXSzw2ts=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBljJDwoMJLjfKm4Cc4/ADr3P0UTr8GXSsZIJG6W H2DM2dIZ4+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZYyQ8AAKCRCPgPtYfRL+ TsNlCAC5RWomH9b61vsKXO9seVB+66mp+g78kJnbVAs+m+UWgdssUkxqjQl0IZqc0OlSudVdslX IjnVHkdr/ZzzYZVJVgcTzR4JNZhouUYJDLnKihWTElEo8ye0FJxgHAV9LiHuSoH8NBPRx4vlWOI 1RhV+oIdSY6PtwA5hL6W6T7El2gulfzOCdKPq/q0nawWkBKRj3PEbof8Y5LXTeF+0AV4H/Ip6YR PNVh8GG59D3SPnPZZHLaJYRxWlGwbM/xAJhISVju1WUjnJ7FuoJbXhxMux/7E5dNjCVJ5Dsa2Mr yjFXCkWDvipZ6lhZZsg/qGnz7wXC2tlUUaziuZWURgX0ZjHE 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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786470612646853878 X-GMAIL-MSGID: 1786470612646853878 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 Acked-by: Jernej Skrabec --- drivers/mailbox/sun6i-msgbox.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mailbox/sun6i-msgbox.c b/drivers/mailbox/sun6i-msgbox.c index 7f8d931042d3..3dcc54dc83b2 100644 --- a/drivers/mailbox/sun6i-msgbox.c +++ b/drivers/mailbox/sun6i-msgbox.c @@ -287,15 +287,13 @@ static int sun6i_msgbox_probe(struct platform_device *pdev) return ret; } -static int sun6i_msgbox_remove(struct platform_device *pdev) +static void sun6i_msgbox_remove(struct platform_device *pdev) { struct sun6i_msgbox *mbox = platform_get_drvdata(pdev); mbox_controller_unregister(&mbox->controller); /* See the comment in sun6i_msgbox_probe about the reset line. */ clk_disable_unprepare(mbox->clk); - - return 0; } static const struct of_device_id sun6i_msgbox_of_match[] = { @@ -310,7 +308,7 @@ static struct platform_driver sun6i_msgbox_driver = { .of_match_table = sun6i_msgbox_of_match, }, .probe = sun6i_msgbox_probe, - .remove = sun6i_msgbox_remove, + .remove_new = sun6i_msgbox_remove, }; module_platform_driver(sun6i_msgbox_driver); From patchwork Wed Dec 27 21:02: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: 183566 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp1666233dyb; Wed, 27 Dec 2023 13:04:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IFMXZk7X+e951hD4tBraqAzQFYztVGlY3Bn8AZr4yzeM90Wif5YLnTDG3FMIpzDlPNOsjje X-Received: by 2002:a05:6871:713:b0:1ff:a07:d38d with SMTP id f19-20020a056871071300b001ff0a07d38dmr8111148oap.69.1703711098320; Wed, 27 Dec 2023 13:04:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703711098; cv=none; d=google.com; s=arc-20160816; b=zWDuVuW8roObskodRPeSyGzZWrSf/iBm71sWI/JkX0mO/0oKovzu7in2hY7TuLozoE WRqGjxX9CrWr+ut/Sm0AVbkga2MJqAAI0JfSO2oBrTGbpxGed/JmyaSQPFJ6Jt2fNlRC j0CTVxJKU4iX0XSkS2vLh5H4BeX0FBklKxiKzoWgxA8DCPjxVWcLlv0pBjaRI7KuTRW0 1/I5bTN3gCxFCIDfSuwimNVzMUCH9urcJg4iESumpFZd4Ombs0vfIuyviAV8IiYYlJXE wvkGDkdiTwVdRpalOtStaHmVrnXvyYfcDes6ckE8ebk4AYKKjtSNZoVwVUnP1N7eUyGk IIDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=tlL3Dh011HE0Jn3vey6WuiazRgboLJN1ZCcIt5+gb4E=; fh=6/ZKSqeg6LPH8a8dy6NxIJTRxzc3seIO2jbSKXtyqd4=; b=XpEyTxAEswRktg4XBM5kVc7l2cNv6ha9RruuxSflKOgORUT8Dsgya7caSk5DOTJjwj zECmm/TkfGDdUir4uKzkvwc438Sd3d9Tn4Pc9boF5fcCEyivcpLtQYaEL3CZe+gdFbkc IR67QLE+gpWprTYSWrmmY554LkkYINStbFXoyJxTOZEa8uWYJlm0kEL/p18R55M+wxGN sEy5NGGkZucLmw7G7PmKtp5py2cS2xhDgBn25wj8601RRCX1HZl93jwUthf8ADr8PUjr xmRe1xVVTyjrmQ3+S39eJCl+b5PCarat8s3vWBbpOsr9yF269UHuqbF63T4UEImXvwjn nuww== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12266-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12266-ouuuleilei=gmail.com@vger.kernel.org" Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id y11-20020a05610207cb00b00466f296b909si1009676vsg.656.2023.12.27.13.04.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Dec 2023 13:04:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12266-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12266-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12266-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id AC69A1C20AB0 for ; Wed, 27 Dec 2023 21:04:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 12DB44A98F; Wed, 27 Dec 2023 21:03:06 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E3525481B3 for ; Wed, 27 Dec 2023 21:03:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de 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 1rIb3L-0000t1-Me; Wed, 27 Dec 2023 22:02:59 +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 1rIb3K-001wFN-4t; Wed, 27 Dec 2023 22:02:59 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rIb3L-001ZVw-0V; Wed, 27 Dec 2023 22:02:59 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jassi Brar Cc: Thierry Reding , Jonathan Hunter , linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 11/12] mailbox: tegra-hsp: Convert to platform remove callback returning void Date: Wed, 27 Dec 2023 22:02:39 +0100 Message-ID: <8e00bbc23e1115d9ff185d4b98c6d764607036df.1703710628.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1705; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=PYLOV0x2mjDrqYc2WOt4MZWPAGaq8meNv350E++Xqz4=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBljJDxKf9dkG1I03uOMN9mSF6cbRm7XcpAFwVg0 hQObdda4w2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZYyQ8QAKCRCPgPtYfRL+ ToRJB/9LAqLeEDXl6LyRgrBJMUDfPV5gfr4iqzE2TfwlmQtMY9VVZgSzBclmKAp67Bbm/0T/UDQ WQhJApBRY3tDJ6nbdJRiM+X2RqemRskrEpDlrgs8TeSBp+kSzc1D2Vt6mGNLc1z/r/gZrbTFt1o vBbYu411RH9zW7g92zneQxlLLwATK7Pd6poTrBDIWJr8hKPxA/zut4gUqsqzrnID55PyUzK8rn5 huukRLE4HTpWVspSJFxgep0Gz2FiTTPsJt4i9c/NhPq1txhd50cf++t/+yDYPPq9TtoNAE9zbER ey/05V7M2b7TcaR1mlbT1iDSAlnr97gMhjSr9UTe7LvbM0Zz 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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786470568679220231 X-GMAIL-MSGID: 1786470568679220231 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/mailbox/tegra-hsp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mailbox/tegra-hsp.c b/drivers/mailbox/tegra-hsp.c index fe29fc2ca526..19ef56cbcfd3 100644 --- a/drivers/mailbox/tegra-hsp.c +++ b/drivers/mailbox/tegra-hsp.c @@ -868,13 +868,11 @@ static int tegra_hsp_probe(struct platform_device *pdev) return 0; } -static int tegra_hsp_remove(struct platform_device *pdev) +static void tegra_hsp_remove(struct platform_device *pdev) { struct tegra_hsp *hsp = platform_get_drvdata(pdev); lockdep_unregister_key(&hsp->lock_key); - - return 0; } static int __maybe_unused tegra_hsp_resume(struct device *dev) @@ -953,7 +951,7 @@ static struct platform_driver tegra_hsp_driver = { .pm = &tegra_hsp_pm_ops, }, .probe = tegra_hsp_probe, - .remove = tegra_hsp_remove, + .remove_new = tegra_hsp_remove, }; static int __init tegra_hsp_init(void) From patchwork Wed Dec 27 21:02:40 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: 183564 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp1666064dyb; Wed, 27 Dec 2023 13:04:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IEfL/M80I5snEow9TUJWIa8JwbW608sQOjwIBhNQop5Weny0Sc0K6IXQISP4dECzDz6Eh+C X-Received: by 2002:a05:6102:1608:b0:466:8c56:1b1c with SMTP id cu8-20020a056102160800b004668c561b1cmr4357414vsb.54.1703711077275; Wed, 27 Dec 2023 13:04:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703711077; cv=none; d=google.com; s=arc-20160816; b=ThpLQvgsO+WQh4YJ6DFzJA3Jm+oB0dfVxQ2qheOIOurmemLHE27eRzcIMIFV33FwuL QME7+3J3Wx5SA8aHgTqFXNzbOUWATjh6jtTDEgJTu8e7WvWMiVZCKJNDZqDUcwfPdhSG gXQlGHIFN0ozHvloamKPLH6uRLAT7kfwoB3QO5KoPDq2vSrlyjdFXy//UlukhbQ92Iu1 f6UrI0Oqg8m/Sl9PkSfuB/rTtOTJDGZuxkRRVnYPsNwj6Sipazb/N9ZjGX2S8a/0o2mC PwdBGgruF8V0KOe7emHYdPLFwfDa3BJYBussP2o8wP1fkAhan84ghvgQZ79FeoPrVJkz kznw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=OYB6aitYDAPiSyvPp01lKGipULN/YvBNiq+jSKtU9JQ=; fh=mOffzU9vuesIBf+gb20MIMY8nstF/xFjIQFKIx9KM34=; b=gICKB6hPquuADgAxQwQDTVzn5nwVJHUiac34CJZDW32RwBKo0dNEDq9xbmrZYn2o/z OwH9cBI/NeRGu6aGzYTCKEucDENcaBNPSj/2uyF6l5ZhLS6XBYMQCyukFuCCke2eLfL2 XNISHuTMxcyHqR+6vyDZE0FAnYCkmQBrktPZhErdQ/C4m4+walIkukDBfg0SJI2NhzV1 kSiLGy7n51L+drsoq36Ap1emiQ4QQTavhmvkwHfp2STIZUtcV8y6JStj6aL9oA8NTUx1 12/qRbRWkAx7T8BDujtKVgSrZyM4YlsL1C5CZ+EcI/VMfAmnbAWN2yyESPmKwIvMSzII saPQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12265-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12265-ouuuleilei=gmail.com@vger.kernel.org" Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id p23-20020a67e957000000b00466f68c4b6bsi909482vso.621.2023.12.27.13.04.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Dec 2023 13:04:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12265-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12265-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12265-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 0DA4C1C226C6 for ; Wed, 27 Dec 2023 21:04:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1671149F7D; Wed, 27 Dec 2023 21:03:05 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1C397481BB for ; Wed, 27 Dec 2023 21:03:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de 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 1rIb3L-0000tA-SH; Wed, 27 Dec 2023 22:02:59 +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 1rIb3K-001wFR-BB; Wed, 27 Dec 2023 22:02:59 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rIb3L-001ZW0-1A; Wed, 27 Dec 2023 22:02:59 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Jassi Brar Cc: Michal Simek , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: [PATCH 12/12] mailbox: zynqmp-ipi: Convert to platform remove callback returning void Date: Wed, 27 Dec 2023 22:02:40 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1705; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=2b4lUlitkOljYy3sRlFRPbTFvrd9xaqPFryNUK1ZN6s=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBljJDzqFtl2kmovE8iqyRfcBJPoRlc6qiRy4eJR F/jvpWQQLmJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZYyQ8wAKCRCPgPtYfRL+ TquyB/438vvpPAS3YP4QZzU/Aul2i7Mo5ML2J494dFbYViAl7ltgPfwkDcmca92QlWMEgpAV5VJ 0Yz+wQ4sKk2dWxYStXrFjG9Tniz39LdfLE8wxN7CY6gZ0YYN4kQOYzxQ88/KhvJhCqcsR1L20uu v6y5zySpr2H55+n20BfVMLgJ7NjH7/wmJl2ljlB7J/hDAykGUaA6UN1qk/CYrpcGZiVrr5QeMJE TuwlgdrzNYzx896y0DL9yWRv5PhOM523C9tHqBl1tC4zyWIFTeFR1Lxr+LiEQEcH6Quta3/fz7A z2bSAusqvyIraXRkdrL/bHAFB+Didj4tkwikvO/HJUZX+a3O 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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786470546492688137 X-GMAIL-MSGID: 1786470546492688137 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: Michal Simek --- drivers/mailbox/zynqmp-ipi-mailbox.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mailbox/zynqmp-ipi-mailbox.c b/drivers/mailbox/zynqmp-ipi-mailbox.c index 7fa533e80dd9..610a92f9c0b2 100644 --- a/drivers/mailbox/zynqmp-ipi-mailbox.c +++ b/drivers/mailbox/zynqmp-ipi-mailbox.c @@ -688,19 +688,17 @@ static int zynqmp_ipi_probe(struct platform_device *pdev) return ret; } -static int zynqmp_ipi_remove(struct platform_device *pdev) +static void zynqmp_ipi_remove(struct platform_device *pdev) { struct zynqmp_ipi_pdata *pdata; pdata = platform_get_drvdata(pdev); zynqmp_ipi_free_mboxes(pdata); - - return 0; } static struct platform_driver zynqmp_ipi_driver = { .probe = zynqmp_ipi_probe, - .remove = zynqmp_ipi_remove, + .remove_new = zynqmp_ipi_remove, .driver = { .name = "zynqmp-ipi", .of_match_table = of_match_ptr(zynqmp_ipi_of_match),