From patchwork Thu Aug 15 19:46:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 11096445 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 49FFA13A0 for ; Thu, 15 Aug 2019 20:13:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3A0582898C for ; Thu, 15 Aug 2019 20:13:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2E1002899C; Thu, 15 Aug 2019 20:13:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 544CA2898C for ; Thu, 15 Aug 2019 20:13:05 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 018A5852; Thu, 15 Aug 2019 21:46:46 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 018A5852 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1565898457; bh=95BlIaaEFoQBbxMC7zysX1rxapppqlU2vYh2TKXKFpk=; h=From:To:Date:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=aZMutOi9taS1ntVZuXBmDoMEnApHQiz3Y9GVYuqWKbBUGEDbQdQ3b/Ox6G4cFEv9l RUqcp3uj6m7nktfg9vjA7MzWUo7js0bJ9OOjWwM/9l9dQaNqnlfBuZRFvwSD7P8cp3 zmSdPXn5IA2P9GCthugu8pERWrhJDTPnyb3i5gUw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 68214F80273; Thu, 15 Aug 2019 21:46:46 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 84B77F80274; Thu, 15 Aug 2019 21:46:44 +0200 (CEST) Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 7385CF8011F for ; Thu, 15 Aug 2019 21:46:41 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 7385CF8011F X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 5F514AD44; Thu, 15 Aug 2019 19:46:40 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Thu, 15 Aug 2019 21:46:34 +0200 Message-Id: <20190815194634.12281-1-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 Cc: intel-gfx@lists.freedesktop.org, Chris Wilson Subject: [alsa-devel] [PATCH] Revert "ALSA: hda: Add codec on bus address table lately" X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP This reverts commit ee5f85d9290f ("ALSA: hda: Add codec on bus address table lately"). The commit caused several regression since I've overlooked that the function doesn't manage only the caddr_tbl but also the codec linked list that is referred indirectly in the other drivers. Revert for now to make everything back to work. Fixes: ee5f85d9290f ("ALSA: hda: Add codec on bus address table lately") Reported-by: Chris Wilson Signed-off-by: Takashi Iwai --- sound/hda/hdac_device.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/sound/hda/hdac_device.c b/sound/hda/hdac_device.c index bf83d7062ef6..9f3e37511408 100644 --- a/sound/hda/hdac_device.c +++ b/sound/hda/hdac_device.c @@ -61,6 +61,10 @@ int snd_hdac_device_init(struct hdac_device *codec, struct hdac_bus *bus, pm_runtime_get_noresume(&codec->dev); atomic_set(&codec->in_pm, 0); + err = snd_hdac_bus_add_device(bus, codec); + if (err < 0) + goto error; + /* fill parameters */ codec->vendor_id = snd_hdac_read_parm(codec, AC_NODE_ROOT, AC_PAR_VENDOR_ID); @@ -139,22 +143,15 @@ int snd_hdac_device_register(struct hdac_device *codec) err = device_add(&codec->dev); if (err < 0) return err; - err = snd_hdac_bus_add_device(codec->bus, codec); - if (err < 0) - goto error; mutex_lock(&codec->widget_lock); err = hda_widget_sysfs_init(codec); mutex_unlock(&codec->widget_lock); - if (err < 0) - goto error_remove; + if (err < 0) { + device_del(&codec->dev); + return err; + } return 0; - - error_remove: - snd_hdac_bus_remove_device(codec->bus, codec); - error: - device_del(&codec->dev); - return err; } EXPORT_SYMBOL_GPL(snd_hdac_device_register); @@ -168,8 +165,8 @@ void snd_hdac_device_unregister(struct hdac_device *codec) mutex_lock(&codec->widget_lock); hda_widget_sysfs_exit(codec); mutex_unlock(&codec->widget_lock); - snd_hdac_bus_remove_device(codec->bus, codec); device_del(&codec->dev); + snd_hdac_bus_remove_device(codec->bus, codec); } } EXPORT_SYMBOL_GPL(snd_hdac_device_unregister);