mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Laurentiu Mihalcea <laurentiumihalcea111@gmail.com>
To: Xichao Zhao <zhao.xichao@vivo.com>,
	lgirdwood@gmail.com, peter.ujfalusi@linux.intel.com,
	yung-chuan.liao@linux.intel.com,
	ranjani.sridharan@linux.intel.com, daniel.baluta@nxp.com,
	broonie@kernel.org, perex@perex.cz, tiwai@suse.com,
	shawnguo@kernel.org, s.hauer@pengutronix.de
Cc: kai.vehmanen@linux.intel.com, pierre-louis.bossart@linux.dev,
	kernel@pengutronix.de, festevam@gmail.com,
	linux-sound@vger.kernel.org, imx@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ASoC: SOF: imx: Remove the use of dev_err_probe()
Date: Wed, 20 Aug 2025 12:29:57 +0300	[thread overview]
Message-ID: <7e75ed1c-a519-448a-ba79-5be80553a81d@gmail.com> (raw)
In-Reply-To: <20250819112654.588527-1-zhao.xichao@vivo.com>


On 8/19/2025 2:26 PM, Xichao Zhao wrote:
> 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.
>
> Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
> ---
>  sound/soc/sof/imx/imx-common.c | 4 ++--
>  sound/soc/sof/imx/imx8.c       | 3 +--
>  2 files changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/sound/soc/sof/imx/imx-common.c b/sound/soc/sof/imx/imx-common.c
> index f00b381cec3b..4523621cda10 100644
> --- a/sound/soc/sof/imx/imx-common.c
> +++ b/sound/soc/sof/imx/imx-common.c
> @@ -354,8 +354,8 @@ static int imx_probe(struct snd_sof_dev *sdev)
>  
>  	common = devm_kzalloc(sdev->dev, sizeof(*common), GFP_KERNEL);
>  	if (!common)
> -		return dev_err_probe(sdev->dev, -ENOMEM,
> -				     "failed to allocate common data\n");
> +		return -ENOMEM;
> +
>  	sdev->pdata->hw_pdata = common;
>  
>  	common->ipc_dev = platform_device_register_data(sdev->dev, "imx-dsp",
> diff --git a/sound/soc/sof/imx/imx8.c b/sound/soc/sof/imx/imx8.c
> index b73dd91bd529..7e9eab2e3034 100644
> --- a/sound/soc/sof/imx/imx8.c
> +++ b/sound/soc/sof/imx/imx8.c
> @@ -171,8 +171,7 @@ static int imx8m_probe(struct snd_sof_dev *sdev)
>  
>  	chip = devm_kzalloc(sdev->dev, sizeof(*chip), GFP_KERNEL);
>  	if (!chip)
> -		return dev_err_probe(sdev->dev, -ENOMEM,
> -				     "failed to allocate chip data\n");
> +		return -ENOMEM;
>  
>  	chip->dap = devm_ioremap(sdev->dev, IMX8M_DAP_DEBUG, IMX8M_DAP_DEBUG_SIZE);
>  	if (!chip->dap)


Good stuff, thanks! Maybe it would be worth mentioning in the commit

message that generic messages on OOM errors such as these ones are unneeded

since the kernel is already verbose enough? This seems to be the reason why

dev_err_probe() doesn't do anything on -ENOMEM anyways.


Either way:

Reviewed-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>


  parent reply	other threads:[~2025-08-20  9:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-19 11:26 Xichao Zhao
2025-08-20  7:04 ` Daniel Baluta
2025-08-20  9:24   ` Laurentiu Mihalcea
2025-08-20 17:26     ` Mark Brown
2025-08-20  9:29 ` Laurentiu Mihalcea [this message]
2025-08-25 20:04 ` Mark Brown

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=7e75ed1c-a519-448a-ba79-5be80553a81d@gmail.com \
    --to=laurentiumihalcea111@gmail.com \
    --cc=broonie@kernel.org \
    --cc=daniel.baluta@nxp.com \
    --cc=festevam@gmail.com \
    --cc=imx@lists.linux.dev \
    --cc=kai.vehmanen@linux.intel.com \
    --cc=kernel@pengutronix.de \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=peter.ujfalusi@linux.intel.com \
    --cc=pierre-louis.bossart@linux.dev \
    --cc=ranjani.sridharan@linux.intel.com \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=tiwai@suse.com \
    --cc=yung-chuan.liao@linux.intel.com \
    --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

all inboxes | Powered by JetHome®