Linux-RISC-V Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yixun Lan <dlan@gentoo.org>
To: Binbin Zhou <zhoubinbin@loongson.cn>
Cc: Binbin Zhou <zhoubb.aaron@gmail.com>,
	Huacai Chen <chenhuacai@loongson.cn>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Huacai Chen <chenhuacai@kernel.org>,
	linux-mmc@vger.kernel.org, linux-riscv@lists.infradead.org,
	spacemit@lists.linux.dev
Subject: Re: [PATCH 22/34] mmc: sdhci-of-k1: Drop the use of sdhci_pltfm_free()
Date: Mon, 26 May 2025 10:04:33 +0000	[thread overview]
Message-ID: <20250526100433-GYA52596@gentoo> (raw)
In-Reply-To: <a0906b1172c9452f700d97ff72484fda3023fbae.1747792905.git.zhoubinbin@loongson.cn>

hi Binbin,

On 14:06 Mon 26 May     , Binbin Zhou wrote:
> Since the devm_mmc_alloc_host() helper is already in
> use, sdhci_pltfm_free() is no longer needed.
> 
> Cc: Yixun Lan <dlan@gentoo.org>
> Cc: linux-riscv@lists.infradead.org
> Cc: spacemit@lists.linux.dev
> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
> ---
>  drivers/mmc/host/sdhci-of-k1.c | 15 ++++-----------
>  1 file changed, 4 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-of-k1.c b/drivers/mmc/host/sdhci-of-k1.c
> index 6880d3e9ab62..40c1929f2de2 100644
> --- a/drivers/mmc/host/sdhci-of-k1.c
> +++ b/drivers/mmc/host/sdhci-of-k1.c
> @@ -262,7 +262,7 @@ static int spacemit_sdhci_probe(struct platform_device *pdev)
>  
>  	ret = mmc_of_parse(host->mmc);
>  	if (ret)
> -		goto err_pltfm;
> +		return ret;
>  
>  	sdhci_get_of_property(pdev);
>  
> @@ -276,18 +276,11 @@ static int spacemit_sdhci_probe(struct platform_device *pdev)
>  
>  	host->mmc->caps |= MMC_CAP_NEED_RSP_BUSY;
>  
> -	if (spacemit_sdhci_get_clocks(dev, pltfm_host))
> -		goto err_pltfm;
> -
> -	ret = sdhci_add_host(host);
> +	ret = spacemit_sdhci_get_clocks(dev, pltfm_host);
>  	if (ret)
> -		goto err_pltfm;
> -
> -	return 0;
> +		return ret;
>  
> -err_pltfm:
> -	sdhci_pltfm_free(pdev);
> -	return ret;
> +	return sdhci_add_host(host);
>  }
>  

although this patch looks good, but can you preserve the goto scheme?
we might add other error handlings as implement SD/SDIO in the future
(it also keeps the change minimal and easy to review)
 
-- 
Yixun Lan (dlan)

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

      reply	other threads:[~2025-05-26 10:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1747792905.git.zhoubinbin@loongson.cn>
2025-05-26  6:06 ` [PATCH 22/34] mmc: sdhci-of-k1: Drop the use of sdhci_pltfm_free() Binbin Zhou
2025-05-26 10:04   ` Yixun Lan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250526100433-GYA52596@gentoo \
    --to=dlan@gentoo.org \
    --cc=adrian.hunter@intel.com \
    --cc=chenhuacai@kernel.org \
    --cc=chenhuacai@loongson.cn \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=spacemit@lists.linux.dev \
    --cc=ulf.hansson@linaro.org \
    --cc=zhoubb.aaron@gmail.com \
    --cc=zhoubinbin@loongson.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox