From patchwork Thu Nov 1 02:36:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keyon Jie X-Patchwork-Id: 10663469 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 9508C13B5 for ; Thu, 1 Nov 2018 02:36:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 89C3F2BC19 for ; Thu, 1 Nov 2018 02:36:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7C9C82BD0A; Thu, 1 Nov 2018 02:36:47 +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,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]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 04F522BC19 for ; Thu, 1 Nov 2018 02:36:47 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id CDB7026787B; Thu, 1 Nov 2018 03:36:45 +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 5FF292678A5; Thu, 1 Nov 2018 03:36:43 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by alsa0.perex.cz (Postfix) with ESMTP id 26C562677E8 for ; Thu, 1 Nov 2018 03:36:40 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Oct 2018 19:36:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,450,1534834800"; d="scan'208";a="88575137" Received: from keyon-x299.sh.intel.com ([10.239.159.75]) by orsmga008.jf.intel.com with ESMTP; 31 Oct 2018 19:36:38 -0700 From: Keyon Jie To: alsa-devel@alsa-project.org Date: Thu, 1 Nov 2018 10:36:41 +0800 Message-Id: <20181101023641.31435-1-yang.jie@linux.intel.com> X-Mailer: git-send-email 2.17.1 Cc: Keyon Jie , pierre-louis.bossart@linux.intel.com Subject: [alsa-devel] [PATCH] ASoC: acpi: fix: continue searching when machine is ignored 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 The machine_quirk may return NULL which means the acpi entries should be skipped and search for next matched entry is needed, here add return check here and continue for NULL case. Signed-off-by: Keyon Jie Acked-by: Pierre-Louis Bossart --- sound/soc/soc-acpi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sound/soc/soc-acpi.c b/sound/soc/soc-acpi.c index b8e72b52db30..faf8941363e4 100644 --- a/sound/soc/soc-acpi.c +++ b/sound/soc/soc-acpi.c @@ -15,7 +15,10 @@ snd_soc_acpi_find_machine(struct snd_soc_acpi_mach *machines) if (acpi_dev_present(mach->id, NULL, -1)) { if (mach->machine_quirk) mach = mach->machine_quirk(mach); - return mach; + + /* return matched machine, continue otherwise */ + if (mach) + return mach; } } return NULL;