Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751927AbYCJHt5 (ORCPT ); Mon, 10 Mar 2008 03:49:57 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751032AbYCJHtt (ORCPT ); Mon, 10 Mar 2008 03:49:49 -0400 Received: from topsns2.toshiba-tops.co.jp ([202.230.225.126]:11578 "EHLO topsns2.toshiba-tops.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750940AbYCJHtt (ORCPT ); Mon, 10 Mar 2008 03:49:49 -0400 Date: Mon, 10 Mar 2008 16:49:46 +0900 (JST) Message-Id: <20080310.164946.76452619.nemoto@toshiba-tops.co.jp> To: linux-kernel@vger.kernel.org Cc: hcegtvedt@atmel.com, hskinnemoen@atmel.com, avictor.za@gmail.com Subject: Re: [PATCH] at73c213: Remove redundant private_free routine From: Atsushi Nemoto In-Reply-To: <20080310.161354.42213512.nemoto@toshiba-tops.co.jp> References: <20080310.161354.42213512.nemoto@toshiba-tops.co.jp> X-Fingerprint: 6ACA 1623 39BD 9A94 9B1A B746 CA77 FE94 2874 D52F X-Pgp-Public-Key: http://wwwkeys.pgp.net/pks/lookup?op=get&search=0x2874D52F X-Mailer: Mew version 5.2 on Emacs 21.4 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2083 Lines: 57 On Mon, 10 Mar 2008 16:13:54 +0900 (JST), Atsushi Nemoto wrote: > 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. ... > - 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; Sorry, the patch was wrong. The private_data field should still be initialized. Revised. ------------------------------------------------------ Subject: [PATCH] at73c213: Remove redundant private_free routine From: Atsushi Nemoto 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 --- diff --git a/sound/spi/at73c213.c b/sound/spi/at73c213.c index 89d6e9c..bf3ea43 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; @@ -334,7 +325,6 @@ static int __devinit snd_at73c213_pcm_new(struct snd_at73c213 *chip, int device) 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; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/