From patchwork Mon Nov 3 10:34:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 5215771 X-Patchwork-Delegate: tiwai@suse.de Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id F13259F295 for ; Mon, 3 Nov 2014 10:34:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 16D60200E5 for ; Mon, 3 Nov 2014 10:34:50 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 678E420142 for ; Mon, 3 Nov 2014 10:34:48 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 8580526049F; Mon, 3 Nov 2014 11:34:47 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 04717260455; Mon, 3 Nov 2014 11:34:37 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id F2C6C26047A; Mon, 3 Nov 2014 11:34:35 +0100 (CET) Received: from mail-pd0-f182.google.com (mail-pd0-f182.google.com [209.85.192.182]) by alsa0.perex.cz (Postfix) with ESMTP id AE356260434 for ; Mon, 3 Nov 2014 11:34:27 +0100 (CET) Received: by mail-pd0-f182.google.com with SMTP id fp1so11337923pdb.27 for ; Mon, 03 Nov 2014 02:34:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=v0Wp2jIvFfia7D2wkE7BzzutVAwNlV+PrnqnfzHIwEc=; b=gT/EPintM6x9l3iXRVydLbCorAodhxB4yTO6OmpdtPI9xaOnij4FrdKjJrBmmxTZ1D 1t/piOkH1J8R7ECGSfhDzuOcoMp9u5m0dA+4aB/mLWHtEjkmJe2ZG0srr407cKBBVaia i+31uB+oxaxGDYeDBY/8MlBwdc8CxKKaLiLNxyDqvgY4hxCn7YVhR+oii/flwuMyJgEd 5TiGnylsiReYlO5U6pvJNfZcsUBGxP+VhU5xvXN1NshuqunlXfK7/IUq3KhV5u1q/EOY XFGKzLCmqWSL2UaUXVkpGWYx3X0b8aX+uHATRrZHhhMw7nO1SKI7/2ZRLKTk4s+YOpKy SIdw== X-Received: by 10.66.194.102 with SMTP id hv6mr2601318pac.109.1415010866389; Mon, 03 Nov 2014 02:34:26 -0800 (PST) Received: from localhost.localdomain ([122.169.160.196]) by mx.google.com with ESMTPSA id c1sm16784511pbu.23.2014.11.03.02.34.23 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 03 Nov 2014 02:34:25 -0800 (PST) From: Sudip Mukherjee To: Jaroslav Kysela , Takashi Iwai Date: Mon, 3 Nov 2014 16:04:12 +0530 Message-Id: <1415010853-4334-1-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.8.1.2 Cc: alsa-devel@alsa-project.org, Sudip Mukherjee , linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH v2 1/2] ALSA: echoaudio: add reference of struct echoaudio X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP added reference of struct echoaudio to free_firmware function. this structure will be later used to get a reference of the card when converting snd_printk to dev_* in the next patch of the series. Signed-off-by: Sudip Mukherjee --- same as v1. sound/pci/echoaudio/echoaudio.c | 3 ++- sound/pci/echoaudio/echoaudio.h | 3 ++- sound/pci/echoaudio/echoaudio_dsp.c | 10 +++++----- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/sound/pci/echoaudio/echoaudio.c b/sound/pci/echoaudio/echoaudio.c index d82321f..db1b247 100644 --- a/sound/pci/echoaudio/echoaudio.c +++ b/sound/pci/echoaudio/echoaudio.c @@ -69,7 +69,8 @@ static int get_firmware(const struct firmware **fw_entry, -static void free_firmware(const struct firmware *fw_entry) +static void free_firmware(const struct firmware *fw_entry, + struct echoaudio *chip) { #ifdef CONFIG_PM_SLEEP DE_ACT(("firmware not released (kept in cache)\n")); diff --git a/sound/pci/echoaudio/echoaudio.h b/sound/pci/echoaudio/echoaudio.h index b86b88d..a4f112a 100644 --- a/sound/pci/echoaudio/echoaudio.h +++ b/sound/pci/echoaudio/echoaudio.h @@ -468,7 +468,8 @@ static int wait_handshake(struct echoaudio *chip); static int send_vector(struct echoaudio *chip, u32 command); static int get_firmware(const struct firmware **fw_entry, struct echoaudio *chip, const short fw_index); -static void free_firmware(const struct firmware *fw_entry); +static void free_firmware(const struct firmware *fw_entry, + struct echoaudio *chip); #ifdef ECHOCARD_HAS_MIDI static int enable_midi_input(struct echoaudio *chip, char enable); diff --git a/sound/pci/echoaudio/echoaudio_dsp.c b/sound/pci/echoaudio/echoaudio_dsp.c index 5a6a217..977b2bd 100644 --- a/sound/pci/echoaudio/echoaudio_dsp.c +++ b/sound/pci/echoaudio/echoaudio_dsp.c @@ -206,12 +206,12 @@ static int load_asic_generic(struct echoaudio *chip, u32 cmd, short asic) } DE_INIT(("ASIC loaded\n")); - free_firmware(fw); + free_firmware(fw, chip); return 0; la_error: DE_INIT(("failed on write_dsp\n")); - free_firmware(fw); + free_firmware(fw, chip); return -EIO; } @@ -317,11 +317,11 @@ static int install_resident_loader(struct echoaudio *chip) } DE_INIT(("Resident loader successfully installed\n")); - free_firmware(fw); + free_firmware(fw, chip); return 0; irl_error: - free_firmware(fw); + free_firmware(fw, chip); return -EIO; } @@ -491,7 +491,7 @@ static int load_firmware(struct echoaudio *chip) if (err < 0) return err; err = load_dsp(chip, (u16 *)fw->data); - free_firmware(fw); + free_firmware(fw, chip); if (err < 0) return err;