linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chen Ni <nichen@iscas.ac.cn>
To: cezary.rojewski@intel.com, pierre-louis.bossart@linux.intel.com,
	liam.r.girdwood@linux.intel.com, peter.ujfalusi@linux.intel.com,
	yung-chuan.liao@linux.intel.com,
	ranjani.sridharan@linux.intel.com, kai.vehmanen@linux.intel.com,
	broonie@kernel.org, perex@perex.cz, tiwai@suse.com,
	maarten.lankhorst@linux.intel.com,
	amadeuszx.slawinski@linux.intel.com
Cc: alsa-devel@alsa-project.org, linux-sound@vger.kernel.org,
	linux-kernel@vger.kernel.org, Chen Ni <nichen@iscas.ac.cn>
Subject: [PATCH] ASoC: intel: skylake: Add check for dma_set_max_seg_size
Date: Mon, 29 Apr 2024 12:23:20 +0800	[thread overview]
Message-ID: <20240429042320.2150567-1-nichen@iscas.ac.cn> (raw)

Add check for the return value of dma_set_max_seg_size() and return
the error if it fails in order to catch the error.

Fixes: c22a8086b384 ("ASoC: intel: skylake: Set max DMA segment size")
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
---
 sound/soc/intel/skylake/skl.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c
index 117125187793..8edc13795462 100644
--- a/sound/soc/intel/skylake/skl.c
+++ b/sound/soc/intel/skylake/skl.c
@@ -943,7 +943,9 @@ static int skl_first_init(struct hdac_bus *bus)
 	/* allow 64bit DMA address if supported by H/W */
 	if (dma_set_mask_and_coherent(bus->dev, DMA_BIT_MASK(64)))
 		dma_set_mask_and_coherent(bus->dev, DMA_BIT_MASK(32));
-	dma_set_max_seg_size(bus->dev, UINT_MAX);
+	err = dma_set_max_seg_size(bus->dev, UINT_MAX);
+	if (err)
+		return err;
 
 	/* initialize streams */
 	snd_hdac_ext_stream_init_all
-- 
2.25.1


                 reply	other threads:[~2024-04-29  4:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20240429042320.2150567-1-nichen@iscas.ac.cn \
    --to=nichen@iscas.ac.cn \
    --cc=alsa-devel@alsa-project.org \
    --cc=amadeuszx.slawinski@linux.intel.com \
    --cc=broonie@kernel.org \
    --cc=cezary.rojewski@intel.com \
    --cc=kai.vehmanen@linux.intel.com \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=perex@perex.cz \
    --cc=peter.ujfalusi@linux.intel.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=ranjani.sridharan@linux.intel.com \
    --cc=tiwai@suse.com \
    --cc=yung-chuan.liao@linux.intel.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;
as well as URLs for NNTP newsgroup(s).