Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp688673rwb; Wed, 26 Jul 2023 00:48:52 -0700 (PDT) X-Google-Smtp-Source: APBJJlHjrrQ9Rzs1VEjoYVnEaV6c7CsB6RvkTOF8fY+qRIQmw8k4r1tR7IdLvSdrGJ8gmGp6EP5w X-Received: by 2002:a05:6358:4415:b0:125:a552:4389 with SMTP id z21-20020a056358441500b00125a5524389mr1138292rwc.22.1690357731862; Wed, 26 Jul 2023 00:48:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690357731; cv=none; d=google.com; s=arc-20160816; b=gWeAWSQ7Ni/umo41jd4Ek6MRUlyRWEMV5D1OHf5fJfmlrQmv1X5QIQmAnt1/PyL6be 6EZD1mnkOoOS6hlTF0RgLDvX3oGSDsQxh8O032pYLaPJAOa8RFTrZJhYKkd8AYbDRJLn mDX21RtfysKpgoREGdVAeejaFRsS8xjALDWur1+9i6ZMvgRKcVrEE1xfslQaz8TEVBBw NRD/echeHvBl5Qjhf5LB3qG4Bw4YxLGjcjYugmVCHOJPFjTHGWS82O9mzXGH+zCmF3Nl F0IC6cG1sc03ovQXjApKHFPBzurMNrsIrIG+rYrR9TFzz1rlRV1vAaDHxjjcpd3xx55j Fbsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=9Uyh8RuGhoJCZDVqpXKQjt1Q+j8tHN8qlwqNp3f7aAw=; fh=gOPV4XNt7J9vCV58HyinijazM05cML3maWekUFJGiPw=; b=YELvi6ahljTZDpYBcDbEVulr0s+j/Qq1NQRgXvUlIvuhUHhn+buzcqqZin5jGOXS8e 5hKWKHJR2Ku0liDCa2yIn80fcjYgaPKhfELauPKXwgrz9lqxn4zLsGFHUR5arEHuHJkR jlpFoRpMnZtfs3A+rFeItlWdNU8yfDj+Gspt/NOFCUxu6xz6F4TfZgZbFewdSgFjgxQJ wGOFnVt6KB7KaTMcMs4qJMVaw3K0GQLcR0XtQSgWi4O9pM4ArVDXS6SJqTVROH0qifPO QAm+XkMSdKIfgSgOqAO7hmeI1wrAtvSGHxB7Z+vJ+SZb99C12VHYqmyOr9XxeGSjiYCy zkdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=iIuJ29lL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k13-20020a63d84d000000b0055badc4d26csi12262709pgj.662.2023.07.26.00.48.39; Wed, 26 Jul 2023 00:48:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=iIuJ29lL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230262AbjGZGzh (ORCPT + 99 others); Wed, 26 Jul 2023 02:55:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231351AbjGZGzW (ORCPT ); Wed, 26 Jul 2023 02:55:22 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6B27273E; Tue, 25 Jul 2023 23:55:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690354506; x=1721890506; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=NGfMfU7QX/FvMvczs5lY6l7TlgmEQkvKreP+H495+9Q=; b=iIuJ29lLWTpBiC5chOdvRx90yMyRa/9zbR/fkHvLVTRxSTQ99b8QwV+4 wBdYuXIvPXL84jOHs0OWXx1T3KVKCwDVhCVR4YjECcgi8Vtw2lPud4lWR LtSBRcPmYKacnmoiDvc6RAoNv5b7CrvDdMR+/kR7VAvtVAE7g69cMxwbp A2vcUSGAB5zd/pT+xro99Fc/cTfh4hx0tfxheqr8GuMjzB3sAd0xTgDc/ kHy7o0IV0/Bg3OGeIUSEA8fLX/X7dZ1z3Ea9DvK2RZOgPG9jcCU/jBX3S Knz51onA1gB0M4Qd10R6cl1Q5VWtA1vSLj/26s/XzQQZPJdpDck3t1jpw A==; X-IronPort-AV: E=McAfee;i="6600,9927,10782"; a="357936992" X-IronPort-AV: E=Sophos;i="6.01,231,1684825200"; d="scan'208";a="357936992" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jul 2023 23:55:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10782"; a="676547119" X-IronPort-AV: E=Sophos;i="6.01,231,1684825200"; d="scan'208";a="676547119" Received: from igosu-mobl1.ger.corp.intel.com (HELO [10.0.2.15]) ([10.252.35.75]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jul 2023 23:55:03 -0700 Message-ID: <6cd56798-dbdf-35d8-a381-a569cbbe00ee@intel.com> Date: Wed, 26 Jul 2023 09:54:59 +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.0 Subject: Re: [PATCH v2 34/61] mmc: sdhci-of-aspeed: Convert to platform remove Content-Language: en-US To: Yangtao Li , Andrew Jeffery , Ulf Hansson , Joel Stanley Cc: =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= , linux-mmc@vger.kernel.org, linux-aspeed@lists.ozlabs.org, openbmc@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20230726040041.26267-1-frank.li@vivo.com> <20230726040041.26267-34-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: <20230726040041.26267-34-frank.li@vivo.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 26/07/23 07: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-of-aspeed.c | 12 ++++-------- > 1 file changed, 4 insertions(+), 8 deletions(-) > > diff --git a/drivers/mmc/host/sdhci-of-aspeed.c b/drivers/mmc/host/sdhci-of-aspeed.c > index b4867bb4a564..42d54532cabe 100644 > --- a/drivers/mmc/host/sdhci-of-aspeed.c > +++ b/drivers/mmc/host/sdhci-of-aspeed.c > @@ -450,7 +450,7 @@ static int aspeed_sdhci_probe(struct platform_device *pdev) > return ret; > } > > -static int aspeed_sdhci_remove(struct platform_device *pdev) > +static void aspeed_sdhci_remove(struct platform_device *pdev) > { > struct sdhci_pltfm_host *pltfm_host; > struct sdhci_host *host; > @@ -463,8 +463,6 @@ static int aspeed_sdhci_remove(struct platform_device *pdev) > clk_disable_unprepare(pltfm_host->clk); > > sdhci_pltfm_free(pdev); > - > - return 0; > } > > static const struct aspeed_sdhci_pdata ast2400_sdhci_pdata = { > @@ -520,7 +518,7 @@ static struct platform_driver aspeed_sdhci_driver = { > .of_match_table = aspeed_sdhci_of_match, > }, > .probe = aspeed_sdhci_probe, > - .remove = aspeed_sdhci_remove, > + .remove_new = aspeed_sdhci_remove, > }; > > static int aspeed_sdc_probe(struct platform_device *pdev) > @@ -573,13 +571,11 @@ static int aspeed_sdc_probe(struct platform_device *pdev) > return ret; > } > > -static int aspeed_sdc_remove(struct platform_device *pdev) > +static void aspeed_sdc_remove(struct platform_device *pdev) > { > struct aspeed_sdc *sdc = dev_get_drvdata(&pdev->dev); > > clk_disable_unprepare(sdc->clk); > - > - return 0; > } > > static const struct of_device_id aspeed_sdc_of_match[] = { > @@ -599,7 +595,7 @@ static struct platform_driver aspeed_sdc_driver = { > .of_match_table = aspeed_sdc_of_match, > }, > .probe = aspeed_sdc_probe, > - .remove = aspeed_sdc_remove, > + .remove_new = aspeed_sdc_remove, > }; > > #if defined(CONFIG_MMC_SDHCI_OF_ASPEED_TEST)