From mboxrd@z Thu Jan 1 00:00:00 1970 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 15D0AC77B7D for ; Mon, 8 May 2023 02:37:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4858110E0CA; Mon, 8 May 2023 02:37:20 +0000 (UTC) Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4F73A10E0CA for ; Mon, 8 May 2023 02:37:18 +0000 (UTC) Received: from pendragon.ideasonboard.com (softbank126090219015.bbtec.net [126.90.219.15]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id CE236814; Mon, 8 May 2023 04:37:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1683513431; bh=fKoGX3ASbejpGXJOihDLXjS2bDBgNnpg+A7ySP8QXlw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=P0EbuVqx3ZXQnqfhHr2kWWlTOzLVS4/DgRoQ+piHLCh9+XhPOw6SorbqZUFrQtdMA a/EOMC4aKUcf270NQ3WY2WeAdYIQWyCqobBvN8ZzTpUUxZNWnf93SZVXS3uwYyd6ps CtJASEYYkHwZb0ao5sO2vBatK4it3HTHjA2FvUn0= Date: Mon, 8 May 2023 05:37:29 +0300 From: Laurent Pinchart To: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= Subject: Re: [PATCH 07/53] drm/bridge: cdns-dsi: Convert to platform remove callback returning void Message-ID: <20230508023729.GD23514@pendragon.ideasonboard.com> References: <20230507162616.1368908-1-u.kleine-koenig@pengutronix.de> <20230507162616.1368908-8-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230507162616.1368908-8-u.kleine-koenig@pengutronix.de> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Neil Armstrong , Robert Foss , Andrzej Hajda , Jonas Karlman , Tomi Valkeinen , Jernej Skrabec , dri-devel@lists.freedesktop.org, Jayshri Pawar , kernel@pengutronix.de, Rahul T R Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi Uwe, Thank you for the patch. On Sun, May 07, 2023 at 06:25:30PM +0200, 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 (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 Reviewed-by: Laurent Pinchart > --- > drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c > index 5dbfc7226b31..f50d65f54314 100644 > --- a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c > +++ b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c > @@ -1278,7 +1278,7 @@ static int cdns_dsi_drm_probe(struct platform_device *pdev) > return ret; > } > > -static int cdns_dsi_drm_remove(struct platform_device *pdev) > +static void cdns_dsi_drm_remove(struct platform_device *pdev) > { > struct cdns_dsi *dsi = platform_get_drvdata(pdev); > > @@ -1288,8 +1288,6 @@ static int cdns_dsi_drm_remove(struct platform_device *pdev) > dsi->platform_ops->deinit(dsi); > > pm_runtime_disable(&pdev->dev); > - > - return 0; > } > > static const struct of_device_id cdns_dsi_of_match[] = { > @@ -1303,7 +1301,7 @@ MODULE_DEVICE_TABLE(of, cdns_dsi_of_match); > > static struct platform_driver cdns_dsi_platform_driver = { > .probe = cdns_dsi_drm_probe, > - .remove = cdns_dsi_drm_remove, > + .remove_new = cdns_dsi_drm_remove, > .driver = { > .name = "cdns-dsi", > .of_match_table = cdns_dsi_of_match, > -- > 2.39.2 > -- Regards, Laurent Pinchart