From patchwork Sun Feb 25 15:54:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 206079 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp1634939dyb; Sun, 25 Feb 2024 07:56:02 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWd4HneirAhDIKrpnp1/r5vM3Q5s6aKuGZYFcVBNN7FjizkuMo90k4UZZusVsWDIa6gYjdLwjPPwq4uTPU4b5ICpCNnLg== X-Google-Smtp-Source: AGHT+IG6LGvt/jk2p2S5oNqvqYgMgQupbUeusdsK7zu0NpE3FRT8TfzWrqyP9OxdG79QOeX4w7qw X-Received: by 2002:a17:903:32cc:b0:1db:3a89:775b with SMTP id i12-20020a17090332cc00b001db3a89775bmr6702659plr.3.1708876562558; Sun, 25 Feb 2024 07:56:02 -0800 (PST) Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id v7-20020a170902b7c700b001d7587f372dsi2270214plz.213.2024.02.25.07.56.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 07:56:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-80171-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-80171-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80171-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 6154928153F for ; Sun, 25 Feb 2024 15:56:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BD97C199AB; Sun, 25 Feb 2024 15:55:19 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5CDAE101F2 for ; Sun, 25 Feb 2024 15:55:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708876517; cv=none; b=BR05nIQUmM2aT8rScYu0tVX4iAlvJiWYauOSiSO8CEuPlNG8Lr4IpmIQuc1pRGs6ZjHQVAS+PfutSHGAQ3OPu2sggS6j35d7yQVXbzPmP3FycF/jhW0AF0c7WU5aDnYnlNYuIbEmIXz19EIGIdcd86GXI4Iencm49DkgRD5+gCQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708876517; c=relaxed/simple; bh=s6vZIouknbu6Awi/o8UkPOP4WthXa1canuPxSaFlTYA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=IgwdOOkY9En5bvAnPlPjYwZZg1pS/vzIhi0gbaRCLbNqvoT9RaRL32EG2/ux06AyC+0YIddmOCbymQlHOsNdxUV9voFLSbwz+sLIR2xSPWdM8SgIMPOvrn0tOE2ggBoLM8YAZzve5NVl4n9G8OCp2ITvzlyxbxv0wI5rELe9hl0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1reGqN-00006V-HQ; Sun, 25 Feb 2024 16:55:11 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1reGqM-002pKA-NI; Sun, 25 Feb 2024 16:55:10 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1reGqM-00BKos-25; Sun, 25 Feb 2024 16:55:10 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: MyungJoo Ham , Chanwoo Choi Cc: linux-kernel@vger.kernel.org Subject: [PATCH 1/7] extcon: adc-jack: Convert to platform remove callback returning void Date: Sun, 25 Feb 2024 16:54:50 +0100 Message-ID: <14d30788ecd288b1b0983a8ea224499bbaa5de19.1708876186.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1778; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=s6vZIouknbu6Awi/o8UkPOP4WthXa1canuPxSaFlTYA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBl22LPsxNnPL0evMcAjnNFGov2Wfat6TOeAzNCi VRiRv/W3c6JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZdtizwAKCRCPgPtYfRL+ Th+tCACOyFpFEjjXjtjC+3b0kCNOQPgfUCbHrBdNDdI3B87G9sx7AwukJ5lwlxG0+i0zGSytpmf VqVha3q6a6+PlveYv/YSFmc+mRh+AXvTPaJHIX+HCpyy93jl6tvcThtPiMhIu5mwc4ysvZTXB3H 3duhdIqcDfzJJT0ck7iQ+T5th8evyJWEFWOCD/1Pe3rjYa5ZUSC95JriXvD8Lsu9DegqaOMm9s6 Eu9gDS31NeIApWNsy6irC2rFqesgFlzUk6z2Vf25Yk3Wix2MGsWCb5HBF8MaDYg6IjlzBc6EMV8 WG+Zei3Yg5m+3ykaQJgvTDcH7hHrt3BTuh8nXfN7dS6XyxYd X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791886950722808183 X-GMAIL-MSGID: 1791886950722808183 The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/extcon/extcon-adc-jack.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/extcon/extcon-adc-jack.c b/drivers/extcon/extcon-adc-jack.c index 0317b614b680..cf5050a244b2 100644 --- a/drivers/extcon/extcon-adc-jack.c +++ b/drivers/extcon/extcon-adc-jack.c @@ -158,14 +158,12 @@ static int adc_jack_probe(struct platform_device *pdev) return 0; } -static int adc_jack_remove(struct platform_device *pdev) +static void adc_jack_remove(struct platform_device *pdev) { struct adc_jack_data *data = platform_get_drvdata(pdev); free_irq(data->irq, data); cancel_work_sync(&data->handler.work); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -196,7 +194,7 @@ static SIMPLE_DEV_PM_OPS(adc_jack_pm_ops, static struct platform_driver adc_jack_driver = { .probe = adc_jack_probe, - .remove = adc_jack_remove, + .remove_new = adc_jack_remove, .driver = { .name = "adc-jack", .pm = &adc_jack_pm_ops, From patchwork Sun Feb 25 15:54:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 206084 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp1635697dyb; Sun, 25 Feb 2024 07:58:41 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXJf77XmYu7EtyZR2GIkYwzs6t7eecywJOK8wi4YysfDRJdcswsGx3cuvAZ030T6D5pV8MD7ViRn3aLTUQZWnlKhIPIJw== X-Google-Smtp-Source: AGHT+IFTxbESPo+fn/OgAHVAFg/rAcgMu8Euow5S2y5WT1tuWr4gvXodXvxSu62mN5VW/W+Ouehn X-Received: by 2002:a05:6e02:118a:b0:365:12e:4ef1 with SMTP id y10-20020a056e02118a00b00365012e4ef1mr5433254ili.5.1708876721307; Sun, 25 Feb 2024 07:58:41 -0800 (PST) Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id lv13-20020a1709032a8d00b001dbc6f9e3a8si2294784plb.66.2024.02.25.07.58.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 07:58:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-80174-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-80174-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80174-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 3A4F6B21E69 for ; Sun, 25 Feb 2024 15:56:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 659AC1B96E; Sun, 25 Feb 2024 15:55:21 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0ADBF1799F for ; Sun, 25 Feb 2024 15:55:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708876519; cv=none; b=TzZGRwxJJPgWdmyuWGNYzo465TBBDMBd8Qqy7TLOTjxTHTqUpKOQ3OB/SFyyfD+VY8TXmmuoxxXP7HtdhGnM3CoLoJ59A3QZ0eoTYnTJQqwCvMqeS0nv3zAQSrSNMfwmnLzoYC34i+o7jYsisdNJUb88usG2ag+eSy/YQhbz4UI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708876519; c=relaxed/simple; bh=UuZYWOa89eHlHR4UPrFuYfV6ZZKmYfISpH6emRmR32Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ecFONfOhe5XaK5iLhO2QLPDZs0l+0BGGmFVdVRXf6KF9ECIvM4Z9kBVMXdHj2n6zp58R4ynhQQ5F/PoRrU9bHnED+MGQ8IohCGjd5BjewQiYS89TXBmp+w6L0dRBHYn9okTZSMvFW+T/ZFsc1SreC16I0a+KvvnddBx2lLf0fJ4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1reGqN-00006W-HQ; Sun, 25 Feb 2024 16:55:11 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1reGqM-002pKF-W4; Sun, 25 Feb 2024 16:55:11 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1reGqM-00BKow-2w; Sun, 25 Feb 2024 16:55:10 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: MyungJoo Ham , Chanwoo Choi Cc: linux-kernel@vger.kernel.org Subject: [PATCH 2/7] extcon: intel-cht-wc: Convert to platform remove callback returning void Date: Sun, 25 Feb 2024 16:54:51 +0100 Message-ID: <87f0b8f158565cb9ea68b42db2bb018f82a7ee27.1708876186.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1845; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=UuZYWOa89eHlHR4UPrFuYfV6ZZKmYfISpH6emRmR32Q=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBl22LRMs74IYM8KRHlBfQXhdldwEVVxjWhCHuZm RiEsmGOlpeJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZdti0QAKCRCPgPtYfRL+ Ts38CACjV8KO4l/kx+h6REYW4CyVrftN7YTwT/P0yw1bDYD9Z1G2pFm+Cj7nDHK1oPCRKuyyoK1 2JiC4gDn1T9eR7ZA5amZcpMqAOEwtlaxruP8A50FFGvWrCOPIjSXjnp0ukRWkIrpA4aswI+5V7n ZB1vB3Ou8gKeDBuiFlW+P9vB14pd3hX1Y8A30RUvjaTlndh5eggF1xc01bUecMoZzPwWNC9/55m PY74KaL1dMcwI6lW7xBfbk6oqc5GOd4xxK/ev6TftR+MBOrgFum+9r7Jz04BROX9YCgAi2a8gU5 W7jyM4fQFvxhpTOTDsISooBOtt0O77nE23T2DsbhHAPq3syA X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791887116882839966 X-GMAIL-MSGID: 1791887116882839966 The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/extcon/extcon-intel-cht-wc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/extcon/extcon-intel-cht-wc.c b/drivers/extcon/extcon-intel-cht-wc.c index 2c55f06ba699..733c470c3102 100644 --- a/drivers/extcon/extcon-intel-cht-wc.c +++ b/drivers/extcon/extcon-intel-cht-wc.c @@ -617,13 +617,11 @@ static int cht_wc_extcon_probe(struct platform_device *pdev) return ret; } -static int cht_wc_extcon_remove(struct platform_device *pdev) +static void cht_wc_extcon_remove(struct platform_device *pdev) { struct cht_wc_extcon_data *ext = platform_get_drvdata(pdev); cht_wc_extcon_sw_control(ext, false); - - return 0; } static const struct platform_device_id cht_wc_extcon_table[] = { @@ -634,7 +632,7 @@ MODULE_DEVICE_TABLE(platform, cht_wc_extcon_table); static struct platform_driver cht_wc_extcon_driver = { .probe = cht_wc_extcon_probe, - .remove = cht_wc_extcon_remove, + .remove_new = cht_wc_extcon_remove, .id_table = cht_wc_extcon_table, .driver = { .name = "cht_wcove_pwrsrc", From patchwork Sun Feb 25 15:54:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 206083 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp1635212dyb; Sun, 25 Feb 2024 07:56:56 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVuFEHlTuHEsv30nEcwuoDcIa1H73CzQGRSwXRb3wXGwY8gGrmPbIV4874SlKNEJubxYcwKs/a+zEK3mH2Ml4xzDuFh5w== X-Google-Smtp-Source: AGHT+IEZqwAhArHXwt/igif/2148NuZnZ0pwTONZ6Lfn0ygjlNiNauPhAD+Gd5DChxUbyd0LjmX4 X-Received: by 2002:a0c:f00c:0:b0:68f:87a6:19b8 with SMTP id z12-20020a0cf00c000000b0068f87a619b8mr4872997qvk.4.1708876615843; Sun, 25 Feb 2024 07:56:55 -0800 (PST) Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id gs12-20020a056214226c00b0068ff2a48f5esi2673173qvb.33.2024.02.25.07.56.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 07:56:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-80177-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-80177-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80177-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 9F5EA1C210AE for ; Sun, 25 Feb 2024 15:56:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 991701BDCE; Sun, 25 Feb 2024 15:55:22 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0AD9717997 for ; Sun, 25 Feb 2024 15:55:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708876521; cv=none; b=IaxvO/8nWDOCYXyJGMm15y4Nnmpz0Mw9ZHHqfhd8RDmZiWJ7IhegVbCL1ZWMCx2zUileLhd2ZbE8hPARPzeQZ4usMdxRbQukxBrCrCLQvZxvpqqDXwESf3BKwL+Sy8flnbS6v3DOTihApHtaeaHRTSpk2xMoSD2BwbXcPqEHx3c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708876521; c=relaxed/simple; bh=5+wahzvFXfhwoK5/hkP6C6S5OwJLhfKiDIIXZS94iYw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=iB1fpWhWqy8jt6c/bh16N54RJhksENRyDj5njYCYTLLA5w2v/Twi1GyGIC9gwS8DVFN9HrIoInIR7Dwf8H8WJ7g4PypBrgxBlusRY8gblQC7DTkeUwAvVkdvsKxHl4NGHaQPgRf0ObcVsnt8jbh37GDLc/JyFaAzrm8D4jLfYW4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1reGqN-00006X-JG; Sun, 25 Feb 2024 16:55:11 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1reGqN-002pKI-6t; Sun, 25 Feb 2024 16:55:11 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1reGqN-00BKp0-0Q; Sun, 25 Feb 2024 16:55:11 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: MyungJoo Ham , Chanwoo Choi Cc: linux-kernel@vger.kernel.org Subject: [PATCH 3/7] extcon: intel-mrfld: Convert to platform remove callback returning void Date: Sun, 25 Feb 2024 16:54:52 +0100 Message-ID: <7223e19152980ef553e38cf56c2b38ec099586e0.1708876186.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1825; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=5+wahzvFXfhwoK5/hkP6C6S5OwJLhfKiDIIXZS94iYw=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBl22LSLGDOjpPuxr+z7CQx4Bvbn37MIxmaywS2U dYAYcl0MYiJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZdti0gAKCRCPgPtYfRL+ Tn5/B/4rOhT3SHhaYmtgKfbUM/p0qA2T8Fzmpu6xn4TU5jD7v6q4SVFOhYEPZeU/2i0H6UyNSAy coZ5VpGrW+qb/DN7pQldGOXzfkKSM8sdp6eYFyiuqcXRl6mTMLRC2+iE6oFWzArzjK+JhjPLagh qIz58FSFUGLcHFO+tfdUigmMulXZQxiBgDT4Dqaw9mUeX3lGRg0lGxx+vH1JsiLivBX4fYqS2ba mQxiEtalvmZxs+o3ug2i6etVl/rJZHQabHkfpCiwV0nL9RH1/9qT5pXjpsGbTDTuuHsdv9SwwNL 1U7q+gubiZFKoIioHsN2FNUzO6D2oi6zbdLLqjJ8TZy0b4h+ X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791887006309370942 X-GMAIL-MSGID: 1791887006309370942 The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/extcon/extcon-intel-mrfld.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/extcon/extcon-intel-mrfld.c b/drivers/extcon/extcon-intel-mrfld.c index e96947fb76ee..12a041a58578 100644 --- a/drivers/extcon/extcon-intel-mrfld.c +++ b/drivers/extcon/extcon-intel-mrfld.c @@ -257,13 +257,11 @@ static int mrfld_extcon_probe(struct platform_device *pdev) return 0; } -static int mrfld_extcon_remove(struct platform_device *pdev) +static void mrfld_extcon_remove(struct platform_device *pdev) { struct mrfld_extcon_data *data = platform_get_drvdata(pdev); mrfld_extcon_sw_control(data, false); - - return 0; } static const struct platform_device_id mrfld_extcon_id_table[] = { @@ -277,7 +275,7 @@ static struct platform_driver mrfld_extcon_driver = { .name = "mrfld_bcove_pwrsrc", }, .probe = mrfld_extcon_probe, - .remove = mrfld_extcon_remove, + .remove_new = mrfld_extcon_remove, .id_table = mrfld_extcon_id_table, }; module_platform_driver(mrfld_extcon_driver); From patchwork Sun Feb 25 15:54:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 206082 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp1635117dyb; Sun, 25 Feb 2024 07:56:40 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWEnEHo7QwHYwiIGmf1Im8CTPe94dKlJXUA8g8wa3i6RbFmy4T7VD204bxJB1osK7P2MoGSApUK5DqTKtHpCmHS/Xw24Q== X-Google-Smtp-Source: AGHT+IFANnUtdttFgUMOd8P03TOh0cVznqC8rkHNqvyntty4iubczvo5uhGMuU5XEOztrHpFmzv9 X-Received: by 2002:a05:6a20:c709:b0:19e:9bcb:9344 with SMTP id hi9-20020a056a20c70900b0019e9bcb9344mr6115639pzb.53.1708876600127; Sun, 25 Feb 2024 07:56:40 -0800 (PST) Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id p37-20020a635b25000000b005e2712ca6besi2307635pgb.750.2024.02.25.07.56.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 07:56:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-80175-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-80175-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80175-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id ECE65281830 for ; Sun, 25 Feb 2024 15:56:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 81AAA1BC22; Sun, 25 Feb 2024 15:55:21 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 25C4417BA0 for ; Sun, 25 Feb 2024 15:55:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708876519; cv=none; b=Fy6jMAflEDVo4CnFc8qYMxiJOP+lpF8ObVNH7F94UmKAZynmG7cKWen1nk++VC8ygPZSChxumDwWuNpGHUZpMDzMyayfz5jhDzi+4zdKGbTPEn2NW5wm2PVwsbFmPEyGOqA+U3HW70vEcKH2vg9ywOayaF5KJ7eh+H6QH6Ey+jo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708876519; c=relaxed/simple; bh=lNC/jkKjyMMhL1AbItdI166xPrl21UQXTGooYKkG08A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XwLi3Tr8BN+Mi6nLTvMeLW9rPMQzJReNq1bP0CJuhLUVvX/G9lWlmIRyKk6Q4FcDqOnUa2W9qQhKq2gCE2sSUlKBK2HrQdMOVKp9CNXtJaOcpmvpXi2HTkxsT4h4AY+e3WzRHjozUqtxHfXcHs9MpTKPLTKxgadkGatp4OP+SwI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1reGqN-00006n-PY; Sun, 25 Feb 2024 16:55:11 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1reGqN-002pKL-Cu; Sun, 25 Feb 2024 16:55:11 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1reGqN-00BKp4-11; Sun, 25 Feb 2024 16:55:11 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: MyungJoo Ham , Chanwoo Choi Cc: linux-kernel@vger.kernel.org Subject: [PATCH 4/7] extcon: max3355: Convert to platform remove callback returning void Date: Sun, 25 Feb 2024 16:54:53 +0100 Message-ID: <2c017ea490f721646bd472e7d427eb377e4e8423.1708876186.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1776; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=lNC/jkKjyMMhL1AbItdI166xPrl21UQXTGooYKkG08A=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBl22LTLyXXIKJjBKLJgy5ASgg+jYNeJfflvaKsJ 8fauJJcUX2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZdti0wAKCRCPgPtYfRL+ TiSuB/43VdydmkpZlhwkU5iMQ1XZ2Ybo9gVzHvRx27qpTLrBXC+Q3AwEnoGWeaD3fAZiire+clr pCfFqlcu2/uacxE00cShaW/Y2bvGacOgEFYHEz5SNBi2wVnDfOi4K+xKomgKk1E09LYFkO9HQ6c 2J9FQu2E6p3EXMux/IB1lXPzwg81Al4K/NeRbZ/p6UM+hhF/QqmbNtE+sBWSGQ/1HqOmC4Am8GH J+JFa6ZQiJBlTLRLbVVNvqbUhay09OEOm4+7gI7jy9ZKlst7LxpVMVxjCzvyg4ob4wfIBi4GN8r RnLrcxjYg+oTMCW1R7mP6WhNhUECZcV3eWp3JIZ21Z4i+cC+ X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791886989660815993 X-GMAIL-MSGID: 1791886989660815993 The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/extcon/extcon-max3355.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/extcon/extcon-max3355.c b/drivers/extcon/extcon-max3355.c index d7795607f693..e62ce7a8d131 100644 --- a/drivers/extcon/extcon-max3355.c +++ b/drivers/extcon/extcon-max3355.c @@ -112,13 +112,11 @@ static int max3355_probe(struct platform_device *pdev) return 0; } -static int max3355_remove(struct platform_device *pdev) +static void max3355_remove(struct platform_device *pdev) { struct max3355_data *data = platform_get_drvdata(pdev); gpiod_set_value_cansleep(data->shdn_gpiod, 0); - - return 0; } static const struct of_device_id max3355_match_table[] = { @@ -129,7 +127,7 @@ MODULE_DEVICE_TABLE(of, max3355_match_table); static struct platform_driver max3355_driver = { .probe = max3355_probe, - .remove = max3355_remove, + .remove_new = max3355_remove, .driver = { .name = "extcon-max3355", .of_match_table = max3355_match_table, From patchwork Sun Feb 25 15:54:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 206085 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp1635792dyb; Sun, 25 Feb 2024 07:59:00 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUM8GWqDc4Z1DbpCjjMClfk382v+wZvF0gQi0AtIZQnmfkPu+RfWWZLyIT4pV04qVNCrlpdAab6rX6kyHdfjjGKxLfOYA== X-Google-Smtp-Source: AGHT+IGkK+KoDLVrEhiFUwepheDwBgt6FR8cj5c3tGTCrSVpI59B/1kVvjzSLmjekQtvzmhCdd/J X-Received: by 2002:a17:90a:4094:b0:29a:5714:f9df with SMTP id l20-20020a17090a409400b0029a5714f9dfmr3011237pjg.35.1708876740383; Sun, 25 Feb 2024 07:59:00 -0800 (PST) Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id sv3-20020a17090b538300b00296fe939aacsi2362009pjb.124.2024.02.25.07.58.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 07:59:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-80176-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-80176-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80176-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 161F9B22089 for ; Sun, 25 Feb 2024 15:56:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 08F171BC53; Sun, 25 Feb 2024 15:55:22 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ADA201802E for ; Sun, 25 Feb 2024 15:55:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708876520; cv=none; b=KP0UFXAQ7e8j+Ei0KK9S6skidXVojVbB/SLJN6761vkzLFpyeZzOp7yBlwPBgsyTWu+GgqIOt0SZCoY0v8sQn3QE3JMVlhzfbpHr/t4ccCjgK67/tLb+BGM3WvR9w00Na4gVEUJx6DVjkiKX/7KV2uqA882ezD/RzkLPayma2hE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708876520; c=relaxed/simple; bh=ZzG9u5HNAgKsxobtMilQkgjY+MJvRQhpIBiOCphcdGc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=RxiXugCwwDwgkrbqMkoRDDjc5fjxrv9xdYq5gJyLW2epUpcm9b71w/ByvjdRbHEz8eUkgarkEgl5MUSsDajj0omYMankHky3Qqel++g/UpGmZ3QhnIj/Tp5T3rIsIGLi3bgzYWuLN2x2O+EzGiSPWGH0f4NZlDyGEgvsEddraBY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1reGqO-00006u-0K; Sun, 25 Feb 2024 16:55:12 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1reGqN-002pKO-K8; Sun, 25 Feb 2024 16:55:11 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1reGqN-00BKp8-1j; Sun, 25 Feb 2024 16:55:11 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Chanwoo Choi , MyungJoo Ham Cc: Krzysztof Kozlowski , linux-kernel@vger.kernel.org Subject: [PATCH 5/7] extcon: max77843: Convert to platform remove callback returning void Date: Sun, 25 Feb 2024 16:54:54 +0100 Message-ID: <30097beba928bf2073645f85d21fb9c1aee64991.1708876186.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2017; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=ZzG9u5HNAgKsxobtMilQkgjY+MJvRQhpIBiOCphcdGc=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBl22LUoKa7H3Upy3pf/E2K8o+nXOaA+29hZe2w7 /N02qrYTNeJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZdti1AAKCRCPgPtYfRL+ TjdeB/wM1LeQcIzHg9kKa+hU5X9Z+tkNYGy7YYsmnDqACXWxLt3TFfwActQfeeyTg1E0eE3bBoG ORl3fCXckYYs274dXFAXmvEBfpmxZKCZ/Zdoh+tXFN9VKr/lkvH1kHjLUQ+BvafWy9ojscTYAhw s88J7Mz95JHybGRBIhCYvBezDJKL/9mLLq3euRHUmNWyVZRnbnbuC0kuERc6Xx7QsfwDByqEoEW PB274I08+ZP3trBFvpbCGS4M5CZRC9039funZ9nNvCU9TPR/is3NURymxxXcGL5OBXLX2/8NV5X ukaHEvblRZxMU5IFLHDmPq4pPfXQY7ggD7SrJmPLFc3H/qTy X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791887137028041337 X-GMAIL-MSGID: 1791887137028041337 The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/extcon/extcon-max77843.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/extcon/extcon-max77843.c b/drivers/extcon/extcon-max77843.c index acb11a54f875..9849e3b8327e 100644 --- a/drivers/extcon/extcon-max77843.c +++ b/drivers/extcon/extcon-max77843.c @@ -928,7 +928,7 @@ static int max77843_muic_probe(struct platform_device *pdev) return ret; } -static int max77843_muic_remove(struct platform_device *pdev) +static void max77843_muic_remove(struct platform_device *pdev) { struct max77843_muic_info *info = platform_get_drvdata(pdev); struct max77693_dev *max77843 = info->max77843; @@ -936,8 +936,6 @@ static int max77843_muic_remove(struct platform_device *pdev) cancel_work_sync(&info->irq_work); regmap_del_irq_chip(max77843->irq, max77843->irq_data_muic); i2c_unregister_device(max77843->i2c_muic); - - return 0; } static const struct platform_device_id max77843_muic_id[] = { @@ -958,7 +956,7 @@ static struct platform_driver max77843_muic_driver = { .of_match_table = of_max77843_muic_dt_match, }, .probe = max77843_muic_probe, - .remove = max77843_muic_remove, + .remove_new = max77843_muic_remove, .id_table = max77843_muic_id, }; From patchwork Sun Feb 25 15:54:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 206081 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp1634951dyb; Sun, 25 Feb 2024 07:56:05 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX9jVrxSg1SZrt5s1H1FdXr5AnIBD62PY2fUQhqEfGoL7YKToORls4zHXr5VleTby5geaTdKW3GQVjtlo3JPgJktTsJVA== X-Google-Smtp-Source: AGHT+IG9L+/amBFokWKSjbUJWjS6NQSR5iSxh367mph/Lh7f4em+hqVfseNZH0QgZOqzGNlLv4I+ X-Received: by 2002:a05:6214:3d0d:b0:68f:f9a8:45e2 with SMTP id ol13-20020a0562143d0d00b0068ff9a845e2mr4038940qvb.24.1708876565659; Sun, 25 Feb 2024 07:56:05 -0800 (PST) Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id kl12-20020a056214518c00b0068f90fd3a59si3208497qvb.219.2024.02.25.07.56.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 07:56:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-80172-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-80172-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80172-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 7424A1C20F9F for ; Sun, 25 Feb 2024 15:56:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D97B319BBA; Sun, 25 Feb 2024 15:55:19 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9D6F611CBD for ; Sun, 25 Feb 2024 15:55:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708876517; cv=none; b=Ey849Gc6Zjiq7I4V/Z45KN2vA+m3xogNydIbTcDuhyGyqQN72y/7AmtTIAZu6/xORIAgttdIiDpyJoskUdHLcWbxd2TPapVpWZN9oujqj7Ta4cwIZga3Wq2P8ffOF+7mPdUWMGOqqQ0yUzQuzLfTkbupKBjkGV1ErimQQ1sJtvU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708876517; c=relaxed/simple; bh=bT3FPuKGfu5sg2ALrqyc+CPGB75k/LYeCfj/omk7rCE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=icAuhlhD1APGNIXTDzzPxXfrFB+QTg2wxnbllUYU+Q3f8IsMracgA8roSYSsLyM9Wp0yzOD1EyPRpxA27VfrbAWVUQMn73AOglUu+Ct68NTw8vyiQEVq7qvZL8IYaS9Fo7sdaDee4pz8zDvI7Aef12WGWfRGiAiAoGdOlSDhmGo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1reGqO-00007K-8l; Sun, 25 Feb 2024 16:55:12 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1reGqN-002pKU-ST; Sun, 25 Feb 2024 16:55:11 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1reGqN-00BKpC-2b; Sun, 25 Feb 2024 16:55:11 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: MyungJoo Ham , Chanwoo Choi Cc: linux-kernel@vger.kernel.org Subject: [PATCH 6/7] extcon: usb-gpio: Convert to platform remove callback returning void Date: Sun, 25 Feb 2024 16:54:55 +0100 Message-ID: <8914cd71b32e1f6298e65b84fb84370c73b4fe37.1708876186.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1808; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=bT3FPuKGfu5sg2ALrqyc+CPGB75k/LYeCfj/omk7rCE=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBl22LVgQQFCb4WwvMybozyNiyBwLzv2oMOJQDhd xa90QPLIdaJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZdti1QAKCRCPgPtYfRL+ ThNxCACUdOqD9UjEpa6woQDAlgPLPi/jUt2ART8HxYgqCyy5haCEq/+LUhyR7QY8KaPmLC+eGLQ Bb5c3NE1gFQyZfZbj99A7o1j7e0Mgmq8eEW8oyZlZhL3SNVtzhYhU0vVv2bkpCO34aGbhlICgw1 /4o8e9imO8sbvI4+oTwoCzeiuafn+nxxl/qoLGHo6TQ0uw96w/axiNmihVKY0nqSYvwY3w3KAk7 YGU6Oyn/Aszzr5MkRzLItaTmoXeT0dDUBKoYeP7hvcuitu0eS5tVvulVyPs/cHelbDQHiT+655q Mbb+lHN6WA4UF3PPNCNNgIMD6PdXPhDIBhZIFLLwt4MN1lrv X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791886954048185975 X-GMAIL-MSGID: 1791886954048185975 The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König --- drivers/extcon/extcon-usb-gpio.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/extcon/extcon-usb-gpio.c b/drivers/extcon/extcon-usb-gpio.c index 40d967a11e87..9b61eb99b7dc 100644 --- a/drivers/extcon/extcon-usb-gpio.c +++ b/drivers/extcon/extcon-usb-gpio.c @@ -193,14 +193,12 @@ static int usb_extcon_probe(struct platform_device *pdev) return 0; } -static int usb_extcon_remove(struct platform_device *pdev) +static void usb_extcon_remove(struct platform_device *pdev) { struct usb_extcon_info *info = platform_get_drvdata(pdev); cancel_delayed_work_sync(&info->wq_detcable); device_init_wakeup(&pdev->dev, false); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -281,7 +279,7 @@ MODULE_DEVICE_TABLE(platform, usb_extcon_platform_ids); static struct platform_driver usb_extcon_driver = { .probe = usb_extcon_probe, - .remove = usb_extcon_remove, + .remove_new = usb_extcon_remove, .driver = { .name = "extcon-usb-gpio", .pm = &usb_extcon_pm_ops, From patchwork Sun Feb 25 15:54:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 206080 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp1634944dyb; Sun, 25 Feb 2024 07:56:04 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU9DthbEvrgESeniaNp81RemHVhTkIQ7FEurCuiSklg6zS1+hutKmOxUh1jPHgvw3qJMwXUyMmgrg226xE62o0mxtbfkQ== X-Google-Smtp-Source: AGHT+IEZVGz2C3R5YU7iHg/+r5mJEKgI8LtoJsN4y1b4Ys2hCoyq/SAQl9RWJ87FmOhDh0EaHtAC X-Received: by 2002:a05:6512:3119:b0:512:901a:eb9e with SMTP id n25-20020a056512311900b00512901aeb9emr3100469lfb.58.1708876564355; Sun, 25 Feb 2024 07:56:04 -0800 (PST) Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id jg17-20020a170907971100b00a3f5198d988si1341028ejc.338.2024.02.25.07.56.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 07:56:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-80173-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-80173-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80173-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id ED6611F2150E for ; Sun, 25 Feb 2024 15:56:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C5E3D199B8; Sun, 25 Feb 2024 15:55:19 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 668AC1758E for ; Sun, 25 Feb 2024 15:55:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708876517; cv=none; b=ql227V1h+sH+YeW/qP/PW+7FXaZQa2Z5bpgMveyXeJ02uM2TazyVhS1JkVqQCKw0lMT0V2sgUorVPRqztjgLn9HP921vNgkxQKwFHr1zKvIuD1OGEpYwxSeTOVsaDZhxSd1xmyEk+CMABj4JCEIq/8oYv5Xf4JpgCO6dSERQVuc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708876517; c=relaxed/simple; bh=q+5lGv+CKGW/vgJ013raQ6VcEpihEHl9f/PMadC+rN8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XY1TixsjPVNYpZM8mKgyZ2CH6ib90OFeNQIghDGXVoSUOSscwF0kyDMN+WIdqC8Occ8ly1LRHa+syjgeLu+02nwR82tvBa9VZVxFT6o/+f2eooWju4yjygSTMJFHm8zLRNS6fKCtCCVLpv/C41Le44qbXGjkpzQv3E3eR6cesfw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1reGqO-00007l-Eg; Sun, 25 Feb 2024 16:55:12 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1reGqO-002pKZ-24; Sun, 25 Feb 2024 16:55:12 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1reGqN-00BKpG-3A; Sun, 25 Feb 2024 16:55:11 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: MyungJoo Ham , Chanwoo Choi Cc: Benson Leung , Guenter Roeck , linux-kernel@vger.kernel.org, chrome-platform@lists.linux.dev Subject: [PATCH 7/7] extcon: usbc-cros-ec: Convert to platform remove callback returning void Date: Sun, 25 Feb 2024 16:54:56 +0100 Message-ID: <52d0a4317d5372f1135259d4fbbd2822b86ba8f4.1708876186.git.u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1824; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=q+5lGv+CKGW/vgJ013raQ6VcEpihEHl9f/PMadC+rN8=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBl22LZ3uO4RQqSPB/2QbpCE/x0dS6kjv67OLUSv pq1ABfA1G+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZdti2QAKCRCPgPtYfRL+ TquvB/9P8u6y27a0w8JYAlfpqznfMd7dIhS8bQPSCN/utYqWefewC0vIyEDp3oFaNlc+NLSPzfn InnksNkubr4nIbAvoYaH7iou7PS7DBjDsC5+xcfUjlwra4UxKO6p1hcSI4m0FRZ+jZ/CgWeypPN MqRwFPuC347v0qSbkvYT8XIT1t0eVXO1huoj8qzNLpAeK0f1FgGlpDszrsbQbjtrypYAir04Es/ 7c7KMYRRvYOKsM2t4DyH+aDr5VEEZtpbBFgm8Wsvc5AVVEylpo5rtzfGq3CML3VVXQj+C0VozJl eRvQ3cV0VQCfZs6Gg1j7o37FtpCEDz3mEzLVs91CsNM75GyK X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791886952354315530 X-GMAIL-MSGID: 1791886952354315530 The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König Reviewed-by: Tzung-Bi Shih --- drivers/extcon/extcon-usbc-cros-ec.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/extcon/extcon-usbc-cros-ec.c b/drivers/extcon/extcon-usbc-cros-ec.c index fde1db62be0d..805a47230689 100644 --- a/drivers/extcon/extcon-usbc-cros-ec.c +++ b/drivers/extcon/extcon-usbc-cros-ec.c @@ -480,14 +480,12 @@ static int extcon_cros_ec_probe(struct platform_device *pdev) return ret; } -static int extcon_cros_ec_remove(struct platform_device *pdev) +static void extcon_cros_ec_remove(struct platform_device *pdev) { struct cros_ec_extcon_info *info = platform_get_drvdata(pdev); blocking_notifier_chain_unregister(&info->ec->event_notifier, &info->notifier); - - return 0; } #ifdef CONFIG_PM_SLEEP @@ -531,7 +529,7 @@ static struct platform_driver extcon_cros_ec_driver = { .of_match_table = of_match_ptr(extcon_cros_ec_of_match), .pm = DEV_PM_OPS, }, - .remove = extcon_cros_ec_remove, + .remove_new = extcon_cros_ec_remove, .probe = extcon_cros_ec_probe, };