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 BF50AC001E0 for ; Thu, 27 Jul 2023 13:57:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233100AbjG0N5G (ORCPT ); Thu, 27 Jul 2023 09:57:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232375AbjG0N5F (ORCPT ); Thu, 27 Jul 2023 09:57:05 -0400 Received: from mgamail.intel.com (unknown [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E53A2D7E; Thu, 27 Jul 2023 06:57:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690466225; x=1722002225; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=xDBxuEmT97jGkXDFT4P+QdcK82UIjAQxMene2QdjLwU=; b=bFEg5UmwRA7w/aDMJjfYFQ3XyImZwXiUDfEny4TQP+ObXH7PS6ORLmnT I1qeZl6CHygHaSaVoLeZk1GW8Nx8NW2gaKhpm19hZXm8VdXuwoz0yYUyZ dzVKec/xz5v4yU8MyCuXrH06um8DFlU35bfMccC1aXXjCIDU8DjnosCEg oPr1X8KaiwuQZj+KvY8YbGU0panTIVbbkKeG8+TG3TJ5Dzr9c1wka9W4r +kISP33XYfMkqWbYsUlgKoPcWTxIFs7hjXU9yqcDn2JoSb7gErTR8GOpD f+RiaPvPciJEY8czzyAc1XuRvSbhPNUnGfGKaCeRGW2PPIUMK5H9sMyHL w==; X-IronPort-AV: E=McAfee;i="6600,9927,10784"; a="347929263" X-IronPort-AV: E=Sophos;i="6.01,235,1684825200"; d="scan'208";a="347929263" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jul 2023 06:57:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10784"; a="850835262" X-IronPort-AV: E=Sophos;i="6.01,235,1684825200"; d="scan'208";a="850835262" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO [10.0.2.15]) ([10.249.37.252]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jul 2023 06:57:01 -0700 Message-ID: Date: Thu, 27 Jul 2023 16:56:57 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.13.1 Subject: Re: [PATCH v3 60/62] mmc: sdhci_am654: Convert to platform remove callback returning void Content-Language: en-US To: Yangtao Li , Ulf Hansson Cc: =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230727070051.17778-1-frank.li@vivo.com> <20230727070051.17778-60-frank.li@vivo.com> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki In-Reply-To: <20230727070051.17778-60-frank.li@vivo.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org On 27/07/23 10: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_am654.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/mmc/host/sdhci_am654.c b/drivers/mmc/host/sdhci_am654.c > index 1cc84739ef2f..c125485ba80e 100644 > --- a/drivers/mmc/host/sdhci_am654.c > +++ b/drivers/mmc/host/sdhci_am654.c > @@ -866,7 +866,7 @@ static int sdhci_am654_probe(struct platform_device *pdev) > return ret; > } > > -static int sdhci_am654_remove(struct platform_device *pdev) > +static void sdhci_am654_remove(struct platform_device *pdev) > { > struct sdhci_host *host = platform_get_drvdata(pdev); > struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); > @@ -882,7 +882,6 @@ static int sdhci_am654_remove(struct platform_device *pdev) > pm_runtime_disable(dev); > pm_runtime_put_noidle(dev); > sdhci_pltfm_free(pdev); > - return 0; > } > > #ifdef CONFIG_PM > @@ -994,7 +993,7 @@ static struct platform_driver sdhci_am654_driver = { > .of_match_table = sdhci_am654_of_match, > }, > .probe = sdhci_am654_probe, > - .remove = sdhci_am654_remove, > + .remove_new = sdhci_am654_remove, > }; > > module_platform_driver(sdhci_am654_driver);