LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
To: linux-kernel@vger.kernel.org
Cc: Hans-Christian Egtvedt <hcegtvedt@atmel.com>,
	Haavard Skinnemoen <hskinnemoen@atmel.com>,
	Andrew Victor <avictor.za@gmail.com>
Subject: [PATCH] at73c213: Remove redundant private_free routine
Date: Mon, 10 Mar 2008 16:13:54 +0900 (JST)	[thread overview]
Message-ID: <20080310.161354.42213512.nemoto@toshiba-tops.co.jp> (raw)

snd_pcm_lib_preallocate_free_for_all() is called from snd_pcm_free()
just after calling the private_free routine.  So there should be no
need to call it in driver's private_free routine.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
---
diff --git a/sound/spi/at73c213.c b/sound/spi/at73c213.c
index 89d6e9c..024db14 100644
--- a/sound/spi/at73c213.c
+++ b/sound/spi/at73c213.c
@@ -314,15 +314,6 @@ static struct snd_pcm_ops at73c213_playback_ops = {
 	.pointer	= snd_at73c213_pcm_pointer,
 };
 
-static void snd_at73c213_pcm_free(struct snd_pcm *pcm)
-{
-	struct snd_at73c213 *chip = snd_pcm_chip(pcm);
-	if (chip->pcm) {
-		snd_pcm_lib_preallocate_free_for_all(chip->pcm);
-		chip->pcm = NULL;
-	}
-}
-
 static int __devinit snd_at73c213_pcm_new(struct snd_at73c213 *chip, int device)
 {
 	struct snd_pcm *pcm;
@@ -333,8 +324,6 @@ static int __devinit snd_at73c213_pcm_new(struct snd_at73c213 *chip, int device)
 	if (retval < 0)
 		goto out;
 
-	pcm->private_data = chip;
-	pcm->private_free = snd_at73c213_pcm_free;
 	pcm->info_flags = SNDRV_PCM_INFO_BLOCK_TRANSFER;
 	strcpy(pcm->name, "at73c213");
 	chip->pcm = pcm;

             reply	other threads:[~2008-03-10  7:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-10  7:13 Atsushi Nemoto [this message]
2008-03-10  7:49 ` Atsushi Nemoto
2008-03-10  9:43   ` Hans-Christian Egtvedt

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=20080310.161354.42213512.nemoto@toshiba-tops.co.jp \
    --to=anemo@mba.ocn.ne.jp \
    --cc=avictor.za@gmail.com \
    --cc=hcegtvedt@atmel.com \
    --cc=hskinnemoen@atmel.com \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [PATCH] at73c213: Remove redundant private_free routine' \
    /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

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).