ARM Sunxi Platform Development
 help / color / mirror / Atom feed
From: "Jernej Škrabec" <jernej.skrabec@gmail.com>
To: ulf.hansson@linaro.org, wens@csie.org, samuel@sholland.org,
	Xichao Zhao <zhao.xichao@vivo.com>
Cc: linux-mmc@vger.kernel.org, linux-sunxi@lists.linux.dev,
	linux-kernel@vger.kernel.org, Xichao Zhao <zhao.xichao@vivo.com>
Subject: Re: [PATCH] mmc: sunxi: Remove dev_err_probe() if error is -ENOMEM
Date: Mon, 08 Sep 2025 15:50:05 +0200	[thread overview]
Message-ID: <5918619.DvuYhMxLoT@jernej-laptop> (raw)
In-Reply-To: <20250821091721.546580-1-zhao.xichao@vivo.com>

Dne četrtek, 21. avgust 2025 ob 11:17:21 Srednjeevropski poletni čas je Xichao Zhao napisal(a):
> The dev_err_probe() doesn't do anything when error is '-ENOMEM'.
> Therefore, remove the useless call to dev_err_probe(), and just
> return the value instead.

It would be better to print error message rather than dismiss them.

Best regards,
Jernej

> 
> Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
> ---
>  drivers/mmc/host/sunxi-mmc.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c
> index ee4a65b0a22d..8dd1d2409a26 100644
> --- a/drivers/mmc/host/sunxi-mmc.c
> +++ b/drivers/mmc/host/sunxi-mmc.c
> @@ -1371,8 +1371,8 @@ static int sunxi_mmc_probe(struct platform_device *pdev)
>  
>  	mmc = devm_mmc_alloc_host(&pdev->dev, sizeof(*host));
>  	if (!mmc)
> -		return dev_err_probe(&pdev->dev, -ENOMEM,
> -				     "mmc alloc host failed\n");
> +		return -ENOMEM;
> +
>  	platform_set_drvdata(pdev, mmc);
>  
>  	host = mmc_priv(mmc);
> @@ -1387,8 +1387,7 @@ static int sunxi_mmc_probe(struct platform_device *pdev)
>  	host->sg_cpu = dma_alloc_coherent(&pdev->dev, PAGE_SIZE,
>  					  &host->sg_dma, GFP_KERNEL);
>  	if (!host->sg_cpu)
> -		return dev_err_probe(&pdev->dev, -ENOMEM,
> -				     "Failed to allocate DMA descriptor mem\n");
> +		return -ENOMEM;
>  
>  	if (host->cfg->ccu_has_timings_switch) {
>  		/*
> 





      reply	other threads:[~2025-09-08 13:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-21  9:17 [PATCH] mmc: sunxi: Remove dev_err_probe() if error is -ENOMEM Xichao Zhao
2025-09-08 13:50 ` Jernej Škrabec [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=5918619.DvuYhMxLoT@jernej-laptop \
    --to=jernej.skrabec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=samuel@sholland.org \
    --cc=ulf.hansson@linaro.org \
    --cc=wens@csie.org \
    --cc=zhao.xichao@vivo.com \
    /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