Received: by 2002:ab2:7041:0:b0:1f4:bcc8:f211 with SMTP id x1csp125889lql; Fri, 12 Apr 2024 06:01:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVe+9B+Jb/DQYnub6Rw/u8jb0NTeBFUjiGo+QbpMx91UeYsJplFNVrcH4RorU/3h7atE8pZ09Y+yrRvwmkLO0RWD4QwxOK85OgxlfV9Cg== X-Google-Smtp-Source: AGHT+IF3GYHpjwcmWzga4l3cJS/3wFQ875UgEBbykCJ0mRDEZMExQg500deFqcDmOmN0+ZrH0ryD X-Received: by 2002:a05:6a20:8413:b0:1a7:9ed1:fc21 with SMTP id c19-20020a056a20841300b001a79ed1fc21mr3826401pzd.22.1712926864429; Fri, 12 Apr 2024 06:01:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712926864; cv=pass; d=google.com; s=arc-20160816; b=HViZU8cZvrEw1L1IfV40wW+gjI/v2H37QlFpMyjHLySlPXaC3yK6c3jhNzwpNwwoVB D4ZcT3UTZZnIGRZMVuHbmfM+Orp4e/vQWdMKWq/5+iaTccwuRP+LNWITDGPEe6pRG2Gh aajEefbgMCuKGjG3G4LD+faiBvLrxZNp6ZPnFT3YIeb78m/lBXcqly1G3gTQTTApX1ck jE18nARrR8+E7ACk/kIBZVVddqXdJfhRdsQk8Mu9ERKEaf3QCsjRpyVyBJ45Mouata8i IUfKXaWyDiXXzw3WK+/nR0nFv6aB0jza1uGkToAN4C8ypjTyT18wWWp0egyTzayZsRMj XEMQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=ampujH9jO/MKhLrYVdXZdbt4wcEJaWjGTtsK30VDw0U=; fh=zXbIufqd9nM0krmeInYtZyEri6TKR9eJW7DLD9eOg8U=; b=hDWKKsfRSPVEVrmqaGilr4EAY+NNwjXEIcZDPV2H1w8T1NCG3CyhumlrcG4Ja/BTnB jJlK4LaQccyaki/vKvzNXDbbWFi0m97wJiPasaEMG1OEkh7uhRAqCZ1tUen04XCX26Gt /NT0eEBbyteAbqNcbep1RRnn4KWCwM6d3uKfTE+j4Oe1x1HpPRoBzmqQN8KKVVZgQhrX CJhGynaS+MFJN51ahnQFfjwUY4wYFh/krmINRR/U79ziodwDdXeRHUhx2Lm4aaPIACzz LFCgtakokBSxl0Fvs0TLqCOSGC/x13yU4M4SkAjgf1nzWsb6ulkG9S4xHx20O1BNOymx Qeuw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@aruba.it header.s=a1 header.b=G0AypBFB; arc=pass (i=1 spf=pass spfdomain=enneenne.com dkim=pass dkdomain=aruba.it dmarc=pass fromdomain=enneenne.com); spf=pass (google.com: domain of linux-kernel+bounces-142674-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142674-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=enneenne.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id q136-20020a632a8e000000b005dc81a30771si3268085pgq.254.2024.04.12.06.01.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 06:01:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-142674-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=@aruba.it header.s=a1 header.b=G0AypBFB; arc=pass (i=1 spf=pass spfdomain=enneenne.com dkim=pass dkdomain=aruba.it dmarc=pass fromdomain=enneenne.com); spf=pass (google.com: domain of linux-kernel+bounces-142674-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142674-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=enneenne.com 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 D3D78284D0B for ; Fri, 12 Apr 2024 13:01:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 90FA559B79; Fri, 12 Apr 2024 13:00:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=aruba.it header.i=@aruba.it header.b="G0AypBFB" Received: from smtpcmd04132.aruba.it (smtpcmd04132.aruba.it [62.149.158.132]) (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 6443158231 for ; Fri, 12 Apr 2024 13:00:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.149.158.132 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712926856; cv=none; b=WfDnWJLul9YiLo2nY2mml6yphebqlo1H+O/AmmjE8GEysUsYFw1T9PxX7G1Y6XrIVFLW5odfXw1jKJhGyVF4Y+d6ofLrLyjoiOM5tgFkePKijvYA4HsCYOEkZTE+hNxDGndzD/vP2vYr5UASJp6faJrnaqdmRcVYdc8EXYEeVys= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712926856; c=relaxed/simple; bh=HPrU0Wyhp98Idg6SSCatKl3na2JRMkwQ26OormfXCTI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=axwZA0eOZw65xyZEOceLuO0O7cgGHbsbBlQG5r2e5avSfG5WO+AYIwJwAG6wkCl/vm+c9GO28Ms2mU0FR6f4DniaDflnNFGANvBmAzONBQ8SwLxTfFDwgH9umrHYO8S9/PZqfNgmvsAWTXVuqeHRngHjGobt9z5KBbjDEZz6vow= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=enneenne.com; spf=pass smtp.mailfrom=enneenne.com; dkim=pass (2048-bit key) header.d=aruba.it header.i=@aruba.it header.b=G0AypBFB; arc=none smtp.client-ip=62.149.158.132 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=enneenne.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=enneenne.com Received: from [192.168.1.57] ([79.0.204.227]) by Aruba Outgoing Smtp with ESMTPSA id vGWHrbMkVoq80vGWIrTNve; Fri, 12 Apr 2024 15:00:42 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aruba.it; s=a1; t=1712926842; bh=HPrU0Wyhp98Idg6SSCatKl3na2JRMkwQ26OormfXCTI=; h=Date:MIME-Version:Subject:To:From:Content-Type; b=G0AypBFB8BBUF6i720nidjUUkLEwRDx5W1ozwjWs/yXhhSZsaBwePJrnyJV5PuaB6 GFgmOc+v4S4qiNQ+XcuSeK4bQT8bnFx8HVwq0ucYi1awiH4cSJvr8Ik0mUNfjsypDs Kfi6P4k3I1xtbWwGxtwLwxozoHvuxlfn66rjox5fQCKiwFqJAyL0W9kQP/T/pFlkbh vK3YO1d19STZPRWjBBJCYuOmGdGUx02uWHhe/BJE1cdGQwuijfsvSRX8qMQXxshHeR KNedSVriZclvJIQ/FTrEYdqQi7PjDPlyWffAQDJrUhPbvJMtyadLFGrzFr+lzkBmD1 fsGOtDv+sIdNA== Message-ID: <30e27903-6f12-436a-a1bf-4d74749ac143@enneenne.com> Date: Fri, 12 Apr 2024 15:00:42 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] pps: clients: gpio: Convert to platform remove callback returning void To: =?UTF-8?Q?Uwe_Kleine-K=C3=B6nig?= Cc: linux-kernel@vger.kernel.org, kernel@pengutronix.de, Greg Kroah-Hartman References: From: Rodolfo Giometti Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4xfOw0KeEWS6ddACUBkGdfxZ8IgvhfHEeQA6KqVGi6JVdmI6ymCX7gWSeCK4WByCF2oofKHyOHRxJo1GDpeYdAtlxDbTFu4YTZE8kNB4jSsNd8FoTABBuY caw6PzL6dAy1bxke/3wSkd+lEi3CRFHf5VoFzT5uqCKHy0NoVTaXZ9PN2KqtEIFaVWODa9TSkgL776FSMktbMWneigo5yHX2NP9AIKnVBLRwWekUN8T98dlz yEWIuQOoTK6DkLWY99kOOfkpkmyaFoOW+tVt+4sovY5ajHeTDKB5GAJSJY5QW46fmnGamf/z7v8VKEWj4fHySA== On 08/03/24 09:51, Uwe Kleine-König 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. > > 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 Acked-by: Rodolfo Giometti > --- > drivers/pps/clients/pps-gpio.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/pps/clients/pps-gpio.c b/drivers/pps/clients/pps-gpio.c > index 2f4b11b4dfcd..791fdc9326dd 100644 > --- a/drivers/pps/clients/pps-gpio.c > +++ b/drivers/pps/clients/pps-gpio.c > @@ -220,7 +220,7 @@ static int pps_gpio_probe(struct platform_device *pdev) > return 0; > } > > -static int pps_gpio_remove(struct platform_device *pdev) > +static void pps_gpio_remove(struct platform_device *pdev) > { > struct pps_gpio_device_data *data = platform_get_drvdata(pdev); > > @@ -229,7 +229,6 @@ static int pps_gpio_remove(struct platform_device *pdev) > /* reset echo pin in any case */ > gpiod_set_value(data->echo_pin, 0); > dev_info(&pdev->dev, "removed IRQ %d as PPS source\n", data->irq); > - return 0; > } > > static const struct of_device_id pps_gpio_dt_ids[] = { > @@ -240,7 +239,7 @@ MODULE_DEVICE_TABLE(of, pps_gpio_dt_ids); > > static struct platform_driver pps_gpio_driver = { > .probe = pps_gpio_probe, > - .remove = pps_gpio_remove, > + .remove_new = pps_gpio_remove, > .driver = { > .name = PPS_GPIO_NAME, > .of_match_table = pps_gpio_dt_ids, > > base-commit: 8ffc8b1bbd505e27e2c8439d326b6059c906c9dd -- GNU/Linux Solutions e-mail: giometti@enneenne.com Linux Device Driver giometti@linux.it Embedded Systems phone: +39 349 2432127 UNIX programming