Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp4017664rdb; Thu, 28 Dec 2023 07:33:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IG/g2LvBtUnQyvoVbBi/VAuY3HL8Ltkzkf/reCD1iBZ146+cVh8NiPNS7Ol54VFIDBiSoPk X-Received: by 2002:a05:6e02:b46:b0:35f:ef57:56a3 with SMTP id f6-20020a056e020b4600b0035fef5756a3mr11752231ilu.29.1703777588161; Thu, 28 Dec 2023 07:33:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703777588; cv=none; d=google.com; s=arc-20160816; b=nso3nklexEyl9y/1GlHNdO5/wxy8rki3Yp4tSSxuHattt1D4A+en8tVdv5fX8aThQT guP6HCTEl5tohmlI/cht5mTkARYuXPFqsnpgEx2xzRVvIKHkA66xrI3qwhFfZFrrgcjw MDkJwRRcy4nJd3bSgesXz8YPMBW1z8KpcjBwk89tNY2o0qqdHlD85t/4NSWT/0ogLQjX 9AVFEbHJkEzTzivPwh/EuGKa8XKiZhckPm8Jc0kkVqOt/2fabYIWOl2zfpgsoGyqwTYH cZel7coY4s9tzjXuEH4ChGOEoIP6Xg1QR4AU9OddFz/7zp8YfRWgeR+ZVEdwlcxmK2VQ E4SQ== 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 :subject:cc:to:from:date:dkim-signature; bh=P6CJBj0xWX4RV9JukYPkEh/D6jiq82hgKCzItyFByyY=; fh=oyEcTXHYMkGAEYVf0hN/rhJSVaOL43OZaieNRB9q2T4=; b=cflUZ3rFaDei7KV8LPsDITT73FSEW1K23VJr5uBpnGroebnUj3dFKlnV7QiIT7Qogu SHRKNEPl6PxmVXjWzNKU9y82GQalrc2p2h+05Nt9JIdJV5PYMIG9By54QmWH1gsaOR8y /qv4AQLGpPK2gCg+8oHU7FemVc2Sh90LuW5KOKPycmyrL+ajMXfQHne2LRGnW/BsHodF HRZs4+94eoQI65CIkNy3PXzcmTAABRmaKHEWXrcSQ4d4ridkbimRmLPmf3eVHu1e8GIO CmZXopbkcsG95Mk0MFyauFEV3aHSrF6wm1r1m6k/5/k+r0P7spZiyMlUw4z+JqIaPgdw nFrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bV24B82m; spf=pass (google.com: domain of linux-kernel+bounces-12760-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12760-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id k13-20020a63560d000000b005c6251da182si13195899pgb.226.2023.12.28.07.33.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Dec 2023 07:33:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12760-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bV24B82m; spf=pass (google.com: domain of linux-kernel+bounces-12760-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12760-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 BEB12285676 for ; Thu, 28 Dec 2023 15:33:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3829CF4E1; Thu, 28 Dec 2023 15:33:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bV24B82m" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 70900F4E3 for ; Thu, 28 Dec 2023 15:32:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0DA57C433C7; Thu, 28 Dec 2023 15:32:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1703777577; bh=LG5wfSfrHn99aGr2v7pF+1hWyoSHf6YdWgLzSdkpESY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=bV24B82mQKHqGjRSKXLYULLUfp7zHybS5xhk1FSm3DTpIpcPnZRKHf9FlpCpbzNhr k+uBiy+6ucOzWB8lI+gJok+Pl5pAPIWPsqVbsSnfQw+SJJfrCMaG0a+M0Q8znK6hgz 9so5rJKSAs651AWD1mN4hsbxBLZ+y47bpmjVGhWzbiLUizTHWrJtI0XMZQ/hMABNHK s3cImwgPGu7aVK+H6Cm826b02aidEoMkd8LqTOompL4wMSPfcSgtxBYKb6tebA1sC2 4s3MQAoHBfTj8XGt/9CqQZsc3Y8qpu2RLDhwf05KxpIN/piBJvLWb24u6EeJtMwGN0 FAQ/FWD2Kl/RQ== Date: Thu, 28 Dec 2023 16:32:54 +0100 From: Marek =?UTF-8?B?QmVow7pu?= To: Uwe =?UTF-8?B?S2xlaW5lLUvDtm5pZw==?= Cc: kernel@pengutronix.de, linux-kernel@vger.kernel.org Subject: Re: [PATCH 10/11] firmware: turris-mox-rwtm: Convert to platform remove callback returning void Message-ID: <20231228163254.72b770ba@dellmb> In-Reply-To: <9074d1ad2e889425991fecad664781ae27b2418a.1703693980.git.u.kleine-koenig@pengutronix.de> References: <9074d1ad2e889425991fecad664781ae27b2418a.1703693980.git.u.kleine-koenig@pengutronix.de> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, 27 Dec 2023 17:26:34 +0100 Uwe Kleine-K=C3=B6nig wrote: > 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. >=20 > 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(). >=20 > Trivially convert this driver from always returning zero in the remove > callback to the void returning variant. >=20 > Signed-off-by: Uwe Kleine-K=C3=B6nig > --- > drivers/firmware/turris-mox-rwtm.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) >=20 > diff --git a/drivers/firmware/turris-mox-rwtm.c b/drivers/firmware/turris= -mox-rwtm.c > index 2de0fb139ce1..31d962cdd6eb 100644 > --- a/drivers/firmware/turris-mox-rwtm.c > +++ b/drivers/firmware/turris-mox-rwtm.c > @@ -554,7 +554,7 @@ static int turris_mox_rwtm_probe(struct platform_devi= ce *pdev) > return ret; > } > =20 > -static int turris_mox_rwtm_remove(struct platform_device *pdev) > +static void turris_mox_rwtm_remove(struct platform_device *pdev) > { > struct mox_rwtm *rwtm =3D platform_get_drvdata(pdev); > =20 > @@ -562,8 +562,6 @@ static int turris_mox_rwtm_remove(struct platform_dev= ice *pdev) > sysfs_remove_files(rwtm_to_kobj(rwtm), mox_rwtm_attrs); > kobject_put(rwtm_to_kobj(rwtm)); > mbox_free_channel(rwtm->mbox); > - > - return 0; > } > =20 > static const struct of_device_id turris_mox_rwtm_match[] =3D { > @@ -576,7 +574,7 @@ MODULE_DEVICE_TABLE(of, turris_mox_rwtm_match); > =20 > static struct platform_driver turris_mox_rwtm_driver =3D { > .probe =3D turris_mox_rwtm_probe, > - .remove =3D turris_mox_rwtm_remove, > + .remove_new =3D turris_mox_rwtm_remove, > .driver =3D { > .name =3D DRIVER_NAME, > .of_match_table =3D turris_mox_rwtm_match, Reviewed-by: Marek Beh=C3=BAn