From patchwork Wed Dec 27 16:26: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: 183514 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp1532510dyb; Wed, 27 Dec 2023 08:28:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IHpIMzKhMVXsAi3jxvr6aMTtnpxTpmgRnRmlOAloEsAxF73N1tHjnZpEBTcQZbg9AZBptxi X-Received: by 2002:a05:6a20:a121:b0:195:6c34:f9fe with SMTP id q33-20020a056a20a12100b001956c34f9femr2819025pzk.117.1703694484530; Wed, 27 Dec 2023 08:28:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703694484; cv=none; d=google.com; s=arc-20160816; b=VNn7yzp684N5V3p+c5mrhdc5YGXnRhFUaJAkoiGCyaGRLf+tzCErTL4s/1i3C1GN6L fHge8PLASRxZ/bJ2QhtCjI1V4qM9es7uLb/Kgb/SJb4ad6KLoBqQH4482M2BPkay2iLp Ylpy0qa5geO5Z/453SWtmImmyxLtrrilcxHmBAezBfr/83EwvkyC30iAIdR/FPLt3CSu O0VZe3I9ifDnBbT6b4/PkE7dVG+8BQTZ3oUg3QJXJR0aAmHhz3c6+cVgfhmajY2Pzm/c 8IZ/raj+L4BwhUIfVqpFBDTsZ2IA1YGOJSCLjf9Fnoh0JyyOn0ZnHdT430+YAENH04RS 3PTw== 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=k+Qwzae/rL/s4LR3Bkcr4GcMaxFSrO+eysPcueFpZe4=; fh=d5Ex4XQyNQz1zuB8NE+0u1f7IbMJsbB5jtuxZjlQ9M8=; b=q70FRlVDECC2PBEE40ARBylfxBUe+b70lXIuR6uB+xSc2MuYMl7J549Z2r8pAscH36 /2E4uNCVectOXr+yy/0497+a+3ndcceUYqLB5e3qpZD57hirE7mdnFg8jDPdykhBPxj0 SveU9fTrjq9ZxqIk7yi4ELu9f3LzjYi8oQKvF/+jnwNr68ZzpkXc6RYR1GGK6nUC9U1n f1BZtXx2KFuuj9+O/qaxVs3mhRX/yL6bZYuB3eqxtcpt0OUTa1GxegrtdJkcl+H7Jj9j 3ZdWQ0OEee7gfbPi7+mhQ+JGHp9racjVcyvYJmSZJPwqMMDzXVCT6K/7hKox5NPyqN4U 5h8w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12128-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12128-ouuuleilei=gmail.com@vger.kernel.org" Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id i24-20020a63e458000000b005b86142ee56si10989812pgk.277.2023.12.27.08.28.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Dec 2023 08:28:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12128-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12128-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12128-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 4FB98282270 for ; Wed, 27 Dec 2023 16:28:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EED1847F68; Wed, 27 Dec 2023 16:26:56 +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 F3FB346430 for ; Wed, 27 Dec 2023 16:26:51 +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 1rIWjz-0005A2-NZ; Wed, 27 Dec 2023 17:26:43 +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 1rIWjy-001tZf-7y; Wed, 27 Dec 2023 17:26:43 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rIWjz-001WnB-0q; Wed, 27 Dec 2023 17:26:43 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Dinh Nguyen Cc: kernel@pengutronix.de, linux-kernel@vger.kernel.org Subject: [PATCH 08/11] firmware: stratix10-rsu: Convert to platform remove callback returning void Date: Wed, 27 Dec 2023 17:26:32 +0100 Message-ID: <06df45c697a747cb6543800a4613db6e1f5462b4.1703693980.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=1672; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=6lAFjA5yiszFloMYI5qzwPntohv2cozrx2dH/FwaD6s=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBljFA6uGEchezFuteKgpv7rVwlJjuBW7qQizAIb F8CKXZq1nSJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZYxQOgAKCRCPgPtYfRL+ TkKAB/wNqVOLInJA6P/jvSiLEyPTYDGW0rx8IlWU5cUStwjy0D3Rje8+JpchpcR5tb9pXUv9t1W ac2YENF8QcnS7ANBmdkC29mfmfyXZMrgdeTjG6lJZNR4Sz1QNDOL9s+pQAmZqS4CWWK+SmMNkEZ ojZkPxPMuIf7WJlS9b3IzQEOyGX1/ewLDgJHzEy2vyFsFMwt6bWP3uIjjluRq56SqTzw950nSuK X8uYMtNSdvir5kAH9fMIWCar4LGKQrBAbfl5t1zRKgFAdy21Fo/AGRIoNzj4Z8aCDaWLmxusYrT c/L/B7MzLUqe+JDZeQaRG1inrUTG9OVlRJGb4E+Zk2xq4lSJ 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: 1786453147981548245 X-GMAIL-MSGID: 1786453147981548245 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: Dinh Nguyen --- drivers/firmware/stratix10-rsu.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/firmware/stratix10-rsu.c b/drivers/firmware/stratix10-rsu.c index 4f7a7abada48..e20cee9c2d32 100644 --- a/drivers/firmware/stratix10-rsu.c +++ b/drivers/firmware/stratix10-rsu.c @@ -793,17 +793,16 @@ static int stratix10_rsu_probe(struct platform_device *pdev) return ret; } -static int stratix10_rsu_remove(struct platform_device *pdev) +static void stratix10_rsu_remove(struct platform_device *pdev) { struct stratix10_rsu_priv *priv = platform_get_drvdata(pdev); stratix10_svc_free_channel(priv->chan); - return 0; } static struct platform_driver stratix10_rsu_driver = { .probe = stratix10_rsu_probe, - .remove = stratix10_rsu_remove, + .remove_new = stratix10_rsu_remove, .driver = { .name = "stratix10-rsu", .dev_groups = rsu_groups,