Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
To: Lauri Kasanen <cand@gmx.com>
Cc: linux-mips@vger.kernel.org, Takashi Iwai <tiwai@suse.de>, perex@perex.cz
Subject: Re: [PATCH 5/6 v6] sound: Add n64 driver
Date: Thu, 14 Jan 2021 17:17:59 +0100	[thread overview]
Message-ID: <20210114161759.GA14146@alpha.franken.de> (raw)
In-Reply-To: <20210113171322.77105fa8f92826e6b716631a@gmx.com>

On Wed, Jan 13, 2021 at 05:13:22PM +0200, Lauri Kasanen wrote:
> +
> +	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +	len = res->end - res->start + 1;
> +	priv->mi_reg_base = ioremap(res->start, len);

now with resources in place, you can use devm_platform_ioremap_resource,
which will make handling error cases simpler.

> +	if (!priv->mi_reg_base) {
> +		err = -EINVAL;
> +		goto fail_dma_alloc;
> +	}
> +
> +	res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> +	len = res->end - res->start + 1;
> +	priv->ai_reg_base = ioremap(res->start, len);
> +	if (!priv->ai_reg_base) {
> +		err = -EINVAL;
> +		goto fail_mi_ioremap;
> +	}
> +
> +	err = snd_pcm_new(card, "N64 Audio", 0, 1, 0, &pcm);
> +	if (err < 0)
> +		goto fail_ioremaps;
> +
> +	pcm->private_data = priv;
> +	strcpy(pcm->name, "N64 Audio");
> +
> +	snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &n64audio_pcm_ops);
> +	snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_VMALLOC, card->dev, 0, 0);
> +
> +	strcpy(card->driver, "N64 Audio");
> +	strcpy(card->shortname, "N64 Audio");
> +	strcpy(card->longname, "N64 Audio");
> +
> +	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
> +	if (request_irq(res->start, n64audio_isr,

and here you can use devm_request_irq .

> +				IRQF_SHARED, "N64 Audio", priv)) {

is it really shared ? Looking at n64/init.c there is no other device
using this interrupt.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

  parent reply	other threads:[~2021-01-14 16:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-13 15:13 [PATCH 5/6 v6] sound: Add n64 driver Lauri Kasanen
2021-01-14 12:00 ` Takashi Iwai
2021-01-14 16:17 ` Thomas Bogendoerfer [this message]
2021-01-14 16:28   ` Lauri Kasanen

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=20210114161759.GA14146@alpha.franken.de \
    --to=tsbogend@alpha.franken.de \
    --cc=cand@gmx.com \
    --cc=linux-mips@vger.kernel.org \
    --cc=perex@perex.cz \
    --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