From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4839AC04E69 for ; Wed, 26 Jul 2023 16:28:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231741AbjGZQ2D (ORCPT ); Wed, 26 Jul 2023 12:28:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231357AbjGZQ1x (ORCPT ); Wed, 26 Jul 2023 12:27:53 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D8B026AC for ; Wed, 26 Jul 2023 09:27:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690388872; x=1721924872; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=97MgdinZzeqLR7dKFXO0MmcsC1rkrqiXpSbNH2kGwTI=; b=bxKCGoWPeLY5lWUDCMXNMEVMSd10ffLHvuIvLC82hqeMbV9m6R6VhinZ U989lgcH/toHGzW/3Tq5Zwi89oHZlGwRf1wR+VFBAbhWEIhGZ5JixgvvB FsN/n1LQbNI4Jxoa6FpAqcLzc43dTANLgjtTCih7EgLY5SCd7bYfR+6Pf pPinoSmWbrKAcPOL4uMr0HIJgqlo16ROQ1QjwBS4RfQzN+AJRtnMfagiH PlKZjyOHPiLrex0/s4hpvRuQ4KiQ6TqHtUg1PyOf+lkun6Qu1gWPeyb3T KVJpge878UganhNC0nVt1zEIqkwrgD57v0c42auc27DMjSGpexu62+4MM A==; X-IronPort-AV: E=McAfee;i="6600,9927,10783"; a="352968319" X-IronPort-AV: E=Sophos;i="6.01,232,1684825200"; d="scan'208";a="352968319" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jul 2023 09:27:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10783"; a="796643250" X-IronPort-AV: E=Sophos;i="6.01,232,1684825200"; d="scan'208";a="796643250" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga004.fm.intel.com with ESMTP; 26 Jul 2023 09:27:46 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1qOhMW-00EzwV-0U; Wed, 26 Jul 2023 19:27:44 +0300 Date: Wed, 26 Jul 2023 19:27:43 +0300 From: Andy Shevchenko To: Brent Lu Cc: alsa-devel@alsa-project.org, Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Peter Ujfalusi , Bard Liao , Ranjani Sridharan , Kai Vehmanen , Mark Brown , Jaroslav Kysela , Takashi Iwai , linux-kernel@vger.kernel.org, Ajye Huang , Yong Zhi , Terry Cheong , Uday M Bhat , Mac Chiang , "Dharageswari . R" , Kuninori Morimoto , ye xingchen Subject: Re: [PATCH v2 1/2] ASoC: Intel: maxim-common: get codec number from ACPI Message-ID: References: <20230726140848.2267568-1-brent.lu@intel.com> <20230726140848.2267568-2-brent.lu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230726140848.2267568-2-brent.lu@intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 26, 2023 at 10:08:47PM +0800, Brent Lu wrote: > Implement a helper function to get number of codecs from ACPI > subsystem to remove the need of quirk flag in machine driver. ... > +void max_98390_dai_link(struct snd_soc_dai_link *link) > +{ > + unsigned int num_codecs = get_num_codecs(MAX_98390_ACPI_HID); > + > + link->codecs = max_98390_components; > + > + switch (num_codecs) { > + case 2: > + case 4: > + link->num_codecs = num_codecs; > + break; > + default: > + pr_err("invalid codec number %d for %s\n", num_codecs, > + MAX_98390_ACPI_HID); I believe you have struct device pointer available, use dev_err(). > + break; > + } > + > + link->init = max_98390_init; > + link->ops = &max_98390_ops; > +} ... > +void max_98390_set_codec_conf(struct snd_soc_card *card) > { > + unsigned int num_codecs = get_num_codecs(MAX_98390_ACPI_HID); > + > + card->codec_conf = max_98390_codec_conf; > + > + switch (num_codecs) { > + case 2: > + case 4: > + card->num_configs = num_codecs; > + break; > + default: > + pr_err("invalid codec number %d for %s\n", num_codecs, > + MAX_98390_ACPI_HID); Ditto. > + break; > } > } -- With Best Regards, Andy Shevchenko