From patchwork Thu Mar 2 14:47:04 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: 13157371 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F8DCC6FA8E for ; Thu, 2 Mar 2023 14:47:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230004AbjCBOru (ORCPT ); Thu, 2 Mar 2023 09:47:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229978AbjCBOrt (ORCPT ); Thu, 2 Mar 2023 09:47:49 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2F0F3C7B3 for ; Thu, 2 Mar 2023 06:47:46 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXkDZ-0003r6-VC; Thu, 02 Mar 2023 15:47:38 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pXkDY-001Lqs-Vp; Thu, 02 Mar 2023 15:47:36 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pXkDY-001ZpN-DZ; Thu, 02 Mar 2023 15:47:36 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: "Lee, Chun-Yi" , Hans de Goede , Mark Gross Cc: kernel@pengutronix.de, Greg Kroah-Hartman , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 01/29] platform/x86: acer-wmi: Convert to platform remove callback returning void Date: Thu, 2 Mar 2023 15:47:04 +0100 Message-Id: <20230302144732.1903781-2-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> References: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1687; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=Bm3IBa63g4dbgofO/bfNR14JENf89OQOoGmeXdiQOJc=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkALaFAqKKBbmCSVfcZrLlnzJ+gOTOoySP5usQ4 WnoEH90y2qJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAC2hQAKCRDB/BR4rcrs CabdB/0cg/Acoa8r2+suMRlOz0PBSjcB5VhhGvP3dYKuJ6A6dX4ci2tjWdyuwCSLSgMfbjT4G2H qKb6IyhR/ePsmIFeOd1uk42EcKfvfQ4foviGVtnN+Ca7oiq8mKAK4wOs9ApfiED0NqIpjZbHMVr r/hgcFtd3wUb8TtGZ/PLXHbHPG0q5PqLK+Doo2pCAFpFnLm8w468D5aRf7g21oDk3uLQdZ09AcJ pg+miSkuaMYOaMdihp2t7QzuqgVP6t7yLsmym+/LtkZMjsJobC6leuiuzFLZU6frDPCBjef9KmN xRqert54tYxk+AqnYb3G1YHhCmFnekROZJvSI3sMktGkxpt0 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: platform-driver-x86@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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 (mostly) ignored 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. 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/platform/x86/acer-wmi.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c index ee67efdd5499..377a0becd1a1 100644 --- a/drivers/platform/x86/acer-wmi.c +++ b/drivers/platform/x86/acer-wmi.c @@ -2258,7 +2258,7 @@ static int acer_platform_probe(struct platform_device *device) return err; } -static int acer_platform_remove(struct platform_device *device) +static void acer_platform_remove(struct platform_device *device) { if (has_cap(ACER_CAP_MAILLED)) acer_led_exit(); @@ -2266,7 +2266,6 @@ static int acer_platform_remove(struct platform_device *device) acer_backlight_exit(); acer_rfkill_exit(); - return 0; } #ifdef CONFIG_PM_SLEEP @@ -2334,7 +2333,7 @@ static struct platform_driver acer_platform_driver = { .pm = &acer_pm, }, .probe = acer_platform_probe, - .remove = acer_platform_remove, + .remove_new = acer_platform_remove, .shutdown = acer_platform_shutdown, }; From patchwork Thu Mar 2 14:47:05 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: 13157386 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 341D1C7EE36 for ; Thu, 2 Mar 2023 14:48:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229690AbjCBOsC (ORCPT ); Thu, 2 Mar 2023 09:48:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230088AbjCBOrw (ORCPT ); Thu, 2 Mar 2023 09:47:52 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 254FD41B40 for ; Thu, 2 Mar 2023 06:47:50 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXkDd-0003r8-30; Thu, 02 Mar 2023 15:47:41 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pXkDZ-001Lqx-AC; Thu, 02 Mar 2023 15:47:37 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pXkDY-001ZpQ-KV; Thu, 02 Mar 2023 15:47:36 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Andrea Ho , Hans de Goede , Mark Gross Cc: kernel@pengutronix.de, Greg Kroah-Hartman , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 02/29] platform/x86: adv_swbutton: Convert to platform remove callback returning void Date: Thu, 2 Mar 2023 15:47:05 +0100 Message-Id: <20230302144732.1903781-3-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> References: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1713; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=S11c6ENi4+/lxeQmRpXtLc6wBlJ/k8mkXkXP9+wKzJw=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkALaJOzTBveIAfTSCwQvRQ6uJZTExOKijXVmnq qFL+oafJ/qJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAC2iQAKCRDB/BR4rcrs CX4RCACc/Z4VGxknmml3BqrqXgbspWm+mRxcVMhLNbb7hh/TMfV8fT7/KjiKPOSmxTm2fEXQOgB RevAeCjJRHEI1wyf82FUjtvLMHMkp5bFrdcR6VRN7ESVo6G9crT/7BPH/Qbz16EFzSr/A2m3Y8c IerD01wHq3i+loNgoZ4ltSlW/Ts1KEUunXaD4jqOL6wjYtIksSjNBnWmyrQxUIMgE7pR2B2QDD5 ILPE1CDdE/44UGnn/2gnmSkH2dPP/R90vxVJwUlQb0J1MebVM5Cw6bEiNK9nLRdeLspslS9IFqN nZIgSGbdcEf8DI+aFNF8yQCns7WXQtspY5N+d62Y+vGrgMdB 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: platform-driver-x86@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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 (mostly) ignored 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. 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/platform/x86/adv_swbutton.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/platform/x86/adv_swbutton.c b/drivers/platform/x86/adv_swbutton.c index 38693b735c87..6b23ba78e028 100644 --- a/drivers/platform/x86/adv_swbutton.c +++ b/drivers/platform/x86/adv_swbutton.c @@ -90,14 +90,12 @@ static int adv_swbutton_probe(struct platform_device *device) return 0; } -static int adv_swbutton_remove(struct platform_device *device) +static void adv_swbutton_remove(struct platform_device *device) { acpi_handle handle = ACPI_HANDLE(&device->dev); acpi_remove_notify_handler(handle, ACPI_DEVICE_NOTIFY, adv_swbutton_notify); - - return 0; } static const struct acpi_device_id button_device_ids[] = { @@ -112,7 +110,7 @@ static struct platform_driver adv_swbutton_driver = { .acpi_match_table = button_device_ids, }, .probe = adv_swbutton_probe, - .remove = adv_swbutton_remove, + .remove_new = adv_swbutton_remove, }; module_platform_driver(adv_swbutton_driver); From patchwork Thu Mar 2 14:47:06 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: 13157377 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54399C7EE2F for ; Thu, 2 Mar 2023 14:47:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230112AbjCBOry (ORCPT ); Thu, 2 Mar 2023 09:47:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230038AbjCBOru (ORCPT ); Thu, 2 Mar 2023 09:47:50 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5644E43938 for ; Thu, 2 Mar 2023 06:47:48 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXkDb-0003r9-2P; Thu, 02 Mar 2023 15:47:39 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pXkDZ-001Lr2-Mo; Thu, 02 Mar 2023 15:47:37 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pXkDY-001ZpT-RI; Thu, 02 Mar 2023 15:47:36 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Naveen Krishna Chatradhi , Hans de Goede , Mark Gross Cc: kernel@pengutronix.de, Greg Kroah-Hartman , Carlos Bilbao , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 03/29] platform/x86: amd: hsmp: Convert to platform remove callback returning void Date: Thu, 2 Mar 2023 15:47:06 +0100 Message-Id: <20230302144732.1903781-4-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> References: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1461; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=qgD6Fu+TwEiUbD68TORw2X6DDiB/hL0lY5kxPSiVZIw=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkALaNEhHeZybd0i9WVR1+OP5V0++Ct8ZKYQXPY SR2dxnaPy+JATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAC2jQAKCRDB/BR4rcrs CQblCACBa4XFyZ4EUSa9UsFxt52M+imRA1OkAW1aKR1jxMnUiTcge54noOrMVuW74wFatFUm4NC 1Q8G6WymgHcOyA8lgiaCEnTRX0CQ+1XixLaF+e2arwIIip0NHBg3BLbkUiz9d63pw26wRnvASeU 2SpxelmAMaY+szOQFdktT0TsizOcP9P52roVXL85e/zjyuRORno1h4XmoKKwNPVn0lZI5tfR0TP fiGLEacB1nOkpS3IoN0ffYQft7CtBooBfAJs38jV2M23JHOrwCStfofeEMw5PJeqkW9ui9n3jKB qgtmpVfYYKak/c9x/8OUs1sLGdLqfTcyJcIHxklaGVrNr2Rk 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: platform-driver-x86@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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 (mostly) ignored 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. 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/platform/x86/amd/hsmp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/platform/x86/amd/hsmp.c b/drivers/platform/x86/amd/hsmp.c index 521c6a229362..31382ef52efb 100644 --- a/drivers/platform/x86/amd/hsmp.c +++ b/drivers/platform/x86/amd/hsmp.c @@ -340,16 +340,14 @@ static int hsmp_pltdrv_probe(struct platform_device *pdev) return misc_register(&hsmp_device); } -static int hsmp_pltdrv_remove(struct platform_device *pdev) +static void hsmp_pltdrv_remove(struct platform_device *pdev) { misc_deregister(&hsmp_device); - - return 0; } static struct platform_driver amd_hsmp_driver = { .probe = hsmp_pltdrv_probe, - .remove = hsmp_pltdrv_remove, + .remove_new = hsmp_pltdrv_remove, .driver = { .name = DRIVER_NAME, }, From patchwork Thu Mar 2 14:47:07 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: 13157374 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 04894C6FA8E for ; Thu, 2 Mar 2023 14:47:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230082AbjCBOrw (ORCPT ); Thu, 2 Mar 2023 09:47:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229735AbjCBOru (ORCPT ); Thu, 2 Mar 2023 09:47:50 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E963B43900 for ; Thu, 2 Mar 2023 06:47:47 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXkDb-0003rT-72; Thu, 02 Mar 2023 15:47:39 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pXkDa-001LrH-JH; Thu, 02 Mar 2023 15:47:38 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pXkDZ-001ZpX-11; Thu, 02 Mar 2023 15:47:37 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Shyam Sundar S K , Hans de Goede , Mark Gross Cc: kernel@pengutronix.de, Greg Kroah-Hartman , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 04/29] platform/x86: amd: pmc: Convert to platform remove callback returning void Date: Thu, 2 Mar 2023 15:47:07 +0100 Message-Id: <20230302144732.1903781-5-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> References: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1696; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=N/5HsQ5hB+LY0fL7yq3qKM6LTsVLQJmEQenXSQKhbOE=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkALaRyFlnNiYZtBpEr4pwKkNUqnnDW7udEIyiF a9JWVDchEuJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAC2kQAKCRDB/BR4rcrs CfP4CACR1mYYMgYbAFfoUr3kO3mz8olRcx2Uw2iMcxDacBjm4LJdvWiY8OySjrvsIM49RCOohrf KnIIPovSEAh4hxHtGZGdX479q1S/AiKaztGLZ0QsWXcPGRkqw2ELLH4ei20WqfvNl6FlTLEWa/U O/Q+rImUgIGtPZ+TAja1MIxLBEmzLHTm/n7e09wGeT/SHzn++Q7ZZRhkDZbE6H7e45f0j1GUS7K mnW9cILhEbQeI8LXxpbRtHIjrD5/xs2eVHPmIHRyoxUr/Td8wlTT/F0jbjlqmwpGthSuPsYr8os kqnU1SW9uQ3N7FjaHzLJQiRoODJ84mmRRIu3uobnosrYYYF3 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: platform-driver-x86@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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 (mostly) ignored 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. 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/platform/x86/amd/pmc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/platform/x86/amd/pmc.c b/drivers/platform/x86/amd/pmc.c index ab05b9ee6655..2f7b1267c5e4 100644 --- a/drivers/platform/x86/amd/pmc.c +++ b/drivers/platform/x86/amd/pmc.c @@ -1031,7 +1031,7 @@ static int amd_pmc_probe(struct platform_device *pdev) return err; } -static int amd_pmc_remove(struct platform_device *pdev) +static void amd_pmc_remove(struct platform_device *pdev) { struct amd_pmc_dev *dev = platform_get_drvdata(pdev); @@ -1041,7 +1041,6 @@ static int amd_pmc_remove(struct platform_device *pdev) amd_pmc_dbgfs_unregister(dev); pci_dev_put(dev->rdev); mutex_destroy(&dev->lock); - return 0; } static const struct acpi_device_id amd_pmc_acpi_ids[] = { @@ -1066,7 +1065,7 @@ static struct platform_driver amd_pmc_driver = { #endif }, .probe = amd_pmc_probe, - .remove = amd_pmc_remove, + .remove_new = amd_pmc_remove, }; module_platform_driver(amd_pmc_driver); From patchwork Thu Mar 2 14:47:08 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: 13157379 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F5ADC678D4 for ; Thu, 2 Mar 2023 14:47:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230045AbjCBOr4 (ORCPT ); Thu, 2 Mar 2023 09:47:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230050AbjCBOrv (ORCPT ); Thu, 2 Mar 2023 09:47:51 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD1CD18159 for ; Thu, 2 Mar 2023 06:47:48 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXkDa-0003rA-P8; Thu, 02 Mar 2023 15:47:38 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pXkDa-001Lr6-0g; Thu, 02 Mar 2023 15:47:38 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pXkDZ-001Zpb-7B; Thu, 02 Mar 2023 15:47:37 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Shyam Sundar S K , Hans de Goede , Mark Gross Cc: kernel@pengutronix.de, Greg Kroah-Hartman , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 05/29] platform/x86: amd: pmf: core: Convert to platform remove callback returning void Date: Thu, 2 Mar 2023 15:47:08 +0100 Message-Id: <20230302144732.1903781-6-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> References: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1749; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=NLxovv9AqdM9/bwpLuxYogacX4f0kVeQEwMkH3uF2MA=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkALaVdEf8Iym4jEzQzhQOe04S9Uf9m2gLZ0/MD dAnrq4FWveJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAC2lQAKCRDB/BR4rcrs CRpWB/9pbIaMZy87nfOk+7vTzUoPV7iOdFI8iZOP8bZ1BwiUHKqUYQCWNjrPCRQCbmCWv6kEMAU h/cdt0PUc804WzHHwOK03oQAe6cunZA+fKZaw7S+82drmJ4SdfIVOHsnzvS1sT10+WlDYWvKqJ2 zciWXyZ6eAzSx/TIpMgW6hFPWU91S4U1+kJn85DkINmRPHG8dKY/hvfvPmXvKp2aYCFQ5solVEx HckHwDmEd8Ni8KprTu711Vz1VuJqR7rD8dgBe2pqF2MT++gK58rN+Y/5I6OJulOwSiAA2wLMKVt qQ1Fti6zrucbjL+y4WT+Llo6RhgjGzaDVaygHcTZA6sCVcYU 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: platform-driver-x86@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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 (mostly) ignored 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. 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/platform/x86/amd/pmf/core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/platform/x86/amd/pmf/core.c b/drivers/platform/x86/amd/pmf/core.c index da23639071d7..800ca2c998d3 100644 --- a/drivers/platform/x86/amd/pmf/core.c +++ b/drivers/platform/x86/amd/pmf/core.c @@ -402,7 +402,7 @@ static int amd_pmf_probe(struct platform_device *pdev) return 0; } -static int amd_pmf_remove(struct platform_device *pdev) +static void amd_pmf_remove(struct platform_device *pdev) { struct amd_pmf_dev *dev = platform_get_drvdata(pdev); @@ -413,7 +413,6 @@ static int amd_pmf_remove(struct platform_device *pdev) mutex_destroy(&dev->lock); mutex_destroy(&dev->update_mutex); kfree(dev->buf); - return 0; } static const struct attribute_group *amd_pmf_driver_groups[] = { @@ -428,7 +427,7 @@ static struct platform_driver amd_pmf_driver = { .dev_groups = amd_pmf_driver_groups, }, .probe = amd_pmf_probe, - .remove = amd_pmf_remove, + .remove_new = amd_pmf_remove, }; module_platform_driver(amd_pmf_driver); From patchwork Thu Mar 2 14:47:09 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: 13157369 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52CA5C7EE2F for ; Thu, 2 Mar 2023 14:47:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229538AbjCBOrt (ORCPT ); Thu, 2 Mar 2023 09:47:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229735AbjCBOrs (ORCPT ); Thu, 2 Mar 2023 09:47:48 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2DC3811641 for ; Thu, 2 Mar 2023 06:47:46 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXkDb-0003rI-24; Thu, 02 Mar 2023 15:47:39 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pXkDa-001LrA-9m; Thu, 02 Mar 2023 15:47:38 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pXkDZ-001Zpf-Dq; Thu, 02 Mar 2023 15:47:37 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Hans de Goede , Mark Gross Cc: kernel@pengutronix.de, Greg Kroah-Hartman , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 06/29] platform/x86: amilo-rfkill: Convert to platform remove callback returning void Date: Thu, 2 Mar 2023 15:47:09 +0100 Message-Id: <20230302144732.1903781-7-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> References: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1623; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=A8djoGpUAgNgkbWQ39wAp8VsGIh4VFkpPhaldfySJwA=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkALaZ2pVqagkhwomGyOVT91iRR36ZU9e7wuLcT JPIITqf5Z2JATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAC2mQAKCRDB/BR4rcrs CTfKB/95zYHTwLm7M3dAiiZI2Y5CA2UCdwVZr59pVKuWqZJ0rNZ5bUV9ygA/PIwL2AV90a5y6w/ EfytQEvPQhocXUu5Lo+e7yMqsvA5/9aclOMQONCv8MbV4zrudSKGnMXvPjNaUojoWyjDgdfc3Bv 83GB0TOQgKwNlAjktslFxkS0Rz+VrYBtxR8H5U1+S0LbSKUewDWRBJN9Uj4uPekHcllZJdbkd7L FYlTmEQcPSsiWX2IeURMmWxnOdyFIxLnhPz/BJiKrLaWT6m+0K5EwG8qwQDFLMfFrY2XaKmQRVf b3xZ7ijEMIYtc4j6EOrERAbky6dDSgM4tUJvz/SWfn9QQMHo 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: platform-driver-x86@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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 (mostly) ignored 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. 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/platform/x86/amilo-rfkill.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/platform/x86/amilo-rfkill.c b/drivers/platform/x86/amilo-rfkill.c index 3e313c4d538d..efcf909786a5 100644 --- a/drivers/platform/x86/amilo-rfkill.c +++ b/drivers/platform/x86/amilo-rfkill.c @@ -124,11 +124,10 @@ static int amilo_rfkill_probe(struct platform_device *device) return rc; } -static int amilo_rfkill_remove(struct platform_device *device) +static void amilo_rfkill_remove(struct platform_device *device) { rfkill_unregister(amilo_rfkill_dev); rfkill_destroy(amilo_rfkill_dev); - return 0; } static struct platform_driver amilo_rfkill_driver = { @@ -136,7 +135,7 @@ static struct platform_driver amilo_rfkill_driver = { .name = KBUILD_MODNAME, }, .probe = amilo_rfkill_probe, - .remove = amilo_rfkill_remove, + .remove_new = amilo_rfkill_remove, }; static int __init amilo_rfkill_init(void) From patchwork Thu Mar 2 14:47:10 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: 13157372 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5EAF9C7EE36 for ; Thu, 2 Mar 2023 14:47:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229982AbjCBOrv (ORCPT ); Thu, 2 Mar 2023 09:47:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229990AbjCBOrt (ORCPT ); Thu, 2 Mar 2023 09:47:49 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90C2E41B40 for ; Thu, 2 Mar 2023 06:47:47 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXkDb-0003rJ-BC; Thu, 02 Mar 2023 15:47:39 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pXkDa-001LrC-Bs; Thu, 02 Mar 2023 15:47:38 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pXkDZ-001Zpi-Kt; Thu, 02 Mar 2023 15:47:37 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Santosh Kumar Yadav , Peter Korsgaard , Hans de Goede , Mark Gross Cc: kernel@pengutronix.de, Greg Kroah-Hartman , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 07/29] platform/x86: barco-p50-gpio: Convert to platform remove callback returning void Date: Thu, 2 Mar 2023 15:47:10 +0100 Message-Id: <20230302144732.1903781-8-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> References: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1730; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=3SITRhRSsSiq5nNlw0cLw6UVXc4FMRsIXWa8cM62MP8=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkALade3Gi1p/sJd8H8iXfaMV7bNpT7R16FeAlt mHVTQ9i3e+JATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAC2nQAKCRDB/BR4rcrs CYxWB/0T9N2ZDz5pxanXc2jdn15Ou5okIo+OA378H8eFhJmwvYWT8z4crokjCAlcWEzwa4cv+3P +rZX9fAQRiNbIBH8+1OCOBVoPTZ5k9omOFb0s2QMgmXfEgi/daEjB5wJmBGpaCZVYw92pbn5D7A qKn1YLoQctNI8bhW9gbeLMNaG0IwGNHMGywnxwYb7ruLPvybqYBRSqLRJz7Mcal0jXC/D0djcPz tShBXQRNLFixNR4CiyoKY5vkLOn0YIYt8Wt8cXDxU3SLtxsyUM74CIsVAonZCEdNUeJRGYFVhOy bv6cuIeSpFDjQOK/272o5cD/s88jM+6NiCRI3Wxy0lhvfase 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: platform-driver-x86@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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 (mostly) ignored 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. 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/platform/x86/barco-p50-gpio.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/platform/x86/barco-p50-gpio.c b/drivers/platform/x86/barco-p50-gpio.c index 8dd672339485..af566f712057 100644 --- a/drivers/platform/x86/barco-p50-gpio.c +++ b/drivers/platform/x86/barco-p50-gpio.c @@ -370,7 +370,7 @@ static int p50_gpio_probe(struct platform_device *pdev) return ret; } -static int p50_gpio_remove(struct platform_device *pdev) +static void p50_gpio_remove(struct platform_device *pdev) { struct p50_gpio *p50 = platform_get_drvdata(pdev); @@ -378,8 +378,6 @@ static int p50_gpio_remove(struct platform_device *pdev) platform_device_unregister(p50->leds_pdev); gpiod_remove_lookup_table(&p50_gpio_led_table); - - return 0; } static struct platform_driver p50_gpio_driver = { @@ -387,7 +385,7 @@ static struct platform_driver p50_gpio_driver = { .name = DRIVER_NAME, }, .probe = p50_gpio_probe, - .remove = p50_gpio_remove, + .remove_new = p50_gpio_remove, }; /* Board setup */ From patchwork Thu Mar 2 14:47:11 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: 13157368 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB62BC678D4 for ; Thu, 2 Mar 2023 14:47:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229969AbjCBOrt (ORCPT ); Thu, 2 Mar 2023 09:47:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229538AbjCBOrs (ORCPT ); Thu, 2 Mar 2023 09:47:48 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB64218159 for ; Thu, 2 Mar 2023 06:47:46 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXkDb-0003rU-85; Thu, 02 Mar 2023 15:47:39 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pXkDa-001LrI-Jk; Thu, 02 Mar 2023 15:47:38 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pXkDZ-001Zpm-R3; Thu, 02 Mar 2023 15:47:37 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Cezary Jackiewicz , Hans de Goede , Mark Gross Cc: kernel@pengutronix.de, Greg Kroah-Hartman , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 08/29] platform/x86: compal-laptop: Convert to platform remove callback returning void Date: Thu, 2 Mar 2023 15:47:11 +0100 Message-Id: <20230302144732.1903781-9-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> References: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1864; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=2FcRCflJvaecUEGlqoFBbAQbmPoh+cHoMH2b86C4p0s=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkALahfyGEbwyFIZ/2N0J3qj3ymTNB0KR+nuX8B LhaekOFqSKJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAC2oQAKCRDB/BR4rcrs CWw6B/0SqxTeIkpbjeLgeQn8QgLD1ZpxFqsb+bXQ27zzQLCQtd9LZfgQJooPS71cLRZBGxZRj7b oOg2tNB4Kz4YnTB4C2rO4QzPcGUbwTXJAep9yZUPvY+1DSbKRrbfM8VbjT1DctOXnr2T6NVHz24 /WXcZJSHCkeDyVR+6pF05Ya9VEE1MjGnqvhAf2fsef5HSnUoAPK/i5Od/NobCYHal2/lVx+V9Hx 5JXgoNCzyusPjbvAyD8/1whKljMWg6DPkpT/eAvJnltCvBr1bVa/IrkAStsJD/RNmmu/glYLaJP zyYZUFpVOARSzTCTYPDtr+5dnutCmfmaQIFNdtsDMt97C8BJ 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: platform-driver-x86@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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 (mostly) ignored 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. 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/platform/x86/compal-laptop.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/platform/x86/compal-laptop.c b/drivers/platform/x86/compal-laptop.c index e10d2f64dfad..61c745490d71 100644 --- a/drivers/platform/x86/compal-laptop.c +++ b/drivers/platform/x86/compal-laptop.c @@ -1003,12 +1003,12 @@ static int compal_probe(struct platform_device *pdev) return err; } -static int compal_remove(struct platform_device *pdev) +static void compal_remove(struct platform_device *pdev) { struct compal_data *data; if (!extra_features) - return 0; + return; pr_info("Unloading: resetting fan control to motherboard\n"); pwm_disable_control(); @@ -1017,8 +1017,6 @@ static int compal_remove(struct platform_device *pdev) power_supply_unregister(data->psy); sysfs_remove_group(&pdev->dev.kobj, &compal_platform_attr_group); - - return 0; } static struct platform_driver compal_driver = { @@ -1026,7 +1024,7 @@ static struct platform_driver compal_driver = { .name = DRIVER_NAME, }, .probe = compal_probe, - .remove = compal_remove, + .remove_new = compal_remove, }; static int __init compal_init(void) From patchwork Thu Mar 2 14:47:12 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: 13157370 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8FE33C7EE32 for ; Thu, 2 Mar 2023 14:47:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229978AbjCBOru (ORCPT ); Thu, 2 Mar 2023 09:47:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229982AbjCBOrt (ORCPT ); Thu, 2 Mar 2023 09:47:49 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DA0541B47 for ; Thu, 2 Mar 2023 06:47:47 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXkDb-0003sE-TX; Thu, 02 Mar 2023 15:47:39 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pXkDb-001LrT-6Z; Thu, 02 Mar 2023 15:47:39 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pXkDa-001Zpp-D6; Thu, 02 Mar 2023 15:47:38 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Stuart Hayes , Hans de Goede , Mark Gross Cc: kernel@pengutronix.de, Greg Kroah-Hartman , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 09/29] platform/x86: dell: dcdbas: Convert to platform remove callback returning void Date: Thu, 2 Mar 2023 15:47:12 +0100 Message-Id: <20230302144732.1903781-10-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> References: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1626; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=zWMnGRQm3Ty/zUvYwolgkenvaIlIv2W9jAYb7LshPlE=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkALal8iQzvOAk8kcRYck9HCN5PPyQOMhn4YqQ1 zNd2tx5CJSJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAC2pQAKCRDB/BR4rcrs CeOaCACCKUaaSpf8mPOFmwqSBnGsfK1pAU9t+R+XcdOeiK7oH7DLlQjM4lsfX9IDAVUpyg86Esf bgF1ndsG5SnGTJLNwxHwgozXPEj/r+fLMtml0IHpd6sQdCGnT9emqgKsYnWCO2oDb0cjs/GwZum C7hKUxmiWtjiTKtGUdurGVHS0YoKrdmVGWIRwfHzzzMfyCkg70M+6fk0bgK4jwpKVukAQJcRAYt hETFxolMfdkaoZ8O1yQhS5iXKL714j3Jx0L1xoA/AMShWEEl4ouKYJB249jbKkhCDp0ZFQ9TQud TcD/9LNcoHt8pPWct25/+HWmVNnad/al2gHPIuRTk/1f5Q1i 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: platform-driver-x86@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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 (mostly) ignored 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. 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/platform/x86/dell/dcdbas.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/platform/x86/dell/dcdbas.c b/drivers/platform/x86/dell/dcdbas.c index 0ecb7b164750..76787369d7fa 100644 --- a/drivers/platform/x86/dell/dcdbas.c +++ b/drivers/platform/x86/dell/dcdbas.c @@ -698,12 +698,10 @@ static int dcdbas_probe(struct platform_device *dev) return 0; } -static int dcdbas_remove(struct platform_device *dev) +static void dcdbas_remove(struct platform_device *dev) { unregister_reboot_notifier(&dcdbas_reboot_nb); sysfs_remove_group(&dev->dev.kobj, &dcdbas_attr_group); - - return 0; } static struct platform_driver dcdbas_driver = { @@ -711,7 +709,7 @@ static struct platform_driver dcdbas_driver = { .name = DRIVER_NAME, }, .probe = dcdbas_probe, - .remove = dcdbas_remove, + .remove_new = dcdbas_remove, }; static const struct platform_device_info dcdbas_dev_info __initconst = { From patchwork Thu Mar 2 14:47:13 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: 13157387 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8291AC7EE2F for ; Thu, 2 Mar 2023 14:48:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229716AbjCBOsD (ORCPT ); Thu, 2 Mar 2023 09:48:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230055AbjCBOrv (ORCPT ); Thu, 2 Mar 2023 09:47:51 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1FF7C46154 for ; Thu, 2 Mar 2023 06:47:49 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXkDc-0003tr-Fw; Thu, 02 Mar 2023 15:47:40 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pXkDb-001Lrf-Nx; Thu, 02 Mar 2023 15:47:39 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pXkDa-001Zpv-L9; Thu, 02 Mar 2023 15:47:38 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: =?utf-8?q?Pali_Roh=C3=A1r?= , Hans de Goede , Mark Gross Cc: kernel@pengutronix.de, Greg Kroah-Hartman , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 10/29] platform/x86: dell: dell-smo8800: Convert to platform remove callback returning void Date: Thu, 2 Mar 2023 15:47:13 +0100 Message-Id: <20230302144732.1903781-11-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> References: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1798; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=txLMuYR/cP10MBXXBYhoJncjcMTcRGlLrq4hOidzyFc=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkALaprgeMkYzTuEyEiQoLcRYpGVSKWkuk6C5Zf EGmg4PzaBCJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAC2qQAKCRDB/BR4rcrs CbF9B/93h3vJrbwyrN/LyZ4EIyOBZgUqoIvTcY/7dRJS/z0eobnQEmWjBppGl+0P79+VwpzyEJp 87p+mebKkXCLMzSkyIAV6Ln+S1qed/rgakfeeQO09SmO8dheo6JCuk4AKU756i57U9y/ZnobUzv r0pbEBUtblV+gasl70k/DwvYdO6EdeWuR9NA25j4eEj/i0u5W6NpBtWoUQdJo6jK0h/dXFOs9CL x6Ibi9x7nYifDtNDqdVuZqSSdtAmfRyGVW5Xd/qj1jwQKjbnVOR4ky165J79MpQWFcq123kTwqR 3kABcySlvdIz1LoK/UyC+AR6BquPZjKun+dREdYxPWCiElC9 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: platform-driver-x86@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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 (mostly) ignored 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. 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: Pali Rohár --- drivers/platform/x86/dell/dell-smo8800.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/platform/x86/dell/dell-smo8800.c b/drivers/platform/x86/dell/dell-smo8800.c index 8d6b7a83cf24..f7ec17c56833 100644 --- a/drivers/platform/x86/dell/dell-smo8800.c +++ b/drivers/platform/x86/dell/dell-smo8800.c @@ -154,14 +154,13 @@ static int smo8800_probe(struct platform_device *device) return err; } -static int smo8800_remove(struct platform_device *device) +static void smo8800_remove(struct platform_device *device) { struct smo8800_device *smo8800 = platform_get_drvdata(device); free_irq(smo8800->irq, smo8800); misc_deregister(&smo8800->miscdev); dev_dbg(&device->dev, "device /dev/freefall unregistered\n"); - return 0; } /* NOTE: Keep this list in sync with drivers/i2c/busses/i2c-i801.c */ @@ -180,7 +179,7 @@ MODULE_DEVICE_TABLE(acpi, smo8800_ids); static struct platform_driver smo8800_driver = { .probe = smo8800_probe, - .remove = smo8800_remove, + .remove_new = smo8800_remove, .driver = { .name = DRIVER_NAME, .acpi_match_table = smo8800_ids, From patchwork Thu Mar 2 14:47:14 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: 13157392 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1814CC7EE2F for ; Thu, 2 Mar 2023 14:48:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230113AbjCBOsI (ORCPT ); Thu, 2 Mar 2023 09:48:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230115AbjCBOrz (ORCPT ); Thu, 2 Mar 2023 09:47:55 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDFB411641 for ; Thu, 2 Mar 2023 06:47:52 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXkDd-0003tO-Hb; Thu, 02 Mar 2023 15:47:41 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pXkDb-001LrZ-Gp; Thu, 02 Mar 2023 15:47:39 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pXkDa-001Zq0-Rm; Thu, 02 Mar 2023 15:47:38 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Eric Piel , Hans de Goede , Mark Gross Cc: kernel@pengutronix.de, Greg Kroah-Hartman , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 11/29] platform/x86: hp: hp_accel: Convert to platform remove callback returning void Date: Thu, 2 Mar 2023 15:47:14 +0100 Message-Id: <20230302144732.1903781-12-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> References: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1866; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=X9kQ4rbY4lv4/tckzYkf30KKQ7sZ/1lbGj8mnGbM7BA=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkALatDr6PLBGpno5AQOIzDvVee/jz9769sMvCp 96IWli4YEeJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAC2rQAKCRDB/BR4rcrs CWAzB/9Tpizdmk32o5fGzhOLxHYbu8RR4wu8CswSQQC6tgaHZpJlXSNaJjOa6x7n4njopchTN8k IZ81sbLnXgTRKCQwzfiinGLyZiiHSuS9hpOokK+0NK55bLZ6qZRBZgFlnsuk5B3oH8WRSgiySnn 9sPzFOWlSnZWrATXrEU+cbeNcl0NByUB/jEngUtbftSY4ylOkWHLW7bnCFiXTt7VoIy77mcBed2 W7/p/2JDmk2X1DEkLfE1xho9s/ge7HHZ8geG7EM23GKChy20CxCJrqsC0ZHk6xAKz9MHKpTXMKe wGBPPIHbvFK2RilOacd1CZeuZ5kHSobmxBYqMwPpj3K1ItlI 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: platform-driver-x86@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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 (mostly) ignored 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. 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/platform/x86/hp/hp_accel.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/platform/x86/hp/hp_accel.c b/drivers/platform/x86/hp/hp_accel.c index 6477591747cf..52535576772a 100644 --- a/drivers/platform/x86/hp/hp_accel.c +++ b/drivers/platform/x86/hp/hp_accel.c @@ -342,7 +342,7 @@ static int lis3lv02d_probe(struct platform_device *device) return ret; } -static int lis3lv02d_remove(struct platform_device *device) +static void lis3lv02d_remove(struct platform_device *device) { i8042_remove_filter(hp_accel_i8042_filter); lis3lv02d_joystick_disable(&lis3_dev); @@ -352,7 +352,6 @@ static int lis3lv02d_remove(struct platform_device *device) flush_work(&hpled_led.work); lis3lv02d_remove_fs(&lis3_dev); - return 0; } static int __maybe_unused lis3lv02d_suspend(struct device *dev) @@ -373,7 +372,7 @@ static SIMPLE_DEV_PM_OPS(hp_accel_pm, lis3lv02d_suspend, lis3lv02d_resume); /* For the HP MDPS aka 3D Driveguard */ static struct platform_driver lis3lv02d_driver = { .probe = lis3lv02d_probe, - .remove = lis3lv02d_remove, + .remove_new = lis3lv02d_remove, .driver = { .name = "hp_accel", .pm = &hp_accel_pm, From patchwork Thu Mar 2 14:47:15 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: 13157389 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6A827C678D4 for ; Thu, 2 Mar 2023 14:48:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229851AbjCBOsF (ORCPT ); Thu, 2 Mar 2023 09:48:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230104AbjCBOry (ORCPT ); Thu, 2 Mar 2023 09:47:54 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0D21EC72 for ; Thu, 2 Mar 2023 06:47:51 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXkDc-0003tn-QU; Thu, 02 Mar 2023 15:47:40 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pXkDb-001Lrd-M2; Thu, 02 Mar 2023 15:47:39 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pXkDb-001Zq3-2M; Thu, 02 Mar 2023 15:47:39 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Hans de Goede , Mark Gross , =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= , Jorge Lopez Cc: kernel@pengutronix.de, Greg Kroah-Hartman , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 12/29] platform/x86: hp: tc1100-wmi: Convert to platform remove callback returning void Date: Thu, 2 Mar 2023 15:47:15 +0100 Message-Id: <20230302144732.1903781-13-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> References: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1513; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=zAr8lrhzgrTr9284cFGceOvdHiakIwoRNxJOhICKzFI=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkALa1jWUOkUSHXnHDU/cF6fh7JSAiKc1ZsJ7uT hFyAxBITMOJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAC2tQAKCRDB/BR4rcrs Cf6ZCACOlBDPhtsPlbGQn4gmkWFsrmLzqnsN/L+mHDy3NMBRUTpfGepTn2GCSrNSDb1iIN4rC6/ oSHV9ZYUzvpfso4zN1he+to2/M3sI5vm7v2zO/p2BA+f1NfGGE2B2/b8FRskD118uICOCxkNolJ ZkNwv0ErPA0pBruPPVVo/tafq+gloZvYMZEfbjWhm9KqtmNW8ucFa9KgqnkA1UvqHNe917F4g6y kbtp1xwRTeR5e1DuBMXRROH0E0OPrKl9eiPz52Ui4vGvt+TT9KvGU3PODKl1Fng3P0v6QYr7j47 ctHRYBXm3tFEIa33nePri3wndsbHbJnBYF9OG9C8672AwxN1 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: platform-driver-x86@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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 (mostly) ignored 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. 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/platform/x86/hp/tc1100-wmi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/platform/x86/hp/tc1100-wmi.c b/drivers/platform/x86/hp/tc1100-wmi.c index ded26213c420..5298b0f6804f 100644 --- a/drivers/platform/x86/hp/tc1100-wmi.c +++ b/drivers/platform/x86/hp/tc1100-wmi.c @@ -170,11 +170,9 @@ static int __init tc1100_probe(struct platform_device *device) } -static int tc1100_remove(struct platform_device *device) +static void tc1100_remove(struct platform_device *device) { sysfs_remove_group(&device->dev.kobj, &tc1100_attribute_group); - - return 0; } #ifdef CONFIG_PM @@ -223,7 +221,7 @@ static struct platform_driver tc1100_driver = { .pm = &tc1100_pm_ops, #endif }, - .remove = tc1100_remove, + .remove_new = tc1100_remove, }; static int __init tc1100_init(void) From patchwork Thu Mar 2 14:47:16 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: 13157373 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C99AC7EE39 for ; Thu, 2 Mar 2023 14:47:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230072AbjCBOrw (ORCPT ); Thu, 2 Mar 2023 09:47:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229995AbjCBOrt (ORCPT ); Thu, 2 Mar 2023 09:47:49 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E733443472 for ; Thu, 2 Mar 2023 06:47:47 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXkDc-0003uM-L8; Thu, 02 Mar 2023 15:47:40 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pXkDb-001Lrl-WB; Thu, 02 Mar 2023 15:47:40 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pXkDb-001Zq7-9v; Thu, 02 Mar 2023 15:47:39 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Hans de Goede , Mark Gross Cc: kernel@pengutronix.de, Greg Kroah-Hartman , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 13/29] platform/x86: huawei-wmi: Convert to platform remove callback returning void Date: Thu, 2 Mar 2023 15:47:16 +0100 Message-Id: <20230302144732.1903781-14-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> References: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1747; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=JW33fHxe/kBQW6ZFF7MD4WNhh5dcbkzNNcJmCnfisT4=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkALa62P3XEguYN3LFWtRFAPXnn3mTTVM9Ih3OS W2S3s+MZOyJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAC2ugAKCRDB/BR4rcrs CUG0B/4+91kpU48HWypHlPmj2zLHU604Su/U8sc8tUAY3raE7VC/7zqriN00C9aqji+N3U4ds3d tdMsDO66a4eH+FJv4CKAVTaCCj2zHxoRNWuvw7pvzvsv+T3mg8Xiynjjr/sCvi/599yrdnNvxHA uwNBRlDShBVe7elB5ZP6F0zawQ8b3b6P1tcNoDtRDVMOxqdJwUMpjCHrIqsv8u8zUWB+cgm7Stc lT2Uzb0MQ/gkiPyBEmsf6Q8aGgH1lJ0hmrGQFk3dJ6UoIAESrJRC5rPPEOj4LXRAKau73f2HY3b ByESQh3fWqY1niisUV8udhiTQ6sC64wYvei5t28EjzLC701+ 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: platform-driver-x86@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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 (mostly) ignored 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. 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/platform/x86/huawei-wmi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/platform/x86/huawei-wmi.c b/drivers/platform/x86/huawei-wmi.c index 2df1b2d5e3ea..70e5c4c0574d 100644 --- a/drivers/platform/x86/huawei-wmi.c +++ b/drivers/platform/x86/huawei-wmi.c @@ -830,7 +830,7 @@ static int huawei_wmi_probe(struct platform_device *pdev) return 0; } -static int huawei_wmi_remove(struct platform_device *pdev) +static void huawei_wmi_remove(struct platform_device *pdev) { const struct wmi_device_id *guid = huawei_wmi_events_id_table; @@ -846,8 +846,6 @@ static int huawei_wmi_remove(struct platform_device *pdev) huawei_wmi_battery_exit(&pdev->dev); huawei_wmi_fn_lock_exit(&pdev->dev); } - - return 0; } static struct platform_driver huawei_wmi_driver = { @@ -855,7 +853,7 @@ static struct platform_driver huawei_wmi_driver = { .name = "huawei-wmi", }, .probe = huawei_wmi_probe, - .remove = huawei_wmi_remove, + .remove_new = huawei_wmi_remove, }; static __init int huawei_wmi_init(void) From patchwork Thu Mar 2 14:47:17 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: 13157375 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78511C7EE32 for ; Thu, 2 Mar 2023 14:47:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229735AbjCBOrx (ORCPT ); Thu, 2 Mar 2023 09:47:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230022AbjCBOru (ORCPT ); Thu, 2 Mar 2023 09:47:50 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BFC8457E0 for ; Thu, 2 Mar 2023 06:47:48 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXkDd-0003uq-5f; Thu, 02 Mar 2023 15:47:41 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pXkDc-001Lrr-AU; Thu, 02 Mar 2023 15:47:40 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pXkDb-001ZqA-GP; Thu, 02 Mar 2023 15:47:39 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Ike Panhc , Hans de Goede , Mark Gross Cc: kernel@pengutronix.de, Greg Kroah-Hartman , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 14/29] platform/x86: ideapad-laptop: Convert to platform remove callback returning void Date: Thu, 2 Mar 2023 15:47:17 +0100 Message-Id: <20230302144732.1903781-15-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> References: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1806; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=pDk7jwubfCsGp7anhhTuGzgHcgasJat6lH0VGQp+ErA=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkALa+07KJdRSyk7nfg3tmGNvagCT7Zx6blt9rM yrKEDFTZruJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAC2vgAKCRDB/BR4rcrs CcFRCACclEPioKPU5ApA2tnEvuiryygWnK4+p6CHzE9W0Rov296G9pkCAcSYHNEKnNJAq33u0cH jMwJr6GJGSl3WNksR7vwutRP4E6TiCDBaTNVIMrrAMaudkVd8hHzjhWCKfYUOz2w8p7AGRy1wMR +fL1++K0uV+wNHu7eyvz/czEwiCgeBcMLACR2D1JkuzF24iKEJst9a0+E7icT6O639hZO/YBIM6 qWcHbDhvF5QXoHEnHODu6s4ohwIGomD8HxxDW+pDFTN6hHr48MRlSX93dvqU7w5egCnYMh1fWR2 WZpQmBzZxeBNnyhuNELTqGvCjmUgcT2gOSsPfaMn5CxjnSWo 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: platform-driver-x86@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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 (mostly) ignored 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. 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/platform/x86/ideapad-laptop.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c index 0eb5bfdd823a..b5ef3452da1f 100644 --- a/drivers/platform/x86/ideapad-laptop.c +++ b/drivers/platform/x86/ideapad-laptop.c @@ -1921,7 +1921,7 @@ static int ideapad_acpi_add(struct platform_device *pdev) return err; } -static int ideapad_acpi_remove(struct platform_device *pdev) +static void ideapad_acpi_remove(struct platform_device *pdev) { struct ideapad_private *priv = dev_get_drvdata(&pdev->dev); int i; @@ -1942,8 +1942,6 @@ static int ideapad_acpi_remove(struct platform_device *pdev) ideapad_input_exit(priv); ideapad_debugfs_exit(priv); ideapad_sysfs_exit(priv); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -1970,7 +1968,7 @@ MODULE_DEVICE_TABLE(acpi, ideapad_device_ids); static struct platform_driver ideapad_acpi_driver = { .probe = ideapad_acpi_add, - .remove = ideapad_acpi_remove, + .remove_new = ideapad_acpi_remove, .driver = { .name = "ideapad_acpi", .pm = &ideapad_pm, From patchwork Thu Mar 2 14:47:18 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: 13157390 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E060C7EE36 for ; Thu, 2 Mar 2023 14:48:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230096AbjCBOsG (ORCPT ); Thu, 2 Mar 2023 09:48:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230111AbjCBOry (ORCPT ); Thu, 2 Mar 2023 09:47:54 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AEBED4BE8E for ; Thu, 2 Mar 2023 06:47:50 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXkDd-0003wh-QD; Thu, 02 Mar 2023 15:47:41 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pXkDd-001Ls7-5q; Thu, 02 Mar 2023 15:47:41 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pXkDb-001ZqE-Or; Thu, 02 Mar 2023 15:47:39 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Hans de Goede , Mark Gross Cc: kernel@pengutronix.de, Greg Kroah-Hartman , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 15/29] platform/x86: intel: bxtwc_tmu: Convert to platform remove callback returning void Date: Thu, 2 Mar 2023 15:47:18 +0100 Message-Id: <20230302144732.1903781-16-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> References: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1877; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=6Gq36LIAmzl6zxp6vtsQ1GkeFu+buKYvyyDT0NmxZ90=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkALbDzuqo/4A3YztsyXhANHGikIWuz8ooykUIG PFylWg87X+JATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAC2wwAKCRDB/BR4rcrs CQm3B/kBtltAwWOWaz603Bb14l+iccKUyiGRQdRLfyCPKAEH77NxiN2PwwnfXlR0G+A7vhnsq9d DKJfYsdP9cXhHPHXXZQP6dS4aWHk/ygX6bG4VJC/64jKLR5l2HdhjV+Hs515kVeD8IzWKDqrx+P ndUdIBSc/dKC7LpjXofqSv7wN2Bpm8I9N3ZcBq4qDEeN38rJ0Wz26kKL97Vc6RdKLawl7kD74dq A28JQiu/6LTkysCuhW5u7qksbFnKw6jsFunb6wS+2EtkVHdGCBSUGAMT7l1L0purW2lcEsL0xC8 xiv5Jvs9u/vi5T3bpZfKp5cSPg8OeMrOVR9RawLDz6n2LN63 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: platform-driver-x86@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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 (mostly) ignored 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. 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/platform/x86/intel/bxtwc_tmu.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/platform/x86/intel/bxtwc_tmu.c b/drivers/platform/x86/intel/bxtwc_tmu.c index 7ccf583649e6..d0e2a3c293b0 100644 --- a/drivers/platform/x86/intel/bxtwc_tmu.c +++ b/drivers/platform/x86/intel/bxtwc_tmu.c @@ -89,7 +89,7 @@ static int bxt_wcove_tmu_probe(struct platform_device *pdev) return 0; } -static int bxt_wcove_tmu_remove(struct platform_device *pdev) +static void bxt_wcove_tmu_remove(struct platform_device *pdev) { struct wcove_tmu *wctmu = platform_get_drvdata(pdev); unsigned int val; @@ -101,7 +101,6 @@ static int bxt_wcove_tmu_remove(struct platform_device *pdev) regmap_read(wctmu->regmap, BXTWC_MTMUIRQ_REG, &val); regmap_write(wctmu->regmap, BXTWC_MTMUIRQ_REG, val | BXTWC_TMU_ALRM_MASK); - return 0; } #ifdef CONFIG_PM_SLEEP @@ -132,7 +131,7 @@ MODULE_DEVICE_TABLE(platform, bxt_wcove_tmu_id_table); static struct platform_driver bxt_wcove_tmu_driver = { .probe = bxt_wcove_tmu_probe, - .remove = bxt_wcove_tmu_remove, + .remove_new = bxt_wcove_tmu_remove, .driver = { .name = "bxt_wcove_tmu", .pm = &bxtwc_tmu_pm_ops, From patchwork Thu Mar 2 14:47:19 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: 13157378 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 055B1C6FA8E for ; Thu, 2 Mar 2023 14:47:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230123AbjCBOr4 (ORCPT ); Thu, 2 Mar 2023 09:47:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230045AbjCBOrv (ORCPT ); Thu, 2 Mar 2023 09:47:51 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC9424608E for ; Thu, 2 Mar 2023 06:47:48 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXkDd-0003vc-BQ; Thu, 02 Mar 2023 15:47:41 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pXkDc-001Lrx-MA; Thu, 02 Mar 2023 15:47:40 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pXkDb-001ZqJ-Vx; Thu, 02 Mar 2023 15:47:40 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Hans de Goede , Mark Gross Cc: kernel@pengutronix.de, Greg Kroah-Hartman , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 16/29] platform/x86: intel: chtdc_ti_pwrbtn: Convert to platform remove callback returning void Date: Thu, 2 Mar 2023 15:47:19 +0100 Message-Id: <20230302144732.1903781-17-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> References: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1743; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=0FfJsPYwKB4jfuUCcPtgucO0ayHu8PD4oizQzml1AH0=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkALbHYN1EOHZvD7l11dIMQJzyoun4YkwBQNCyA 2bvZ8S9P/OJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAC2xwAKCRDB/BR4rcrs CZF+B/9fI4K2aRPUXCIfLqsznjaTirvwYRUDQhGrKP1fIQPXc+cJ5y6M5+XQVyct0f8sXIIXyH8 Hp4cYQOK/nN2PjVWKDxAn94MI4NKgK2Z19dhQF4hEKFIWZO+yrr92fwNjJMVM+YABrjAWqqDkVM X4zLxJXZ+ZTFXXB+9V3jdRlzLvyMi4P3Htyy9XjhCSuZZ6ZfvkQ/4ww9374sMosD759Dar1K97u NyOO3vbhT0y6vJFVPsjpxr69h5oCscAKq4Yr4RCJWVcFKN3OZh3slLgspdeWsIHwClZ+iIx4G9Y D6wwQWrzAFy+J7+sDD2TOicVX1EVzKWL0TG1fTKXqlR/ECAQ 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: platform-driver-x86@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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 (mostly) ignored 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. 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/platform/x86/intel/chtdc_ti_pwrbtn.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/platform/x86/intel/chtdc_ti_pwrbtn.c b/drivers/platform/x86/intel/chtdc_ti_pwrbtn.c index 9606a994af22..615f8d1a0c68 100644 --- a/drivers/platform/x86/intel/chtdc_ti_pwrbtn.c +++ b/drivers/platform/x86/intel/chtdc_ti_pwrbtn.c @@ -67,11 +67,10 @@ static int chtdc_ti_pwrbtn_probe(struct platform_device *pdev) return 0; } -static int chtdc_ti_pwrbtn_remove(struct platform_device *pdev) +static void chtdc_ti_pwrbtn_remove(struct platform_device *pdev) { dev_pm_clear_wake_irq(&pdev->dev); device_init_wakeup(&pdev->dev, false); - return 0; } static const struct platform_device_id chtdc_ti_pwrbtn_id_table[] = { @@ -85,7 +84,7 @@ static struct platform_driver chtdc_ti_pwrbtn_driver = { .name = KBUILD_MODNAME, }, .probe = chtdc_ti_pwrbtn_probe, - .remove = chtdc_ti_pwrbtn_remove, + .remove_new = chtdc_ti_pwrbtn_remove, .id_table = chtdc_ti_pwrbtn_id_table, }; module_platform_driver(chtdc_ti_pwrbtn_driver); From patchwork Thu Mar 2 14:47:20 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: 13157394 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4C688C7EE32 for ; Thu, 2 Mar 2023 14:48:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230173AbjCBOsK (ORCPT ); Thu, 2 Mar 2023 09:48:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230136AbjCBOr6 (ORCPT ); Thu, 2 Mar 2023 09:47:58 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AE424238 for ; Thu, 2 Mar 2023 06:47:54 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXkDe-0003wI-Fi; Thu, 02 Mar 2023 15:47:42 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pXkDc-001Ls1-QW; Thu, 02 Mar 2023 15:47:40 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pXkDc-001ZqN-5d; Thu, 02 Mar 2023 15:47:40 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Hans de Goede , Mark Gross , Andy Shevchenko , Wolfram Sang , Heikki Krogerus , Maximilian Luz Cc: kernel@pengutronix.de, Greg Kroah-Hartman , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 17/29] platform/x86: intel: chtwc_int33fe: Convert to platform remove callback returning void Date: Thu, 2 Mar 2023 15:47:20 +0100 Message-Id: <20230302144732.1903781-18-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> References: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1892; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=QVO6dKKemFdskHjiF8vZD9pCO2k/PVTJ/KaR9VN2t/A=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkALbM3iGaNjk9rUPjk1X1CVhZ/lW1RT7BMjzm4 WS+CUGLvRiJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAC2zAAKCRDB/BR4rcrs CdyIB/98Uza7jBnNrGDjo63pDRiw1Bc222LHFRiCTGDDT0Wh/OntnnUftyaWqIQfFJsOxTc25tU K22JLqgJChyTGgjUCj4UOUxsl8OMfe8unXibaATEUHv/d2Y0o4CWxpTiVP2Xu3KfTyNUITkuGHq 8nl7AB/5lD45Fu2cZ4CsFEauvxsaZJKd4szFnmuYHmS9WinC5liaqyNq9WrEwllFqewKaq32fiO QFB7O0AmyTIAhITjl/i1caMfZwEJIwTfn+d5x4xzLQvcTLn3WOFXzAE+1aIElQGGDtZP4lkm1AO qsuksMER3UeqWLX1v1yRPImOMS0d6g0doEOuCO8iJ9CA4SQs 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: platform-driver-x86@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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 (mostly) ignored 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. 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/platform/x86/intel/chtwc_int33fe.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/platform/x86/intel/chtwc_int33fe.c b/drivers/platform/x86/intel/chtwc_int33fe.c index 2c9a7d52be07..848baecc1bb0 100644 --- a/drivers/platform/x86/intel/chtwc_int33fe.c +++ b/drivers/platform/x86/intel/chtwc_int33fe.c @@ -405,7 +405,7 @@ static int cht_int33fe_typec_probe(struct platform_device *pdev) return ret; } -static int cht_int33fe_typec_remove(struct platform_device *pdev) +static void cht_int33fe_typec_remove(struct platform_device *pdev) { struct cht_int33fe_data *data = platform_get_drvdata(pdev); @@ -414,8 +414,6 @@ static int cht_int33fe_typec_remove(struct platform_device *pdev) i2c_unregister_device(data->battery_fg); cht_int33fe_remove_nodes(data); - - return 0; } static const struct acpi_device_id cht_int33fe_acpi_ids[] = { @@ -429,7 +427,7 @@ static struct platform_driver cht_int33fe_typec_driver = { .acpi_match_table = ACPI_PTR(cht_int33fe_acpi_ids), }, .probe = cht_int33fe_typec_probe, - .remove = cht_int33fe_typec_remove, + .remove_new = cht_int33fe_typec_remove, }; module_platform_driver(cht_int33fe_typec_driver); From patchwork Thu Mar 2 14:47:21 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: 13157376 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0FE1BC678D4 for ; Thu, 2 Mar 2023 14:47:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230101AbjCBOry (ORCPT ); Thu, 2 Mar 2023 09:47:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230040AbjCBOru (ORCPT ); Thu, 2 Mar 2023 09:47:50 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EF5B457E9 for ; Thu, 2 Mar 2023 06:47:48 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXkDd-0003wi-RA; Thu, 02 Mar 2023 15:47:41 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pXkDd-001Ls8-6f; Thu, 02 Mar 2023 15:47:41 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pXkDc-001ZqQ-CS; Thu, 02 Mar 2023 15:47:40 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Alex Hung , Hans de Goede , Mark Gross Cc: kernel@pengutronix.de, Greg Kroah-Hartman , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 18/29] platform/x86: intel: hid: Convert to platform remove callback returning void Date: Thu, 2 Mar 2023 15:47:21 +0100 Message-Id: <20230302144732.1903781-19-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> References: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1911; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=p4w/9jtnouAyp1eJo+WIbJu5c+ULhR1tWYCbbhAgbEQ=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkALbQOhcPWcexTWxY+NygINDuhyhOrXEYL7UuX i8rHZtG85aJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAC20AAKCRDB/BR4rcrs CVcZB/9ye3KjcLu2a/DViU2kheftVNv5tc/U1GNDD6KzGERttB0ZaDXLvKKV6Rao1sIUIv92EPD ZhPDsMxLQbTx41TXu++iOuClbFkdLrqcSdQ1KEAfwNN1OAjkC4ISoFXwiwfhS60bzKEaeeV3EXz n59/YK4GC0CcwaWiKStFFMMmd2wHPmLS+OUwYn0eqvOPzD4yGgDGOq0U4hdNCEsbcNcbKGstptg 5urT4R8O5moRmjUn3LQ0e5A7LjS8gNU833MpvaOxiuinScybD4MV9Gn5IwkSjWIBJReTWyMcEee CpIdXq7Dz1u76ekXzZhKLCF9oEzIbnjCxS4vXl/nhYXHj+y7 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: platform-driver-x86@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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 (mostly) ignored 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. 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/platform/x86/intel/hid.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/platform/x86/intel/hid.c b/drivers/platform/x86/intel/hid.c index b6c06b37862e..5632bd3c534a 100644 --- a/drivers/platform/x86/intel/hid.c +++ b/drivers/platform/x86/intel/hid.c @@ -720,7 +720,7 @@ static int intel_hid_probe(struct platform_device *device) return err; } -static int intel_hid_remove(struct platform_device *device) +static void intel_hid_remove(struct platform_device *device) { acpi_handle handle = ACPI_HANDLE(&device->dev); @@ -728,12 +728,6 @@ static int intel_hid_remove(struct platform_device *device) acpi_remove_notify_handler(handle, ACPI_DEVICE_NOTIFY, notify_handler); intel_hid_set_enable(&device->dev, false); intel_button_array_enable(&device->dev, false); - - /* - * Even if we failed to shut off the event stream, we can still - * safely detach from the device. - */ - return 0; } static struct platform_driver intel_hid_pl_driver = { @@ -743,7 +737,7 @@ static struct platform_driver intel_hid_pl_driver = { .pm = &intel_hid_pl_pm_ops, }, .probe = intel_hid_probe, - .remove = intel_hid_remove, + .remove_new = intel_hid_remove, }; /* From patchwork Thu Mar 2 14:47:22 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: 13157384 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 79AA9C7EE2F for ; Thu, 2 Mar 2023 14:48:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230142AbjCBOsA (ORCPT ); Thu, 2 Mar 2023 09:48:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230086AbjCBOrx (ORCPT ); Thu, 2 Mar 2023 09:47:53 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07AAD49880 for ; Thu, 2 Mar 2023 06:47:50 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXkDd-0003wl-Ta; Thu, 02 Mar 2023 15:47:41 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pXkDd-001LsB-7x; Thu, 02 Mar 2023 15:47:41 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pXkDc-001ZqU-LV; Thu, 02 Mar 2023 15:47:40 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Hans de Goede , Mark Gross , Sebastian Andrzej Siewior , Thomas Gleixner Cc: kernel@pengutronix.de, Greg Kroah-Hartman , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 19/29] platform/x86: intel: int0002_vgpio: Convert to platform remove callback returning void Date: Thu, 2 Mar 2023 15:47:22 +0100 Message-Id: <20230302144732.1903781-20-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> References: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1634; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=iMzvEUqbb2rVuVtUa7k/9sDC9oHzlYpq3RgIdsmfWLU=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkALbUqZeyydEqf9Lx4bdId4bvO/zQTf+JMBtAL DyBJyhKW+iJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAC21AAKCRDB/BR4rcrs CeL8B/wLiJWJ+Cc+G4vGlLIb0gmj6OIjaI3tm75Qj3ZIxPJBm7dK7o7J/6y/PsDTqORP1b0D4t7 Zh0w7lEVWfjU4FYUnjygZFPPZKS7W/MkXmQkeohk2CYGcv6MS6+vd3l08/IIRLRvpHrUMmDFXFz pebUcKlbaNjYnIFDmfTrAAXBXmiKkwEWwTMUeOc5IoOzQuLgPPDm7gN8BerDOFTF7D+PGqtw2VJ e52arbYSVrWi5SBiL+Uka7RklzUtVMF/XvVWmEXZNlfSAqxYF5/ubtnJ52brgcpRD/xV9Lb9aE5 +Jde4XFPLDi8yGH1Akd6cp7KaGiT/9TvzfdwlADpf22HymlD 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: platform-driver-x86@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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 (mostly) ignored 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. 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/platform/x86/intel/int0002_vgpio.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/platform/x86/intel/int0002_vgpio.c b/drivers/platform/x86/intel/int0002_vgpio.c index 97cfbc520a02..b6708bab7c53 100644 --- a/drivers/platform/x86/intel/int0002_vgpio.c +++ b/drivers/platform/x86/intel/int0002_vgpio.c @@ -223,11 +223,10 @@ static int int0002_probe(struct platform_device *pdev) return 0; } -static int int0002_remove(struct platform_device *pdev) +static void int0002_remove(struct platform_device *pdev) { device_init_wakeup(&pdev->dev, false); acpi_unregister_wakeup_handler(int0002_check_wake, NULL); - return 0; } static int int0002_suspend(struct device *dev) @@ -273,7 +272,7 @@ static struct platform_driver int0002_driver = { .pm = &int0002_pm_ops, }, .probe = int0002_probe, - .remove = int0002_remove, + .remove_new = int0002_remove, }; module_platform_driver(int0002_driver); From patchwork Thu Mar 2 14:47:23 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: 13157396 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 904B0C6FA8E for ; Thu, 2 Mar 2023 14:48:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230031AbjCBOsM (ORCPT ); Thu, 2 Mar 2023 09:48:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230037AbjCBOsF (ORCPT ); Thu, 2 Mar 2023 09:48:05 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22F5A4684 for ; Thu, 2 Mar 2023 06:47:55 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXkDf-0003zW-0v; Thu, 02 Mar 2023 15:47:43 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pXkDd-001LsM-OB; Thu, 02 Mar 2023 15:47:41 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pXkDc-001ZqY-RR; Thu, 02 Mar 2023 15:47:40 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Shravan Sudhakar , Intel Corporation , Hans de Goede , Mark Gross Cc: kernel@pengutronix.de, Greg Kroah-Hartman , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 20/29] platform/x86: intel: int1092: intel_sar: Convert to platform remove callback returning void Date: Thu, 2 Mar 2023 15:47:23 +0100 Message-Id: <20230302144732.1903781-21-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> References: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1699; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=0WhBbWaUwjGupEusr4fiMYsWZw2q9sM3XpKt7s0kViQ=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkALbY61PKNuhLdthRcF9cFYPCDVTf2JIATQZ3F ZhH35ZrolqJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAC22AAKCRDB/BR4rcrs CfTaB/0YWSxxN2MEgUnkqLZ8bB6kqb0wGvTpXbJGzDaRdHNlFe4HLCSihoBgVR0KGiP4faA2cl1 BIEyE9F/I851BQzjcEdCsFmSXaT6DS5ZQTzb7wwBz8Giz1pyiYyi1lTeY/ah3WunJBbpFk2B8zF HTsSKodrXFwVTGuy8nmkGMxxFZWB6x3wMF0hV1nNAiNyVUVhOQazN3cdR/7BEYZ+KDo9gsrvog5 MWbNcs3I9RuNB6BR4MBjgfGU6zXt0SdJABBwjSmvLYYTq/7jGe3XfxnSUpxnfc6ObBkgy65WZKM M3Bfl00b8SdNqNtG1F3Obkc9XPfRz5G8atN2x70YRW4B+WWT 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: platform-driver-x86@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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 (mostly) ignored 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. 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/platform/x86/intel/int1092/intel_sar.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/platform/x86/intel/int1092/intel_sar.c b/drivers/platform/x86/intel/int1092/intel_sar.c index 352fc4596494..6246c066ade2 100644 --- a/drivers/platform/x86/intel/int1092/intel_sar.c +++ b/drivers/platform/x86/intel/int1092/intel_sar.c @@ -292,7 +292,7 @@ static int sar_probe(struct platform_device *device) return result; } -static int sar_remove(struct platform_device *device) +static void sar_remove(struct platform_device *device) { struct wwan_sar_context *context = dev_get_drvdata(&device->dev); int reg; @@ -304,12 +304,11 @@ static int sar_remove(struct platform_device *device) kfree(context->config_data[reg].device_mode_info); kfree(context); - return 0; } static struct platform_driver sar_driver = { .probe = sar_probe, - .remove = sar_remove, + .remove_new = sar_remove, .driver = { .name = DRVNAME, .acpi_match_table = ACPI_PTR(sar_device_ids) From patchwork Thu Mar 2 14:47:24 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: 13157381 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 77363C7EE32 for ; Thu, 2 Mar 2023 14:47:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230132AbjCBOr6 (ORCPT ); Thu, 2 Mar 2023 09:47:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229995AbjCBOrw (ORCPT ); Thu, 2 Mar 2023 09:47:52 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 941E448E3C for ; Thu, 2 Mar 2023 06:47:49 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXkDf-00040h-3B; Thu, 02 Mar 2023 15:47:43 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pXkDd-001LsQ-TG; Thu, 02 Mar 2023 15:47:41 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pXkDd-001Zqc-1U; Thu, 02 Mar 2023 15:47:41 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Daniel Scally , Hans de Goede , Mark Gross Cc: kernel@pengutronix.de, Greg Kroah-Hartman , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 21/29] platform/x86: intel: int3472: discrete: Convert to platform remove callback returning void Date: Thu, 2 Mar 2023 15:47:24 +0100 Message-Id: <20230302144732.1903781-22-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> References: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1966; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=UZcNHKDZjEJbsCj/ym4PGZg6gRKQSXlA+HuRGH++vF4=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkALbc1iljYRotrm+Rq2yhzl9a/KRtXWqcsLW3s iyn+tlGYCiJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAC23AAKCRDB/BR4rcrs CdnWB/99xSk8KJ5WTtdChUxqNX7Nlr9oFUYmlHtxAqOF5m1LtLOHZZ+onMuEJqdS8zDM1MX4B47 i+cokuQiYNkMmt7KhF6lFGRIEGx7cEesi8NcSvvMweGumCsnuZTaI9WyGf72j0vseoSc/RzlyR3 kEu8dtEGYy83oWsjGihFY7lkSnuUFJyxdCEsfb9Z24rwV9iYomnegHQ58HRIVOEhwYAaOJw36gN 8OjD6YVDL+NMROL6PcAaAh1QIFIgeTc9BUua98cOnfFgKV46tidNbJ2IBwvyPAvQdkxOGgAy96c GPrPj8xM1urAI9sA0SuoBf5dWx4LqS5Sb1uJzJEHOMn+bxSX 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: platform-driver-x86@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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 (mostly) ignored 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. 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/platform/x86/intel/int3472/discrete.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/platform/x86/intel/int3472/discrete.c b/drivers/platform/x86/intel/int3472/discrete.c index f064da74f50a..ef020e23e596 100644 --- a/drivers/platform/x86/intel/int3472/discrete.c +++ b/drivers/platform/x86/intel/int3472/discrete.c @@ -317,7 +317,7 @@ static int skl_int3472_parse_crs(struct int3472_discrete_device *int3472) return 0; } -static int skl_int3472_discrete_remove(struct platform_device *pdev) +static void skl_int3472_discrete_remove(struct platform_device *pdev) { struct int3472_discrete_device *int3472 = platform_get_drvdata(pdev); @@ -326,8 +326,6 @@ static int skl_int3472_discrete_remove(struct platform_device *pdev) skl_int3472_unregister_clock(int3472); skl_int3472_unregister_pled(int3472); skl_int3472_unregister_regulator(int3472); - - return 0; } static int skl_int3472_discrete_probe(struct platform_device *pdev) @@ -392,7 +390,7 @@ static struct platform_driver int3472_discrete = { .acpi_match_table = int3472_device_id, }, .probe = skl_int3472_discrete_probe, - .remove = skl_int3472_discrete_remove, + .remove_new = skl_int3472_discrete_remove, }; module_platform_driver(int3472_discrete); From patchwork Thu Mar 2 14:47:25 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: 13157380 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 91CF8C7EE2F for ; Thu, 2 Mar 2023 14:47:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230050AbjCBOr5 (ORCPT ); Thu, 2 Mar 2023 09:47:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230054AbjCBOrv (ORCPT ); Thu, 2 Mar 2023 09:47:51 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3750E46167 for ; Thu, 2 Mar 2023 06:47:49 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXkDf-000456-Sz; Thu, 02 Mar 2023 15:47:43 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pXkDe-001Lse-U4; Thu, 02 Mar 2023 15:47:42 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pXkDd-001Zqg-9d; Thu, 02 Mar 2023 15:47:41 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Hans de Goede , Mark Gross Cc: kernel@pengutronix.de, Greg Kroah-Hartman , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 22/29] platform/x86: intel: mrfld_pwrbtn: Convert to platform remove callback returning void Date: Thu, 2 Mar 2023 15:47:25 +0100 Message-Id: <20230302144732.1903781-23-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> References: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1729; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=OG41i3sS4T3dTQzV9HEPZLUvI3D2MnBGxhm9QPceSMg=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkALbg9lEKjeaVD8wtq8wL8UjqxJ46eyp20lTtD SxmsWXcMW6JATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAC24AAKCRDB/BR4rcrs CfO/B/45kD3W0vEHIuGJdqj5KAIbCyTqJQwNCcmkpfQ2ddVpoxDCvGlVsIDKPTIlc1/f/uuxzUo hJPaNhNuZZRXrzrMV9YFpmRDCkTch8BTjxbNzvLCLlSTSamAJ6HR12FHq2MFa47d25NiSqvnGnT v/QTQ8K6JY//DpGdP8V16Aqk5X+y6DVH/NrykmbJCRre8PgQiUg9dEyOH4iOwD1mID8qDBuT9+o xkaV6NqSXmqhUVleqmOY4EKwY6aWmE17+SwfHiOURWk44d4XHAbtlpe2/Idoc97GMXaKlHr9FWm A+ulnzE5JhONxJ+5eidaNgqCnxIUCMu8Np14DYcKwK0mhoby 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: platform-driver-x86@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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 (mostly) ignored 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. 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/platform/x86/intel/mrfld_pwrbtn.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/platform/x86/intel/mrfld_pwrbtn.c b/drivers/platform/x86/intel/mrfld_pwrbtn.c index d58fea51747e..549a3f586f3b 100644 --- a/drivers/platform/x86/intel/mrfld_pwrbtn.c +++ b/drivers/platform/x86/intel/mrfld_pwrbtn.c @@ -78,13 +78,12 @@ static int mrfld_pwrbtn_probe(struct platform_device *pdev) return 0; } -static int mrfld_pwrbtn_remove(struct platform_device *pdev) +static void mrfld_pwrbtn_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; dev_pm_clear_wake_irq(dev); device_init_wakeup(dev, false); - return 0; } static const struct platform_device_id mrfld_pwrbtn_id_table[] = { @@ -98,7 +97,7 @@ static struct platform_driver mrfld_pwrbtn_driver = { .name = "mrfld_bcove_pwrbtn", }, .probe = mrfld_pwrbtn_probe, - .remove = mrfld_pwrbtn_remove, + .remove_new = mrfld_pwrbtn_remove, .id_table = mrfld_pwrbtn_id_table, }; module_platform_driver(mrfld_pwrbtn_driver); From patchwork Thu Mar 2 14:47:26 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: 13157395 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30955C7EE2F for ; Thu, 2 Mar 2023 14:48:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229907AbjCBOsL (ORCPT ); Thu, 2 Mar 2023 09:48:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229995AbjCBOr6 (ORCPT ); Thu, 2 Mar 2023 09:47:58 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB4B144AC for ; Thu, 2 Mar 2023 06:47:54 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXkDg-000465-IH; Thu, 02 Mar 2023 15:47:44 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pXkDf-001Lsr-8H; Thu, 02 Mar 2023 15:47:43 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pXkDd-001Zql-GN; Thu, 02 Mar 2023 15:47:41 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Rajneesh Bhardwaj , David E Box , Hans de Goede , Mark Gross Cc: kernel@pengutronix.de, Greg Kroah-Hartman , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 23/29] platform/x86: intel: pmc: core: Convert to platform remove callback returning void Date: Thu, 2 Mar 2023 15:47:26 +0100 Message-Id: <20230302144732.1903781-24-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> References: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1747; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=uAI4ihJxvW4g+0BlsuHpE7TOaB4sZpNOr0yzWOEQmig=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkALbk0pATwQt1Fk1UTJsVrARpIaPV4Hnc20cCq vE5tCX27dGJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAC25AAKCRDB/BR4rcrs Cb0YB/9hCziSWMMpJxmY/mG+rWnQZ/1jcm9ipG1J8irNinnhipWult0aC+2TVkFPBWp1itAeCWn 0ajIptER5my2NjrMx4CHT8CB7ZZ2pSUHMy9TXK1ptkFTAokFJTf/tzj0YZksbbHn627ol4t1/oS Xvl2Tmsn2RU0OjWigLqZbZvBbVZBNCPpw7qLPTxov1E2maTOWtSto6e6e7grimZvpnVJZHlpGhi 2jeYaixppbyBhrgbcLorQc2XmSWQIqqF8W6xtRroj73vSggNvneMu6FaEvOUCwk/4QghcpK43i9 whtlFi1L3axIHaj2zQ192SNiYpZXe62PdDwyxgspH1MDn+Em 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: platform-driver-x86@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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 (mostly) ignored 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. 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/platform/x86/intel/pmc/core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/platform/x86/intel/pmc/core.c b/drivers/platform/x86/intel/pmc/core.c index 3a15d32d7644..e489d2175e42 100644 --- a/drivers/platform/x86/intel/pmc/core.c +++ b/drivers/platform/x86/intel/pmc/core.c @@ -1149,7 +1149,7 @@ static int pmc_core_probe(struct platform_device *pdev) return 0; } -static int pmc_core_remove(struct platform_device *pdev) +static void pmc_core_remove(struct platform_device *pdev) { struct pmc_dev *pmcdev = platform_get_drvdata(pdev); @@ -1157,7 +1157,6 @@ static int pmc_core_remove(struct platform_device *pdev) platform_set_drvdata(pdev, NULL); mutex_destroy(&pmcdev->lock); iounmap(pmcdev->regbase); - return 0; } static bool warn_on_s0ix_failures; @@ -1264,7 +1263,7 @@ static struct platform_driver pmc_core_driver = { .dev_groups = pmc_dev_groups, }, .probe = pmc_core_probe, - .remove = pmc_core_remove, + .remove_new = pmc_core_remove, }; module_platform_driver(pmc_core_driver); From patchwork Thu Mar 2 14:47:27 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: 13157393 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8277C6FA8E for ; Thu, 2 Mar 2023 14:48:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230156AbjCBOsJ (ORCPT ); Thu, 2 Mar 2023 09:48:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230135AbjCBOr6 (ORCPT ); Thu, 2 Mar 2023 09:47:58 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AA654233 for ; Thu, 2 Mar 2023 06:47:54 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXkDg-00048A-PW; Thu, 02 Mar 2023 15:47:44 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pXkDf-001Lt1-RN; Thu, 02 Mar 2023 15:47:43 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pXkDd-001Zqo-OP; Thu, 02 Mar 2023 15:47:41 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Rajneesh Bhardwaj , "David E. Box" , Hans de Goede , Mark Gross Cc: kernel@pengutronix.de, Greg Kroah-Hartman , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 24/29] platform/x86: intel: telemetry: pltdrv: Convert to platform remove callback returning void Date: Thu, 2 Mar 2023 15:47:27 +0100 Message-Id: <20230302144732.1903781-25-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> References: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1536; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=hOir3yXd83a78a0bPOR4SmKCgiiootAaMYiyANLQEpI=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkALbpEeUZ2FAWsS9vjuh00XXV+PbA7DK9BvZCw bFvDL9yflGJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAC26QAKCRDB/BR4rcrs Cec9B/4kKCwcif2sEiaGMCtMBS7J4kjTOZUvQu09kErcZ4jZGTPc0DiCYDREV7dTPB5wXw4RZTo 265n8tnVihTjLjhdtSO51y48UYb9jcKZ2iVYggvXheuLDdOGVpKu9mBu5DqT97cyi3Zaea92WYs gB8moR2M1skFePwt6DreEGlLQcRkoag4Qnn76W1DgB7ljDa7oJ3oPPH1JAluOFBoOeEghcacXVz 2fJiEXASlquRiXQbZg7E7DIbuR4exRroCEfDabawYbULJPea2GeyUXnYB5f2aMBf1zMUkm7gudH /HZT7d5YDGH9uciLohUgJNZoDQiAv3rO0J6NenKGnJjAqSSX 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: platform-driver-x86@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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 (mostly) ignored 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. 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/platform/x86/intel/telemetry/pltdrv.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/platform/x86/intel/telemetry/pltdrv.c b/drivers/platform/x86/intel/telemetry/pltdrv.c index 405dea87de6b..06311d0e9451 100644 --- a/drivers/platform/x86/intel/telemetry/pltdrv.c +++ b/drivers/platform/x86/intel/telemetry/pltdrv.c @@ -1156,15 +1156,14 @@ static int telemetry_pltdrv_probe(struct platform_device *pdev) return ret; } -static int telemetry_pltdrv_remove(struct platform_device *pdev) +static void telemetry_pltdrv_remove(struct platform_device *pdev) { telemetry_clear_pltdata(); - return 0; } static struct platform_driver telemetry_soc_driver = { .probe = telemetry_pltdrv_probe, - .remove = telemetry_pltdrv_remove, + .remove_new = telemetry_pltdrv_remove, .driver = { .name = DRIVER_NAME, }, From patchwork Thu Mar 2 14:47:28 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: 13157382 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D99AAC6FA8E for ; Thu, 2 Mar 2023 14:47:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230097AbjCBOr6 (ORCPT ); Thu, 2 Mar 2023 09:47:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230085AbjCBOrw (ORCPT ); Thu, 2 Mar 2023 09:47:52 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13C5341B47 for ; Thu, 2 Mar 2023 06:47:50 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXkDg-000451-8n; Thu, 02 Mar 2023 15:47:44 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pXkDe-001Lsc-Sl; Thu, 02 Mar 2023 15:47:42 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pXkDd-001Zqs-Ur; Thu, 02 Mar 2023 15:47:41 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: AceLan Kao , Hans de Goede , Mark Gross Cc: kernel@pengutronix.de, Greg Kroah-Hartman , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 25/29] platform/x86: intel: vbtn: Convert to platform remove callback returning void Date: Thu, 2 Mar 2023 15:47:28 +0100 Message-Id: <20230302144732.1903781-26-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> References: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1808; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=4FZ1eGAX+X12ziQYLanXNlvTUV1hJsemEvhnUGuqfu0=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkALbtPQx7WWOR6o/HDFF3FfDIA4I2AEt1OmhLd At+L54FrseJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAC27QAKCRDB/BR4rcrs Cfk6B/42GMBgRTuXwK3tgegTCPgEvh66TJeY3zga6GDbSZDjbOL1VJ4YF8MoNiPjI+2fUe15wd1 pQeyoHXuxGjlRYudlHcx6pmVyBIAjYUaaH8/k5lE9cXwku6V9sPs7hk+McfbSyYHM8p7hLkMl5n 5h+mhDYIHwJ/TrdLMaFeOYxGLauyNEQvaizZVq8zh/Qiid/wz0zefNaTSriAjC3AS+y1fl0SjyE Wht2m4tgxrjOPLthSMuICiwQ6hdzelGYb9ZnLaBIupruRfMM6p61r7+TC5Hry9LIhuh3dhplVkc UYE5lBP5y7xLkXXjAzm2TN8LEUs6lQyNVpsGDByJAM+w1cay 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: platform-driver-x86@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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 (mostly) ignored 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. 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/platform/x86/intel/vbtn.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/platform/x86/intel/vbtn.c b/drivers/platform/x86/intel/vbtn.c index c5e4e35c8d20..6fa1735ad7a4 100644 --- a/drivers/platform/x86/intel/vbtn.c +++ b/drivers/platform/x86/intel/vbtn.c @@ -325,18 +325,12 @@ static int intel_vbtn_probe(struct platform_device *device) return 0; } -static int intel_vbtn_remove(struct platform_device *device) +static void intel_vbtn_remove(struct platform_device *device) { acpi_handle handle = ACPI_HANDLE(&device->dev); device_init_wakeup(&device->dev, false); acpi_remove_notify_handler(handle, ACPI_DEVICE_NOTIFY, notify_handler); - - /* - * Even if we failed to shut off the event stream, we can still - * safely detach from the device. - */ - return 0; } static int intel_vbtn_pm_prepare(struct device *dev) @@ -377,7 +371,7 @@ static struct platform_driver intel_vbtn_pl_driver = { .pm = &intel_vbtn_pm_ops, }, .probe = intel_vbtn_probe, - .remove = intel_vbtn_remove, + .remove_new = intel_vbtn_remove, }; static acpi_status __init From patchwork Thu Mar 2 14:47: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: 13157383 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 744A3C7EE36 for ; Thu, 2 Mar 2023 14:48:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230116AbjCBOr7 (ORCPT ); Thu, 2 Mar 2023 09:47:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230075AbjCBOrw (ORCPT ); Thu, 2 Mar 2023 09:47:52 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0345041B72 for ; Thu, 2 Mar 2023 06:47:50 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXkDg-00045R-B7; Thu, 02 Mar 2023 15:47:44 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pXkDe-001Lsi-WE; Thu, 02 Mar 2023 15:47:43 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pXkDe-001Zqw-4L; Thu, 02 Mar 2023 15:47:42 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Hans de Goede , Mark Gross Cc: kernel@pengutronix.de, Greg Kroah-Hartman , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 26/29] platform/x86: samsung-q10: Convert to platform remove callback returning void Date: Thu, 2 Mar 2023 15:47:29 +0100 Message-Id: <20230302144732.1903781-27-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> References: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1631; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=+GOxOWYmv6duofeGht03dZCq2oL/vZ0wyWmPfKijFXc=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkALbxZQvm4g0jdxlGvF1cAfRQJNgxIrXIFs7JD 6/CIRehgNSJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAC28QAKCRDB/BR4rcrs CblBB/sFtXfcdHErOkkcEQ8hZ49eFrmoJjb63KCPW+FGF2714vGdahbqBDkUlqhs9JJurJ9/KEL QpaH8/JbmF+gYceOJT10k10EU+oOvOxbOWtd5Yoa8p72Pwu5JR89xjLfYT7FFNyFd16Clb+lLG6 XcXu4K8enCI5fh6hTnk18uruU6G51Y3SbQr8KIbTr/insJrWBvl4zaLxke9oQ3SVWN7kwIc2/iQ 3VZtClYPMdpLMo9pNM9ntQEDbkkq06044P+8IFmVXe7yB8wy4qvCO5FtflsOlavbbH1mZ5lh16E k4uvo6NVrVx/Ebej/kuVTIJdQy/SW6J2wfJlUHVR/lKtf4Bf 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: platform-driver-x86@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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 (mostly) ignored 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. 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/platform/x86/samsung-q10.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/platform/x86/samsung-q10.c b/drivers/platform/x86/samsung-q10.c index 6eb08b539311..134e2c3d91ca 100644 --- a/drivers/platform/x86/samsung-q10.c +++ b/drivers/platform/x86/samsung-q10.c @@ -65,14 +65,12 @@ static int samsungq10_probe(struct platform_device *pdev) return 0; } -static int samsungq10_remove(struct platform_device *pdev) +static void samsungq10_remove(struct platform_device *pdev) { struct backlight_device *bd = platform_get_drvdata(pdev); backlight_device_unregister(bd); - - return 0; } static struct platform_driver samsungq10_driver = { @@ -80,7 +78,7 @@ static struct platform_driver samsungq10_driver = { .name = KBUILD_MODNAME, }, .probe = samsungq10_probe, - .remove = samsungq10_remove, + .remove_new = samsungq10_remove, }; static struct platform_device *samsungq10_device; From patchwork Thu Mar 2 14:47: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: 13157391 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CCB39C7EE32 for ; Thu, 2 Mar 2023 14:48:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230147AbjCBOsH (ORCPT ); Thu, 2 Mar 2023 09:48:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230113AbjCBOrz (ORCPT ); Thu, 2 Mar 2023 09:47:55 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1E724BE99 for ; Thu, 2 Mar 2023 06:47:50 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXkDg-00045Y-9l; Thu, 02 Mar 2023 15:47:44 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pXkDf-001Lsj-1f; Thu, 02 Mar 2023 15:47:43 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pXkDe-001Zqz-A7; Thu, 02 Mar 2023 15:47:42 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Hans de Goede , Mark Gross Cc: kernel@pengutronix.de, Greg Kroah-Hartman , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 27/29] platform/x86: serial-multi-instantiate: Convert to platform remove callback returning void Date: Thu, 2 Mar 2023 15:47:30 +0100 Message-Id: <20230302144732.1903781-28-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> References: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1609; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=zZdMBuHYK98FB0/gRnuDVS6LFfhuk4IBzInMCTmznJA=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkALb1rvceOGPBsIzcSYQ/ZFLJcwFZMlPe0/ZcU 7fMoesuAWWJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAC29QAKCRDB/BR4rcrs CS7/B/0bdPvjYrFNATZEQCmNbthFqiFhuxnRTvZN+E0wDqVtaT2CbcJSjHSy3aohyBK95vdj9/R 7WuH6QrYjEgh2JhkBIABMfcFNX9WW0Bu2vB7CO9Lix4idGxV2eb7BgMrVZoB5Cc21FtRULd9OnZ KmttsreCmRbBoyH5VOyaM89tAtbVBvrhTrXBA/tXOjQRqEHOtnX+WoeJfMXvfGEunRllDOM45H+ 7QpuQlnuwk1B46v2MB0z4MyFg0orhkS5YFbsUIrJ5talKoynhSlIENRpc0n/ondSjv4bmBUL7Nf MQhlA9LWraaOMM7XWp194iNSAvfVQWGF3JpjriASL0NVMcF/ 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: platform-driver-x86@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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 (mostly) ignored 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. 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/platform/x86/serial-multi-instantiate.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/platform/x86/serial-multi-instantiate.c b/drivers/platform/x86/serial-multi-instantiate.c index 5362f1a7b77c..cd25125b7923 100644 --- a/drivers/platform/x86/serial-multi-instantiate.c +++ b/drivers/platform/x86/serial-multi-instantiate.c @@ -265,13 +265,11 @@ static int smi_probe(struct platform_device *pdev) } } -static int smi_remove(struct platform_device *pdev) +static void smi_remove(struct platform_device *pdev) { struct smi *smi = platform_get_drvdata(pdev); smi_devs_unregister(smi); - - return 0; } static const struct smi_node bsg1160_data = { @@ -339,7 +337,7 @@ static struct platform_driver smi_driver = { .acpi_match_table = smi_acpi_ids, }, .probe = smi_probe, - .remove = smi_remove, + .remove_new = smi_remove, }; module_platform_driver(smi_driver); From patchwork Thu Mar 2 14:47: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: 13157388 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F0D1C6FA8E for ; Thu, 2 Mar 2023 14:48:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229505AbjCBOsE (ORCPT ); Thu, 2 Mar 2023 09:48:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230040AbjCBOry (ORCPT ); Thu, 2 Mar 2023 09:47:54 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 954A0E3AF for ; Thu, 2 Mar 2023 06:47:51 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXkDg-00046X-MP; Thu, 02 Mar 2023 15:47:44 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pXkDf-001Lsv-Ep; Thu, 02 Mar 2023 15:47:43 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pXkDe-001Zr7-Gn; Thu, 02 Mar 2023 15:47:42 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Hans de Goede , Mark Gross Cc: kernel@pengutronix.de, Greg Kroah-Hartman , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 28/29] platform/x86: wmi: Convert to platform remove callback returning void Date: Thu, 2 Mar 2023 15:47:31 +0100 Message-Id: <20230302144732.1903781-29-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> References: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1794; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=vINht6ojUFDqgv3t7NnT5jRF+UmY6wpfnULDkHfIdto=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkALb6O68NAGyM825FA1GeI2kBnh4ZSeuQ+fR2u yAw6iq7r0eJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAC2+gAKCRDB/BR4rcrs Cc+XB/4lFYU8LTWGolMf3K0oUcggqVhrI+67SZELHpQlMDMfyWJX+LlcPKRSZmvYs3Q6T2nehtt JIJUBYSnoVPqTE/SpLPCR3cwK3rajXld6eDxKP1jX7ObtBVTaUK9nEuttiC+gsxjIiYp/Xzh9H9 2SncwaWdNIS0TWl5EwEm2mmtNH2mHdSxziFo70KxABJof7BJSBnsh/M9AIQgodLKhZeJ9/9IxOU F1z3xN45EF+Q7ukBSHC8Z5XKpfDJKoWYp/9DPg9WQEePE5MLfXUBKPw7MjooXPou9KX/1KMcf3j zZ1oPMkLQtH8l7H8MyZiUUl+DKDl72tGf8e1+m3sPI3EU3BQ 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: platform-driver-x86@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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 (mostly) ignored 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. 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/platform/x86/wmi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c index 4fe7650dd014..d81319a502ef 100644 --- a/drivers/platform/x86/wmi.c +++ b/drivers/platform/x86/wmi.c @@ -1369,7 +1369,7 @@ static void acpi_wmi_notify_handler(acpi_handle handle, u32 event, event, 0); } -static int acpi_wmi_remove(struct platform_device *device) +static void acpi_wmi_remove(struct platform_device *device) { struct acpi_device *acpi_device = ACPI_COMPANION(&device->dev); @@ -1379,8 +1379,6 @@ static int acpi_wmi_remove(struct platform_device *device) ACPI_ADR_SPACE_EC, &acpi_wmi_ec_space_handler); wmi_free_devices(acpi_device); device_unregister(dev_get_drvdata(&device->dev)); - - return 0; } static int acpi_wmi_probe(struct platform_device *device) @@ -1468,7 +1466,7 @@ static struct platform_driver acpi_wmi_driver = { .acpi_match_table = wmi_device_ids, }, .probe = acpi_wmi_probe, - .remove = acpi_wmi_remove, + .remove_new = acpi_wmi_remove, }; static int __init acpi_wmi_init(void) From patchwork Thu Mar 2 14:47: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: 13157385 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AFEF5C678D4 for ; Thu, 2 Mar 2023 14:48:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230015AbjCBOsB (ORCPT ); Thu, 2 Mar 2023 09:48:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230096AbjCBOrx (ORCPT ); Thu, 2 Mar 2023 09:47:53 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79DF84391F for ; Thu, 2 Mar 2023 06:47:50 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXkDg-00047D-P2; Thu, 02 Mar 2023 15:47:44 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pXkDf-001Lsy-K7; Thu, 02 Mar 2023 15:47:43 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pXkDe-001ZrA-PF; Thu, 02 Mar 2023 15:47:42 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Hans de Goede , Mark Gross Cc: kernel@pengutronix.de, Greg Kroah-Hartman , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 29/29] platform/x86: xo1-rfkill: Convert to platform remove callback returning void Date: Thu, 2 Mar 2023 15:47:32 +0100 Message-Id: <20230302144732.1903781-30-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> References: <20230302144732.1903781-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1613; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=/cHo/OCIZQ5qmf/ucqmCGmO1pyy35MQ6zTCo8fFg0vg=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkALb+CScRPFDRsjjCksIWibKoudblETkcH6IrZ Xb/qz0BJV+JATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZAC2/gAKCRDB/BR4rcrs CVFdB/90zGKMc6uqyCIs6l3icW8VpmwLQ0oPsoq8vzU3e8rzwoxbZmGuMlA9aeLsDqh4UivkfAq jzRjdEEYrK3z9DuxGFmpqHVgF7DZom3ovHvfEQ/ScVj8RGrWOYuOKZLg4z6tQGzfKC948MaN8VT VlUmToaVFtPkNyl4VG9F3AocSbCEmeurnTE2GtEBIdu9pGx14HkfPRhD2d395XPjujV5N0I1HBe WFxgUGcISQgdcO9A4z+DVCSnX7G1IHR+2+hd9E7eB/a4CgWo2eJTS5iWdzRgdbBeoFnN2NOsVuz Z4vusWPbWzzmmMXYf4xe1K+5KfY/vY6RFIgbj7Kxr7HWPMLx 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.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: platform-driver-x86@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@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 (mostly) ignored 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. 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/platform/x86/xo1-rfkill.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/platform/x86/xo1-rfkill.c b/drivers/platform/x86/xo1-rfkill.c index cb3253c10ef3..e64d5646b4c7 100644 --- a/drivers/platform/x86/xo1-rfkill.c +++ b/drivers/platform/x86/xo1-rfkill.c @@ -56,12 +56,11 @@ static int xo1_rfkill_probe(struct platform_device *pdev) return 0; } -static int xo1_rfkill_remove(struct platform_device *pdev) +static void xo1_rfkill_remove(struct platform_device *pdev) { struct rfkill *rfk = platform_get_drvdata(pdev); rfkill_unregister(rfk); rfkill_destroy(rfk); - return 0; } static struct platform_driver xo1_rfkill_driver = { @@ -69,7 +68,7 @@ static struct platform_driver xo1_rfkill_driver = { .name = "xo1-rfkill", }, .probe = xo1_rfkill_probe, - .remove = xo1_rfkill_remove, + .remove_new = xo1_rfkill_remove, }; module_platform_driver(xo1_rfkill_driver);