From patchwork Mon Dec 18 21:05: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: 180650 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp1532077dyi; Mon, 18 Dec 2023 13:06:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IG8V2TEJtcgPDTXRpe9DaJrJt0cMWglf2d7ECkFo0bC+jKFVXXuRfo/AWAQWX/WNWDeTP/l X-Received: by 2002:a05:6a20:5656:b0:18f:3b9e:31b9 with SMTP id is22-20020a056a20565600b0018f3b9e31b9mr7492965pzc.111.1702933578001; Mon, 18 Dec 2023 13:06:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702933577; cv=none; d=google.com; s=arc-20160816; b=duMn8qMkEFBKP5aPswKE3yzIRQBCJCsT3L9xv59LtNAjEF88PFL5tey2OErrbi14ua 1qh32+N1pRTlvwe6dn0Jal8K3xYMoLtD2owmKwJ3mQEIu+HyfBxIOL7s3Ap/hCtBeo/b z49Yga9lze6oexdSWjPyU15+037+YXEWppVPddDzOaLfKI61Qcgiz+VhquWC30E7xQkc z67N4UqLTql96lLWYHUjzrEN2840qYfgB15HRHxymgWXOEY+xbNxnBRxDbAmpo4xlc8h HKQGRvT4frGKafERBsD5eF00ZcA9JeevKGTi4Q/ICcDzWpA9ZuSfsB6PMmq8dYBb2Y4F 23Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=Ue0STAnPU2tQyoybwPFUH/FRnYJReLyRlNKBsIkbQtM=; fh=z+4mHlQ+bi7WTLlpPKhEQGijRz9jx1kHnkUntbLysbk=; b=oOcFXqyai/thNeVsS36aUv1HCHFHWubqIL+VWZSUvR4BM+rAPb7KnWvE+WLnLWhdS6 yh8wg86Spz7E7J+nRR+Y3X7ihlOeRyyaW982GocNqhQ0V6S1Pn9uRonq10WqZyIMQ37d +dJgqgwTV7xknrDO/0O93H2uKpW0l6u7RxI/c1kmcpjLN2mUdWNedrV1bb2J9HLg6yyN ajNInFQMEziGeIKonmR+XaU80w+Ni0nC1nQT3F0if6ZZ0BI4jco8iKHsJVrnvr3d3No4 TkmIanP8qLiihmEjMkELGtUot98pDatIUqxsx81yv0+eu9PNx98mcMxykQBUxJ0iehqk 8bSQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-4387-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4387-ouuuleilei=gmail.com@vger.kernel.org" Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id k9-20020a17090aaa0900b0028868ea872esi8252412pjq.43.2023.12.18.13.06.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 13:06:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4387-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-4387-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4387-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 BA037B2392E for ; Mon, 18 Dec 2023 21:06:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3258374E08; Mon, 18 Dec 2023 21:05:36 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E058573462 for ; Mon, 18 Dec 2023 21:05:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rFKnr-0002lo-6F; Mon, 18 Dec 2023 22:05:31 +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 1rFKnq-00GmX3-QE; Mon, 18 Dec 2023 22:05:30 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1rFKnq-005Y6J-HC; Mon, 18 Dec 2023 22:05:30 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Sudip Mukherjee Cc: kernel@pengutronix.de, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] parport: sunbpp: Convert to platform remove callback returning void Date: Mon, 18 Dec 2023 22:05:19 +0100 Message-ID: X-Mailer: git-send-email 2.42.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1799; i=u.kleine-koenig@pengutronix.de; h=from:subject:message-id; bh=ofIRXtKGpIt9OxfKBZODaGUOXDxcYP4SGgITVJt06dI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBlgLQOwZWLAI6JNeacXZ51oE/b3dXdV8luY9/ja rH4bM60HOeJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZYC0DgAKCRCPgPtYfRL+ ToBSB/kBsrql5HlXWGTX0aJUadzt/IWZGuBlY+vYyL7ylbIismb65+vtNdhJg2B1e5RplFcZXFX Th3yTeNzBHiE4RYcXjfacgrWMKq/9SmTw2VASr0uchyxFTttJT65rejkXD8q2viW1xh1oJqpzRk B4b+pIG41WwAcnPDgP88luVXvSbv9mNwDf2nJTqnJQVWnVPuPkGwlf61acbunLsf3ev5VaIMNfO jm7/xwMRjAkMv46q8jy6CrJsmQc0KSHa5xYJ8Z0xZ4oYEwNknSQzLb5SW45pQlAz1mHQrQB0a0V TuxsfYRRAQWJ54+PeWBshDpWZfGtmMtlAJh66rFbZUNoj1xg 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: 1785655279701766090 X-GMAIL-MSGID: 1785655279701766090 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/parport/parport_sunbpp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/parport/parport_sunbpp.c b/drivers/parport/parport_sunbpp.c index c81d4d86994b..949236a7a27c 100644 --- a/drivers/parport/parport_sunbpp.c +++ b/drivers/parport/parport_sunbpp.c @@ -334,7 +334,7 @@ static int bpp_probe(struct platform_device *op) return err; } -static int bpp_remove(struct platform_device *op) +static void bpp_remove(struct platform_device *op) { struct parport *p = dev_get_drvdata(&op->dev); struct parport_operations *ops = p->ops; @@ -351,8 +351,6 @@ static int bpp_remove(struct platform_device *op) kfree(ops); dev_set_drvdata(&op->dev, NULL); - - return 0; } static const struct of_device_id bpp_match[] = { @@ -370,7 +368,7 @@ static struct platform_driver bpp_sbus_driver = { .of_match_table = bpp_match, }, .probe = bpp_probe, - .remove = bpp_remove, + .remove_new = bpp_remove, }; module_platform_driver(bpp_sbus_driver);