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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BDA69C83F16 for ; Mon, 28 Aug 2023 09:12:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229810AbjH1JLu (ORCPT ); Mon, 28 Aug 2023 05:11:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229892AbjH1JLT (ORCPT ); Mon, 28 Aug 2023 05:11:19 -0400 Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BD62131; Mon, 28 Aug 2023 02:11:01 -0700 (PDT) Received: from pps.filterd (m0369458.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 37S8UX7F026285; Mon, 28 Aug 2023 11:10:50 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s= selector1; bh=++Z9W352LrkHIhiuvZ/btgckmjm3FHEDCFBUAFfqJ8c=; b=w5 6GaASUsoagtYjF9phFvOQ9AmQvf+L15wAUvt0bAfEJVoNaceIy/Z6ezOk52CPLv5 IrKPt3mTfayrM3vLkzUVsNheVRKzcswF/VJY93nwUaa1AiuphBL6wd5eU/aJJ0ey GvIETU8o+RhitQ22och/DBfcSPxP1/HPcihweReZpJiQHCMx1M6f/tI6rFGzx95e oomB87kyxswUQP5uAuA37qfKP0fwAFLJpJR7n/zgWkdKzqIK9dWwjsDIlFk9OuC7 y/lRgYWUa8hsYyGxoKXgr/Vp+gRARFbMIfHaHRyKQ1nQJXmGUruLRCMSKyEcjB31 oVQUe9FRFwL+llh/uzFA== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3sqtxyme78-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 28 Aug 2023 11:10:50 +0200 (MEST) Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id CF16D100056; Mon, 28 Aug 2023 11:10:49 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node1.st.com [10.75.129.69]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 9D54B218628; Mon, 28 Aug 2023 11:10:49 +0200 (CEST) Received: from [10.201.20.38] (10.201.20.38) by SHFDAG1NODE1.st.com (10.75.129.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Mon, 28 Aug 2023 11:10:49 +0200 Message-ID: <72e27136-67ef-403a-ad87-1d0eab87f5d5@foss.st.com> Date: Mon, 28 Aug 2023 11:10:48 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v3 46/62] mmc: sdhci-st: Convert to platform remove callback returning void Content-Language: en-US To: Yangtao Li , Adrian Hunter , Ulf Hansson CC: =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= , , , References: <20230727070051.17778-1-frank.li@vivo.com> <20230727070051.17778-46-frank.li@vivo.com> From: Patrice CHOTARD In-Reply-To: <20230727070051.17778-46-frank.li@vivo.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.201.20.38] X-ClientProxiedBy: SHFCAS1NODE1.st.com (10.75.129.72) To SHFDAG1NODE1.st.com (10.75.129.69) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-08-28_06,2023-08-25_01,2023-05-22_02 Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org On 7/27/23 09:00, Yangtao Li 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. > > Cc: Uwe Kleine-König > Signed-off-by: Yangtao Li > Acked-by: Adrian Hunter > --- > drivers/mmc/host/sdhci-st.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/mmc/host/sdhci-st.c b/drivers/mmc/host/sdhci-st.c > index 6415916fbd91..d955b5f4b7e9 100644 > --- a/drivers/mmc/host/sdhci-st.c > +++ b/drivers/mmc/host/sdhci-st.c > @@ -434,7 +434,7 @@ static int sdhci_st_probe(struct platform_device *pdev) > return ret; > } > > -static int sdhci_st_remove(struct platform_device *pdev) > +static void sdhci_st_remove(struct platform_device *pdev) > { > struct sdhci_host *host = platform_get_drvdata(pdev); > struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); > @@ -446,8 +446,6 @@ static int sdhci_st_remove(struct platform_device *pdev) > clk_disable_unprepare(pdata->icnclk); > > reset_control_assert(rstc); > - > - return 0; > } > > #ifdef CONFIG_PM_SLEEP > @@ -510,7 +508,7 @@ MODULE_DEVICE_TABLE(of, st_sdhci_match); > > static struct platform_driver sdhci_st_driver = { > .probe = sdhci_st_probe, > - .remove = sdhci_st_remove, > + .remove_new = sdhci_st_remove, > .driver = { > .name = "sdhci-st", > .probe_type = PROBE_PREFER_ASYNCHRONOUS, Reviewed-by: Patrice Chotard Thanks Patrice