mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Takashi Iwai <tiwai@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Baoquan He <hebaoquan@kylinos.cn>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Next Mailing List <linux-next@vger.kernel.org>
Subject: linux-next: manual merge of the sound tree with the mm-nonmm-unstable tree
Date: Tue, 6 Oct 2026 12:38:48 +0200	[thread overview]
Message-ID: <asTPuG6GxkRDR8Tf@sirena.co.uk> (raw)

[-- Attachment #1: Type: text/plain, Size: 4033 bytes --]

Hi all,

Today's linux-next merge of the sound tree got a conflict in:

  sound/mips/snd-n64.c

between commit:

  d9202799374c2 ("ALSA: n64: don't use GFP_DMA when calling dma_alloc_coherent()")

from the mm-nonmm-unstable tree and commits:

  e81f85fd3ca66 ("ALSA: mips: n64: Handle card removal properly")
  2964a4aae2e04 ("ALSA: n64: don't use GFP_DMA when calling dma_alloc_coherent()")

from the sound tree (looks like this is just a race with me fetching the
mm-nonmm-unstable tree and will go away tomorrow).

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

diff --combined sound/mips/snd-n64.c
index e2cf9df15d485,da889570cebcf..0000000000000
--- a/sound/mips/snd-n64.c
+++ b/sound/mips/snd-n64.c
@@@ -273,6 -273,15 +273,15 @@@ static const struct snd_pcm_ops n64audi
  	.close =	n64audio_pcm_close,
  };
  
+ static void n64audio_free(struct snd_card *card)
+ {
+ 	struct n64audio *priv = card->private_data;
+ 
+ 	if (priv->ring_base)
+ 		dma_free_coherent(card->dev, 32 * 1024, priv->ring_base,
+ 				  priv->ring_base_dma);
+ }
+ 
  /*
   * The target device is embedded and RAM-constrained. We save RAM
   * by initializing in __init code that gets dropped late in boot.
@@@ -280,14 -289,14 +289,14 @@@
   */
  static int __init n64audio_probe(struct platform_device *pdev)
  {
- 	struct snd_card *card;
+ 	struct snd_card *card __free(snd_card_free) = NULL;
  	struct snd_pcm *pcm;
  	struct n64audio *priv;
  	int err, irq;
  
- 	err = snd_card_new(&pdev->dev, SNDRV_DEFAULT_IDX1,
- 			   SNDRV_DEFAULT_STR1,
- 			   THIS_MODULE, sizeof(*priv), &card);
+ 	err = snd_devm_card_new(&pdev->dev, SNDRV_DEFAULT_IDX1,
+ 				SNDRV_DEFAULT_STR1,
+ 				THIS_MODULE, sizeof(*priv), &card);
  	if (err < 0)
  		return err;
  
@@@ -296,29 -305,24 +305,24 @@@
  	spin_lock_init(&priv->chan.lock);
  
  	priv->card = card;
+ 	card->private_free = n64audio_free;
  
  	priv->ring_base = dma_alloc_coherent(card->dev, 32 * 1024, &priv->ring_base_dma,
  					     GFP_KERNEL);
- 	if (!priv->ring_base) {
- 		err = -ENOMEM;
- 		goto fail_card;
- 	}
+ 	if (!priv->ring_base)
+ 		return -ENOMEM;
  
  	priv->mi_reg_base = devm_platform_ioremap_resource(pdev, 0);
- 	if (IS_ERR(priv->mi_reg_base)) {
- 		err = PTR_ERR(priv->mi_reg_base);
- 		goto fail_dma_alloc;
- 	}
+ 	if (IS_ERR(priv->mi_reg_base))
+ 		return PTR_ERR(priv->mi_reg_base);
  
  	priv->ai_reg_base = devm_platform_ioremap_resource(pdev, 1);
- 	if (IS_ERR(priv->ai_reg_base)) {
- 		err = PTR_ERR(priv->ai_reg_base);
- 		goto fail_dma_alloc;
- 	}
+ 	if (IS_ERR(priv->ai_reg_base))
+ 		return PTR_ERR(priv->ai_reg_base);
  
  	err = snd_pcm_new(card, "N64 Audio", 0, 1, 0, &pcm);
  	if (err < 0)
- 		goto fail_dma_alloc;
+ 		return err;
  
  	pcm->private_data = priv;
  	strscpy(pcm->name, "N64 Audio");
@@@ -331,28 -335,19 +335,19 @@@
  	strscpy(card->longname, "N64 Audio");
  
  	irq = platform_get_irq(pdev, 0);
- 	if (irq < 0) {
- 		err = -EINVAL;
- 		goto fail_dma_alloc;
- 	}
+ 	if (irq < 0)
+ 		return -EINVAL;
+ 
  	if (devm_request_irq(&pdev->dev, irq, n64audio_isr,
- 				IRQF_SHARED, "N64 Audio", priv)) {
- 		err = -EBUSY;
- 		goto fail_dma_alloc;
- 	}
+ 				IRQF_SHARED, "N64 Audio", priv))
+ 		return -EBUSY;
  
  	err = snd_card_register(card);
  	if (err < 0)
- 		goto fail_dma_alloc;
+ 		return err;
  
+ 	card = NULL; /* probe succeeded, don't release as error */
  	return 0;
- 
- fail_dma_alloc:
- 	dma_free_coherent(card->dev, 32 * 1024, priv->ring_base, priv->ring_base_dma);
- 
- fail_card:
- 	snd_card_free(card);
- 	return err;
  }
  
  static struct platform_driver n64audio_driver = {

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

                 reply	other threads:[~2026-10-06 10:38 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=asTPuG6GxkRDR8Tf@sirena.co.uk \
    --to=broonie@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=hebaoquan@kylinos.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=tiwai@suse.de \
    /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®