From patchwork Mon Mar 4 22:30:08 2024 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: 1907923 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org (client-ip=2404:9400:2221:ea00::3; helo=gandalf.ozlabs.org; envelope-from=srs0=g+u7=kk=vger.kernel.org=sparclinux+bounces-480-patchwork-incoming=ozlabs.org@ozlabs.org; receiver=patchwork.ozlabs.org) Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TpYLf1PcDz23qm for ; Tue, 5 Mar 2024 09:30:50 +1100 (AEDT) Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4TpYLc141tz4wc9 for ; Tue, 5 Mar 2024 09:30:48 +1100 (AEDT) Received: by gandalf.ozlabs.org (Postfix) id 4TpYLc112Rz4wnq; Tue, 5 Mar 2024 09:30:48 +1100 (AEDT) Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: gandalf.ozlabs.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: gandalf.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=147.75.48.161; helo=sy.mirrors.kernel.org; envelope-from=sparclinux+bounces-480-patchwork-incoming=ozlabs.org@vger.kernel.org; receiver=ozlabs.org) Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org [147.75.48.161]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by gandalf.ozlabs.org (Postfix) with ESMTPS id 4TpYLc0vgPz4wc9 for ; Tue, 5 Mar 2024 09:30:48 +1100 (AEDT) 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 D7820B21A2E for ; Mon, 4 Mar 2024 22:30:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5FB0329CFE; Mon, 4 Mar 2024 22:30:44 +0000 (UTC) X-Original-To: sparclinux@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 E7AAE7B3D4 for ; Mon, 4 Mar 2024 22:30:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709591444; cv=none; b=VFxrv8JXASG/2XXh5IwV0g/NpXQaOImxvjzAMExKztBvxyyhejnh3kLB4IomubvgXSJCNmfE2mZuNkG80RpTQKZU7FgNIWclmQOSQrFxXF6ikfIfV3onc7qkwDBS84O8SWTtaY1W58+2ubZhzsE5bzL39jwiv85Oln0cffQDhXo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709591444; c=relaxed/simple; bh=GcjH/9kfyEXS9YEbG8nq/NtVg0wo03epd8gVuP1qfFU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XmbHnihI6QaGsjJkisUk5Al3IGWk5lIoM0m0mJ75zrJwMpJbjlNEbml6QVeUXGUyAbo//iYjW5qrw//sb4voWNHGcGeqx6UndlvPOZcx8i3lGJktsagq26lLFJV0nr6KNGScC3hl2EdgdI5YPN5TLOMqD3KjInGMYMcYoG+Drj4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 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 1rhGpQ-00072X-Cy; Mon, 04 Mar 2024 23:30:36 +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 1rhGpP-004RAY-BA; Mon, 04 Mar 2024 23:30:35 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rhGpP-00H7IB-0n; Mon, 04 Mar 2024 23:30:35 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "David S. Miller" , Andreas Larsson Cc: Rob Herring , Sam Ravnborg , sparclinux@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 1/6] sbus: Add prototype for bbc_envctrl_init and bbc_envctrl_cleanup to header Date: Mon, 4 Mar 2024 23:30:08 +0100 Message-ID: <57bc3b43b405431a486162fb8c2558072e976747.1709591118.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: sparclinux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1886; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=GcjH/9kfyEXS9YEbG8nq/NtVg0wo03epd8gVuP1qfFU=; b=owGbwMvMwMXY3/A7olbonx/jabUkhtRn3kVnZzLfuf2a82RMc9vM0NWvtjr7ZlirdPafP1a5i Zd/rlZxJ6MxCwMjF4OsmCKLfeOaTKsqucjOtf8uwwxiZQKZwsDFKQATUdjIwdBZcMT3xmoBG8bV N24oT50Z/eDGBxXbDMe62N46E49KhQ32Zx14K4+EeK2+KGL3MFDdWXalQv3dnar/zwXtm7bU87f cniyZy56W92fNL4pdsWzJrIzH/W32lxZXVDveLOgPl1B15VmSsnmfkqeh2sv2eutHIR5ekmaVz+ 9GCO8pO1lR7VommPR5h5yn9/enTm6FabKdkbocfNJhHfs+XYlVepNyV6LjrncIu27kfebjfu3xO 3ZeePRW8t/zd/Yuk3akJF/I0pw45Vb1PqNXWztO5i9N1fqSx7BypYri0rbSQ7zlQnGV07pb/I3n 7eO5aTsn/z/3dx2RA+s3epo/0XZYXHF95YVsrdsGVSr3AQ== 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: sparclinux@vger.kernel.org This fixes the following build warning: drivers/sbus/char/bbc_envctrl.c:566:5: error: no previous prototype for ‘bbc_envctrl_init’ [-Werror=missing-prototypes] 566 | int bbc_envctrl_init(struct bbc_i2c_bus *bp) | ^~~~~~~~~~~~~~~~ drivers/sbus/char/bbc_envctrl.c:594:6: error: no previous prototype for ‘bbc_envctrl_cleanup’ [-Werror=missing-prototypes] 594 | void bbc_envctrl_cleanup(struct bbc_i2c_bus *bp) | ^~~~~~~~~~~~~~~~~~~ which in the presence of -Werror=missing-prototypes yields a compiler error. Signed-off-by: Uwe Kleine-König --- drivers/sbus/char/bbc_i2c.c | 3 --- drivers/sbus/char/bbc_i2c.h | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/sbus/char/bbc_i2c.c b/drivers/sbus/char/bbc_i2c.c index 1c76e27d527a..970e04d8937d 100644 --- a/drivers/sbus/char/bbc_i2c.c +++ b/drivers/sbus/char/bbc_i2c.c @@ -358,9 +358,6 @@ static struct bbc_i2c_bus * attach_one_i2c(struct platform_device *op, int index return NULL; } -extern int bbc_envctrl_init(struct bbc_i2c_bus *bp); -extern void bbc_envctrl_cleanup(struct bbc_i2c_bus *bp); - static int bbc_i2c_probe(struct platform_device *op) { struct bbc_i2c_bus *bp; diff --git a/drivers/sbus/char/bbc_i2c.h b/drivers/sbus/char/bbc_i2c.h index 7ffe908c62dc..6c748836754b 100644 --- a/drivers/sbus/char/bbc_i2c.h +++ b/drivers/sbus/char/bbc_i2c.h @@ -82,4 +82,7 @@ extern int bbc_i2c_readb(struct bbc_i2c_client *, unsigned char *byte, int off); extern int bbc_i2c_write_buf(struct bbc_i2c_client *, char *buf, int len, int off); extern int bbc_i2c_read_buf(struct bbc_i2c_client *, char *buf, int len, int off); +extern int bbc_envctrl_init(struct bbc_i2c_bus *bp); +extern void bbc_envctrl_cleanup(struct bbc_i2c_bus *bp); + #endif /* _BBC_I2C_H */ From patchwork Mon Mar 4 22:30:09 2024 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: 1907920 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org (client-ip=150.107.74.76; helo=gandalf.ozlabs.org; envelope-from=srs0=fix8=kk=vger.kernel.org=sparclinux+bounces-476-patchwork-incoming=ozlabs.org@ozlabs.org; receiver=patchwork.ozlabs.org) Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TpYLc3L21z23qm for ; Tue, 5 Mar 2024 09:30:48 +1100 (AEDT) Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4TpYLb73RFz4wp0 for ; Tue, 5 Mar 2024 09:30:47 +1100 (AEDT) Received: by gandalf.ozlabs.org (Postfix) id 4TpYLb6r0Dz4wnq; Tue, 5 Mar 2024 09:30:47 +1100 (AEDT) Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: gandalf.ozlabs.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: gandalf.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=147.75.199.223; helo=ny.mirrors.kernel.org; envelope-from=sparclinux+bounces-476-patchwork-incoming=ozlabs.org@vger.kernel.org; receiver=ozlabs.org) Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [147.75.199.223]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by gandalf.ozlabs.org (Postfix) with ESMTPS id 4TpYLb3chxz4wc9 for ; Tue, 5 Mar 2024 09:30:47 +1100 (AEDT) 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 557BC1C20E1E for ; Mon, 4 Mar 2024 22:30:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C8D857BB01; Mon, 4 Mar 2024 22:30:42 +0000 (UTC) X-Original-To: sparclinux@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 4BBEF3FB07 for ; Mon, 4 Mar 2024 22:30:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709591442; cv=none; b=jId043i/gTzNxx4Nu0m4UDqOT/5Wu4Zt6HWM5+o6IpOTWmIQ7atY/p21wV9M9xBwqJ/tQyHdWw+4iJbditeOWdHFW85oXVqryeTYmYulxAtQdSuO+hiTEqyWELHIssIdDiKdd30uw0zNj9td8QndNwhpx7PDog58oOP9GPt2DAw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709591442; c=relaxed/simple; bh=j9XUp2kkW9l4W9pP1cAh3i09cR+kT420pW7hBoBCM+I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Jzab3WxmsoqdT9bc9wKtC3w+xU8HXVgE4TUSQaerFBO5IX7Bqc8qzpXOATCIhsqvHYGVnvGqq7smGDUxcaSbOZHqmWavblsxB/nqD4G8bvLUxqa32memMT6RYN+f0+DyFsIVciTFuU6NFMqA/KUw8n27+GU72Dl8g4y/PXhGJMQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 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 1rhGpQ-00072Y-Cz; Mon, 04 Mar 2024 23:30:36 +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 1rhGpP-004RAb-IB; Mon, 04 Mar 2024 23:30:35 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rhGpP-00H7IF-1W; Mon, 04 Mar 2024 23:30:35 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "David S. Miller" , Andreas Larsson Cc: Rob Herring , Sam Ravnborg , sparclinux@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 2/6] sbus: bbc_i2c: Convert to platform remove callback returning void Date: Mon, 4 Mar 2024 23:30:09 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: sparclinux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1794; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=j9XUp2kkW9l4W9pP1cAh3i09cR+kT420pW7hBoBCM+I=; b=owGbwMvMwMXY3/A7olbonx/jabUkhtRn3hWbubwvRorOjtINtnFke8pj7FfdX3xGxkzWc7uhe oWavG4nozELAyMXg6yYIot945pMqyq5yM61/y7DDGJlApnCwMUpABPh6mf/7z7lrMTEnzd/fnLK KSr3Y33luepAl5eXwcKOpXFnuVSy7raknG90V1h8wr88l024e98Bjqu3fz3+Ns2d+XBhj6xk80F vLdvr4f51Oms4vyXwMUis3R6/Zs7C6YmTb69++M81ulraN5P1467F7Nn5ikuZo45qmU1nX6v15O f+rQ/OV9YuiBW0/bTtkEbFvSscy19dc/qu9b16G2ddZO/xSVeC5HKmr2aPEJ6zUY5dZV3OElG2m xyqrtcMjhy0ytl+I3yb8eR5tvovXc5eq3jfosVTsbG0YtKddT7cmyo6rrXnm32zO8pU1hPmdPFF 48R18bzlOiUcb9T8JB3PzrK79V6HT2apI7fE6kIXb7NbAA== 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: sparclinux@vger.kernel.org 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/sbus/char/bbc_i2c.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/sbus/char/bbc_i2c.c b/drivers/sbus/char/bbc_i2c.c index 970e04d8937d..3192dcb83b86 100644 --- a/drivers/sbus/char/bbc_i2c.c +++ b/drivers/sbus/char/bbc_i2c.c @@ -382,7 +382,7 @@ static int bbc_i2c_probe(struct platform_device *op) return err; } -static int bbc_i2c_remove(struct platform_device *op) +static void bbc_i2c_remove(struct platform_device *op) { struct bbc_i2c_bus *bp = dev_get_drvdata(&op->dev); @@ -396,8 +396,6 @@ static int bbc_i2c_remove(struct platform_device *op) of_iounmap(&op->resource[1], bp->i2c_control_regs, 2); kfree(bp); - - return 0; } static const struct of_device_id bbc_i2c_match[] = { @@ -415,7 +413,7 @@ static struct platform_driver bbc_i2c_driver = { .of_match_table = bbc_i2c_match, }, .probe = bbc_i2c_probe, - .remove = bbc_i2c_remove, + .remove_new = bbc_i2c_remove, }; module_platform_driver(bbc_i2c_driver); From patchwork Mon Mar 4 22:30:10 2024 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: 1907926 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org (client-ip=2404:9400:2221:ea00::3; helo=gandalf.ozlabs.org; envelope-from=srs0=dhmq=kk=vger.kernel.org=sparclinux+bounces-479-patchwork-incoming=ozlabs.org@ozlabs.org; receiver=patchwork.ozlabs.org) Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TpYLf26V2z23qr for ; Tue, 5 Mar 2024 09:30:50 +1100 (AEDT) Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4TpYLb50v3z4wcb for ; Tue, 5 Mar 2024 09:30:47 +1100 (AEDT) Received: by gandalf.ozlabs.org (Postfix) id 4TpYLb4xMDz4wcv; Tue, 5 Mar 2024 09:30:47 +1100 (AEDT) Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: gandalf.ozlabs.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: gandalf.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2604:1380:40f1:3f00::1; helo=sy.mirrors.kernel.org; envelope-from=sparclinux+bounces-479-patchwork-incoming=ozlabs.org@vger.kernel.org; receiver=ozlabs.org) Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org [IPv6:2604:1380:40f1:3f00::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by gandalf.ozlabs.org (Postfix) with ESMTPS id 4TpYLb4kb8z4wcb for ; Tue, 5 Mar 2024 09:30:47 +1100 (AEDT) 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 5F20AB20F14 for ; Mon, 4 Mar 2024 22:30:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 979F17AE70; Mon, 4 Mar 2024 22:30:43 +0000 (UTC) X-Original-To: sparclinux@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 3A16D33CD1 for ; Mon, 4 Mar 2024 22:30:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709591443; cv=none; b=uOnHcd4fa6ptsotS3QtbEnH2sbcXqOY0rFCPD8eQcOC/xvYoM1iqBjyM5FTSXssp2js8eF33v2llLyj1YwqocoOWL9mdK0LyKQHuZ9rBh/tCnBdacGBTenJegWom0agMYZVObfhWvVfOFSPQTRC2LDnyGLTs7xrQuvcvBrNWKZw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709591443; c=relaxed/simple; bh=IXSRArmHBgUvyx2LKQTiYc/LS+CtwpTLFKSu3H4cqdc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=mgdF/GZWV/eNuiPJKFHWplbIAmdSvfMBV8BIysPdLn22upP/yBjkMHxwA0OCTpiz1ZvLlhd7luQl9YlFV6RaoeYtcMHIWQOLyCFqmOG3SY/FRGi6hlAkQoER8e0VEGRxlVuEIwZb+t8ayzGnqTxHVmlE5GM75VWsYGPNOUQ5PUE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 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 1rhGpQ-00072j-Cy; Mon, 04 Mar 2024 23:30:36 +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 1rhGpP-004RAe-P3; Mon, 04 Mar 2024 23:30:35 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rhGpP-00H7IN-2D; Mon, 04 Mar 2024 23:30:35 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "David S. Miller" , Andreas Larsson Cc: Rob Herring , Sam Ravnborg , sparclinux@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 3/6] sbus: display7seg: Convert to platform remove callback returning void Date: Mon, 4 Mar 2024 23:30:10 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: sparclinux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1800; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=IXSRArmHBgUvyx2LKQTiYc/LS+CtwpTLFKSu3H4cqdc=; b=owGbwMvMwMXY3/A7olbonx/jabUkhtRn3lVzeLb99ZrCPrV92ja+I2d6ytoj35v8TjBUkQ5aP GderClbJ6MxCwMjF4OsmCKLfeOaTKsqucjOtf8uwwxiZQKZwsDFKQATefeSg2E5U5V5xqbmrphp 7FVPgy5nGLHzmwazhOnasGikcj+pW382ZU7KZpkTj9RNLp+X8mStq5DiP7zBamNXXK1Q6/cXsp9 9+IvVf19g+LLsQXJ0ZMAdm5xHnr+5ZyiqTXvjFq143eW4VtbZd+ZRRwVDD8j8zOSbajn3pEiDqE t96EoG8R/5J/ZJTl2voyGy1PZW4Rfm+M3G+dd94q2Fr/6SDchP7Mksuzbhj/+hb04GOm++8cqfe p79w9fedxLzfH4lzsMm/nOkmJg67v1TMalIdLh7ZKZ25+VJETWZp+4v8Llc795sN2H/f/X9V+Sq 2zVU193juBBoPCnD/KCZZnJs6+ntYhEJ81nXsHk+c4wAAA== 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: sparclinux@vger.kernel.org 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/sbus/char/display7seg.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/sbus/char/display7seg.c b/drivers/sbus/char/display7seg.c index 18e6f84e754f..521cf8affe65 100644 --- a/drivers/sbus/char/display7seg.c +++ b/drivers/sbus/char/display7seg.c @@ -229,7 +229,7 @@ static int d7s_probe(struct platform_device *op) goto out; } -static int d7s_remove(struct platform_device *op) +static void d7s_remove(struct platform_device *op) { struct d7s *p = dev_get_drvdata(&op->dev); u8 regs = readb(p->regs); @@ -245,8 +245,6 @@ static int d7s_remove(struct platform_device *op) misc_deregister(&d7s_miscdev); of_iounmap(&op->resource[0], p->regs, sizeof(u8)); - - return 0; } static const struct of_device_id d7s_match[] = { @@ -263,7 +261,7 @@ static struct platform_driver d7s_driver = { .of_match_table = d7s_match, }, .probe = d7s_probe, - .remove = d7s_remove, + .remove_new = d7s_remove, }; module_platform_driver(d7s_driver); From patchwork Mon Mar 4 22:30:11 2024 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: 1907925 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org (client-ip=2404:9400:2221:ea00::3; helo=gandalf.ozlabs.org; envelope-from=srs0=szvi=kk=vger.kernel.org=sparclinux+bounces-474-patchwork-incoming=ozlabs.org@ozlabs.org; receiver=patchwork.ozlabs.org) Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TpYLf21vtz23qq for ; Tue, 5 Mar 2024 09:30:50 +1100 (AEDT) Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4TpYLb3H44z4wc8 for ; Tue, 5 Mar 2024 09:30:47 +1100 (AEDT) Received: by gandalf.ozlabs.org (Postfix) id 4TpYLb2nyvz4wc9; Tue, 5 Mar 2024 09:30:47 +1100 (AEDT) Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: gandalf.ozlabs.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: gandalf.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2604:1380:45d1:ec00::1; helo=ny.mirrors.kernel.org; envelope-from=sparclinux+bounces-474-patchwork-incoming=ozlabs.org@vger.kernel.org; receiver=ozlabs.org) Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [IPv6:2604:1380:45d1:ec00::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by gandalf.ozlabs.org (Postfix) with ESMTPS id 4TpYLZ34w4z4wc8 for ; Tue, 5 Mar 2024 09:30:46 +1100 (AEDT) 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 5F08F1C20CDC for ; Mon, 4 Mar 2024 22:30:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 877107BAF0; Mon, 4 Mar 2024 22:30:42 +0000 (UTC) X-Original-To: sparclinux@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 7F22A8F44 for ; Mon, 4 Mar 2024 22:30:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709591442; cv=none; b=UVcSuF7BGZLAumg8lEZ3QN41kfHUJExA+v5CaaVu6WQElWkUZD+rz4ktGNSk+O9umC/QE4JDsQXaenCOFlzXnsACwj20vGqW2OWSyGdsqKRDuQMFcKFeNWSs8w3tHKcWjoO4OZbT8D+EBMw8wmPLBFXvCqNzTFTAbX9yTfQ/Qnc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709591442; c=relaxed/simple; bh=OAKDjDIddRlFTzMDovtXkPNXvM2o/xSAgM43YJwZtQ4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=cltcCbyF3YoHlLbPKh4DdedHFUWpsG8h4iP8k91YE4Wb3i8wNuy182M1AiBnNdlxym0XNiZXJZeoGDDgL0PLhPqjad0g4LumVmwOikfbNhgOzu3mfWCgGBWdKQmPk26R+EsyNXROcZFZtAfy1ru7y9DovQQkRNrIN8t61MArKWg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 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 1rhGpQ-00073T-Cy; Mon, 04 Mar 2024 23:30:36 +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 1rhGpP-004RAh-V5; Mon, 04 Mar 2024 23:30:35 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rhGpP-00H7IR-2o; Mon, 04 Mar 2024 23:30:35 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "David S. Miller" , Andreas Larsson Cc: Sam Ravnborg , Rob Herring , sparclinux@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 4/6] sbus: envctrl: Convert to platform remove callback returning void Date: Mon, 4 Mar 2024 23:30:11 +0100 Message-ID: <0b61ed6fb4ebe2880951b1e849551dbc63402802.1709591118.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: sparclinux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1783; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=OAKDjDIddRlFTzMDovtXkPNXvM2o/xSAgM43YJwZtQ4=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBl5kuAXvo05LDwFKtUVtrOzirfWwz5iPJddWwPo /jYPzzWl8KJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZeZLgAAKCRCPgPtYfRL+ TnZYCACCtht62hhqQseRq7w50iq5eqlcVj5H1+z4KLevy0fVeOd3IvZL1th9Kvi0Qyv/DehKvch Pm5Mq3tXPe5yKrcTMLbCzPaqb0+75HA6HYW2jEEljj9GU/fD7BdrFkDMf2uhg3ncyqDV9bX8c5c ZzmIHN9m8tsg3RDplA8tGgUW95UZu8QDEgGQa9Jd+yvDn2vTILXQIvHp9vaStgWJ/Xv+dGUTKq5 FcYRMwiQjp3sqs7pfebSJHxVQRNwqaZJ7H6Gbg+w+nHHyKWRVlITihOcDYMFiA93+/sfR97h87i HxA3tBevRs5doMORDUwJbXqsst4K4LCstKhRiZ6j1I6EAqhm 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: sparclinux@vger.kernel.org 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/sbus/char/envctrl.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/sbus/char/envctrl.c b/drivers/sbus/char/envctrl.c index 3dd7274cb0a3..491cc6c0b3f9 100644 --- a/drivers/sbus/char/envctrl.c +++ b/drivers/sbus/char/envctrl.c @@ -1097,7 +1097,7 @@ static int envctrl_probe(struct platform_device *op) return err; } -static int envctrl_remove(struct platform_device *op) +static void envctrl_remove(struct platform_device *op) { int index; @@ -1108,8 +1108,6 @@ static int envctrl_remove(struct platform_device *op) for (index = 0; index < ENVCTRL_MAX_CPU * 2; index++) kfree(i2c_childlist[index].tables); - - return 0; } static const struct of_device_id envctrl_match[] = { @@ -1127,7 +1125,7 @@ static struct platform_driver envctrl_driver = { .of_match_table = envctrl_match, }, .probe = envctrl_probe, - .remove = envctrl_remove, + .remove_new = envctrl_remove, }; module_platform_driver(envctrl_driver); From patchwork Mon Mar 4 22:30:12 2024 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: 1907922 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org (client-ip=150.107.74.76; helo=gandalf.ozlabs.org; envelope-from=srs0=tiue=kk=vger.kernel.org=sparclinux+bounces-475-patchwork-incoming=ozlabs.org@ozlabs.org; receiver=patchwork.ozlabs.org) Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TpYLd47f7z1yX3 for ; Tue, 5 Mar 2024 09:30:49 +1100 (AEDT) Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4TpYLb391Hz4wc1 for ; Tue, 5 Mar 2024 09:30:47 +1100 (AEDT) Received: by gandalf.ozlabs.org (Postfix) id 4TpYLb2p9Sz4wcF; Tue, 5 Mar 2024 09:30:47 +1100 (AEDT) Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: gandalf.ozlabs.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: gandalf.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2604:1380:45e3:2400::1; helo=sv.mirrors.kernel.org; envelope-from=sparclinux+bounces-475-patchwork-incoming=ozlabs.org@vger.kernel.org; receiver=ozlabs.org) Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org [IPv6:2604:1380:45e3:2400::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by gandalf.ozlabs.org (Postfix) with ESMTPS id 4TpYLZ1B6wz4wc1 for ; Tue, 5 Mar 2024 09:30:46 +1100 (AEDT) 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 C18D1284128 for ; Mon, 4 Mar 2024 22:30:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C27578F44; Mon, 4 Mar 2024 22:30:42 +0000 (UTC) X-Original-To: sparclinux@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 3A12B29CFE for ; Mon, 4 Mar 2024 22:30:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709591442; cv=none; b=VQM88qZG1xTUgRHo7nT0/Lxz2dSamj49evYFygGTWNOSMmbhdvM/Gio2mAaaZKk/sfy2oFG3hMJ8bytez+QJO9pVbZyKstBCZnnfazWEokuTWmrXyOWGkiOnrJZMIDdUav4OeezM6qqmI5jGqd0buaPNFlYtWIid7HKjNPJi89Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709591442; c=relaxed/simple; bh=yMGaQO67z+KNEEEHI+prlq7mK7nx4TgQCjmCDNAFxsI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=nguI0aLsUnU5+I191PjIy5k05PaSSMATG3fX8UXHNyEL+oxhWAsMJbXfHlW3g/uRw05EFJEXipJYZElaV4exb5o+21RyVUO7KA2YbkILTo+U+hs5c6KJuORAOo6il9EXkPXKHKQSeiVl/XqwBadknrBcLWYx8Hg9deA3jCb9Mp8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 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 1rhGpQ-00073j-L9; Mon, 04 Mar 2024 23:30:36 +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 1rhGpQ-004RAk-7G; Mon, 04 Mar 2024 23:30:36 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rhGpQ-00H7IV-0S; Mon, 04 Mar 2024 23:30:36 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "David S. Miller" , Andreas Larsson Cc: Rob Herring , Sam Ravnborg , sparclinux@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 5/6] sbus: flash: Convert to platform remove callback returning void Date: Mon, 4 Mar 2024 23:30:12 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: sparclinux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1610; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=yMGaQO67z+KNEEEHI+prlq7mK7nx4TgQCjmCDNAFxsI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBl5kuGxLo3jT3R7aIaqIjDniACLL1ru7UgCHf87 typP0EkJvKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZeZLhgAKCRCPgPtYfRL+ TrveB/4jcS/kJq5vdriuBvivWI12j0Yd3qLhHK0Vj8MqcYDQRkSvdGjNdZ1Qgx5rWjyJli1sM2n fL6fvHD6aHnjmOHSrbgMTUI9mvutZgsAxp21sikLG4vnZv4FXDYGFW8wwcsQQpFOpykyc0HV4XO OsRijUdV4vwQmGZku2yobglCBN21XUdN/t5lyKZnOFQd9fZHuyJckSF+ZSlSOByHbn61ppNwj14 SU/nLWhA6rD3nHrjc3SXltdBxlR3df1G31jdaGS/4aaUfebhRVVOEYbiZ1SNafk0Sm/1Fi8OL/i b0hAkAdTqPw3lzE6lbpZfpxU2ZND+9an5fsyMX6upX1mNZJv 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: sparclinux@vger.kernel.org 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/sbus/char/flash.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/sbus/char/flash.c b/drivers/sbus/char/flash.c index ea2d903ba673..05d37d31c3b8 100644 --- a/drivers/sbus/char/flash.c +++ b/drivers/sbus/char/flash.c @@ -187,11 +187,9 @@ static int flash_probe(struct platform_device *op) return misc_register(&flash_dev); } -static int flash_remove(struct platform_device *op) +static void flash_remove(struct platform_device *op) { misc_deregister(&flash_dev); - - return 0; } static const struct of_device_id flash_match[] = { @@ -208,7 +206,7 @@ static struct platform_driver flash_driver = { .of_match_table = flash_match, }, .probe = flash_probe, - .remove = flash_remove, + .remove_new = flash_remove, }; module_platform_driver(flash_driver); From patchwork Mon Mar 4 22:30:13 2024 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: 1907921 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=ozlabs.org (client-ip=150.107.74.76; helo=gandalf.ozlabs.org; envelope-from=srs0=byco=kk=vger.kernel.org=sparclinux+bounces-477-patchwork-incoming=ozlabs.org@ozlabs.org; receiver=patchwork.ozlabs.org) Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TpYLc3HKmz1yX3 for ; Tue, 5 Mar 2024 09:30:48 +1100 (AEDT) Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4TpYLc056kz4wcF for ; Tue, 5 Mar 2024 09:30:48 +1100 (AEDT) Received: by gandalf.ozlabs.org (Postfix) id 4TpYLb73Fgz4wc9; Tue, 5 Mar 2024 09:30:47 +1100 (AEDT) Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: gandalf.ozlabs.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: gandalf.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=147.75.199.223; helo=ny.mirrors.kernel.org; envelope-from=sparclinux+bounces-477-patchwork-incoming=ozlabs.org@vger.kernel.org; receiver=ozlabs.org) Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org [147.75.199.223]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by gandalf.ozlabs.org (Postfix) with ESMTPS id 4TpYLb3r1Mz4wcF for ; Tue, 5 Mar 2024 09:30:47 +1100 (AEDT) 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 9E34F1C20E5A for ; Mon, 4 Mar 2024 22:30:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5114A1E4A2; Mon, 4 Mar 2024 22:30:43 +0000 (UTC) X-Original-To: sparclinux@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 912FC17555 for ; Mon, 4 Mar 2024 22:30:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709591443; cv=none; b=p2hASJDnxtG049PO6P4Wr4UeKtwqwtauR3UrCNHKfrd9bPevOxhtAocNaEt5Mei1NnW4Z9iT/w9N7vVC9maMIKzVH48JD6oUwBBSl4v8OSSDO3L9khDYlhVDdgxq/ONvZQhkoBcS84npVSia0Do5fKCZbt5fcUhcN/VWtpSbFRE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709591443; c=relaxed/simple; bh=4dE2Azq88uOKKAhqZUbOT+fl+bmVSUe/rbNwkzV7mJM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Lw2AjnirQUGmfMQRoUo0Q9qevZkYuCzOQvp5D6ygqNAP4QBfFW5v4dPg/wDU26ty3D/68W6P8EW9HYcJkEZvJZa7aeAN9u1Sla/wsfjLL0nIUwk5/RjJFHVqMN6TpfddKf6ZqWlelyBmHjOu+m/XxGq+U3ENEH9OBWvbn6rodeY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 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 1rhGpQ-00074F-RD; Mon, 04 Mar 2024 23:30:36 +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 1rhGpQ-004RAn-E8; Mon, 04 Mar 2024 23:30:36 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rhGpQ-00H7Ib-18; Mon, 04 Mar 2024 23:30:36 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "David S. Miller" , Andreas Larsson Cc: Sam Ravnborg , Rob Herring , sparclinux@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH 6/6] sbus: uctrl: Convert to platform remove callback returning void Date: Mon, 4 Mar 2024 23:30:13 +0100 Message-ID: <59b07175ca590031ee28c11c5941384ab3603799.1709591118.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: sparclinux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1738; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=4dE2Azq88uOKKAhqZUbOT+fl+bmVSUe/rbNwkzV7mJM=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBl5kuHtHm+0cTgMACjYgDr0HN56T1OTEWMYKUOu OzprIWzHBGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZeZLhwAKCRCPgPtYfRL+ Tsh8B/sHpF4OcPiVUZEkLDvcP2uKUg8L8HnrqJcVYmd84egClvFcMyD4SHJ4uAYsJ2sF6kjb0+u 1E93VXsTEo/lSvh6S902D2DwzOdFvsVmEC7p9zM9Cf9eEHGMV3cV4uQWmwWu8G7Ce7SezJys/e9 tTdUCNSD9U0x4s6Q+MMse96N99jyItPoX3Sfq3h/qPEMOOcXDO8AkqSftXXvDy5nRtU0F4UJIQr obSkvknLOlnj3bsuF3aEdrb+U4urKmiDfqftyxNVU9FwoHA1RluRodll2FDd8epeqCRf0mrPoed 5tNpJBeAeERMy7HjEjgamOzHAaz3YUdIci9kuz0TZFLyqrLt 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: sparclinux@vger.kernel.org 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/sbus/char/uctrl.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/sbus/char/uctrl.c b/drivers/sbus/char/uctrl.c index 0660425e3a5a..cf15a4186d03 100644 --- a/drivers/sbus/char/uctrl.c +++ b/drivers/sbus/char/uctrl.c @@ -399,7 +399,7 @@ static int uctrl_probe(struct platform_device *op) goto out; } -static int uctrl_remove(struct platform_device *op) +static void uctrl_remove(struct platform_device *op) { struct uctrl_driver *p = dev_get_drvdata(&op->dev); @@ -409,7 +409,6 @@ static int uctrl_remove(struct platform_device *op) of_iounmap(&op->resource[0], p->regs, resource_size(&op->resource[0])); kfree(p); } - return 0; } static const struct of_device_id uctrl_match[] = { @@ -426,7 +425,7 @@ static struct platform_driver uctrl_driver = { .of_match_table = uctrl_match, }, .probe = uctrl_probe, - .remove = uctrl_remove, + .remove_new = uctrl_remove, };