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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 138E7C433F5 for ; Sun, 17 Oct 2021 07:53:48 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 79FD861152 for ; Sun, 17 Oct 2021 07:53:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 79FD861152 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org 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 D5F111813; Sun, 17 Oct 2021 09:52:55 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D5F111813 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1634457225; bh=T/mbvclDfH0kll2i5wFMKybdIyJfQxU8mP1lVkk1a8E=; h=Date:From:To:Subject:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=OUK+7FG2/IduNUyIdSAptZqtYIWHi0sKM5rUAOO9tLpW7wlHQZNMkGW9nUQ63z3YV lvg6jv2MfvMrkWEGxs2VnPz9NFk7Yq2B55ouxAqTvVQqk+eRLLHsRSWECgxXDLqaTo +vHjY6mSE/A60eOwd6mkDCRO4Lxqpq1i84pLUeBg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 7A651F801DB; Sun, 17 Oct 2021 09:52:55 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id CAA9CF8026C; Sun, 17 Oct 2021 09:52:53 +0200 (CEST) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id BFBDAF801DB for ; Sun, 17 Oct 2021 09:52:46 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz BFBDAF801DB Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="XFIBnuKV"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="CYA3J+ks" Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 3F42A1FD5B; Sun, 17 Oct 2021 07:52:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1634457161; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RPWUEn8tzfXMF5ibISUef5EFT8Kh1CEef0EdRO/a3zQ=; b=XFIBnuKVkCHO39TSRQLCU5yKQsrAQFNbqKsNxofEAo4/lHSESfPLK+3z/laUuutSMl0mD+ SbdngEPg5S0j/WLfOpUAec/Cm6c43DsMOWde8B6xBhL85XEaTV0M0BNngkdUKVa8bi+N+4 uMX+0xmffr2e4rPa4XFpSh5QOKUn3OM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1634457161; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RPWUEn8tzfXMF5ibISUef5EFT8Kh1CEef0EdRO/a3zQ=; b=CYA3J+ksVUKci/2ZH+oVE3z+s3z2xvjz0VOh7cQ/m7gBia4uBC7LSV5Mc7A0qfiAZP8vso cbIjax81iRnERlAA== Received: from alsa1.suse.de (alsa1.suse.de [10.160.4.42]) by relay2.suse.de (Postfix) with ESMTP id 21799A3B83; Sun, 17 Oct 2021 07:52:41 +0000 (UTC) Date: Sun, 17 Oct 2021 09:52:41 +0200 Message-ID: From: Takashi Iwai To: Pierre-Louis Bossart Subject: Re: [PATCH 1/5] ALSA: hda: Drop device-argument in NHLT functions In-Reply-To: References: <20211015164047.44492-1-cezary.rojewski@intel.com> <20211015164047.44492-2-cezary.rojewski@intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Cezary Rojewski , tiwai@suse.com, alsa-devel@alsa-project.org, hdegoede@redhat.com, broonie@kernel.org, Amadeusz SX2awiX4ski 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Fri, 15 Oct 2021 18:42:33 +0200, Pierre-Louis Bossart wrote: > > > > On 10/15/21 11:40 AM, Cezary Rojewski wrote: > > From: Amadeusz Sławiński > > > > ACPI is device independent, so printing warnings using device functions > > is misleading. Replace dev_xxx() with pr_xxx() and remove now > > unnecessary argument. > > the routines in sound/hda/intel-nhtl.c are called from a specific PCI > device, why would you remove that information? > > This makes no sense to me. Right, otherwise this change would confuse user, too; they'll be clueless about who triggers it. It's OK to change to pr_*(), but then it should have more information that can be easily identified and understood what user should do. thanks, Takashi > > > > > Signed-off-by: Amadeusz Sławiński > > Signed-off-by: Cezary Rojewski > > --- > > include/sound/intel-nhlt.h | 9 ++++----- > > sound/hda/intel-dsp-config.c | 4 ++-- > > sound/hda/intel-nhlt.c | 24 +++++++++++++----------- > > sound/soc/intel/skylake/skl.c | 5 ++--- > > sound/soc/sof/intel/hda.c | 4 ++-- > > 5 files changed, 23 insertions(+), 23 deletions(-) > > > > diff --git a/include/sound/intel-nhlt.h b/include/sound/intel-nhlt.h > > index d0574805865f..4debab7c1996 100644 > > --- a/include/sound/intel-nhlt.h > > +++ b/include/sound/intel-nhlt.h > > @@ -126,17 +126,17 @@ enum { > > NHLT_MIC_ARRAY_VENDOR_DEFINED = 0xf, > > }; > > > > -struct nhlt_acpi_table *intel_nhlt_init(struct device *dev); > > +struct nhlt_acpi_table *intel_nhlt_init(void); > > > > void intel_nhlt_free(struct nhlt_acpi_table *addr); > > > > -int intel_nhlt_get_dmic_geo(struct device *dev, struct nhlt_acpi_table *nhlt); > > +int intel_nhlt_get_dmic_geo(struct nhlt_acpi_table *nhlt); > > > > #else > > > > struct nhlt_acpi_table; > > > > -static inline struct nhlt_acpi_table *intel_nhlt_init(struct device *dev) > > +static inline struct nhlt_acpi_table *intel_nhlt_init(void) > > { > > return NULL; > > } > > @@ -145,8 +145,7 @@ static inline void intel_nhlt_free(struct nhlt_acpi_table *addr) > > { > > } > > > > -static inline int intel_nhlt_get_dmic_geo(struct device *dev, > > - struct nhlt_acpi_table *nhlt) > > +static inline int intel_nhlt_get_dmic_geo(struct nhlt_acpi_table *nhlt) > > { > > return 0; > > } > > diff --git a/sound/hda/intel-dsp-config.c b/sound/hda/intel-dsp-config.c > > index b9ac9e9e45a4..60cc4735c6ec 100644 > > --- a/sound/hda/intel-dsp-config.c > > +++ b/sound/hda/intel-dsp-config.c > > @@ -382,9 +382,9 @@ static int snd_intel_dsp_check_dmic(struct pci_dev *pci) > > struct nhlt_acpi_table *nhlt; > > int ret = 0; > > > > - nhlt = intel_nhlt_init(&pci->dev); > > + nhlt = intel_nhlt_init(); > > if (nhlt) { > > - if (intel_nhlt_get_dmic_geo(&pci->dev, nhlt)) > > + if (intel_nhlt_get_dmic_geo(nhlt)) > > ret = 1; > > intel_nhlt_free(nhlt); > > } > > diff --git a/sound/hda/intel-nhlt.c b/sound/hda/intel-nhlt.c > > index e2237239d922..195d9e193a6c 100644 > > --- a/sound/hda/intel-nhlt.c > > +++ b/sound/hda/intel-nhlt.c > > @@ -1,10 +1,12 @@ > > // SPDX-License-Identifier: GPL-2.0-only > > // Copyright (c) 2015-2019 Intel Corporation > > > > +#define pr_fmt(fmt) "NHLT: " fmt > > + > > #include > > #include > > > > -struct nhlt_acpi_table *intel_nhlt_init(struct device *dev) > > +struct nhlt_acpi_table *intel_nhlt_init(void) > > { > > struct nhlt_acpi_table *nhlt; > > acpi_status status; > > @@ -12,7 +14,7 @@ struct nhlt_acpi_table *intel_nhlt_init(struct device *dev) > > status = acpi_get_table(ACPI_SIG_NHLT, 0, > > (struct acpi_table_header **)&nhlt); > > if (ACPI_FAILURE(status)) { > > - dev_warn(dev, "NHLT table not found\n"); > > + pr_warn("NHLT table not found\n"); > > return NULL; > > } > > > > @@ -26,7 +28,7 @@ void intel_nhlt_free(struct nhlt_acpi_table *nhlt) > > } > > EXPORT_SYMBOL_GPL(intel_nhlt_free); > > > > -int intel_nhlt_get_dmic_geo(struct device *dev, struct nhlt_acpi_table *nhlt) > > +int intel_nhlt_get_dmic_geo(struct nhlt_acpi_table *nhlt) > > { > > struct nhlt_endpoint *epnt; > > struct nhlt_dmic_array_config *cfg; > > @@ -40,7 +42,7 @@ int intel_nhlt_get_dmic_geo(struct device *dev, struct nhlt_acpi_table *nhlt) > > return 0; > > > > if (nhlt->header.length <= sizeof(struct acpi_table_header)) { > > - dev_warn(dev, "Invalid DMIC description table\n"); > > + pr_warn("Invalid DMIC description table\n"); > > return 0; > > } > > > > @@ -55,7 +57,7 @@ int intel_nhlt_get_dmic_geo(struct device *dev, struct nhlt_acpi_table *nhlt) > > > > /* find max number of channels based on format_configuration */ > > if (fmt_configs->fmt_count) { > > - dev_dbg(dev, "%s: found %d format definitions\n", > > + pr_debug("%s: found %d format definitions\n", > > __func__, fmt_configs->fmt_count); > > > > for (i = 0; i < fmt_configs->fmt_count; i++) { > > @@ -66,9 +68,9 @@ int intel_nhlt_get_dmic_geo(struct device *dev, struct nhlt_acpi_table *nhlt) > > if (fmt_ext->fmt.channels > max_ch) > > max_ch = fmt_ext->fmt.channels; > > } > > - dev_dbg(dev, "%s: max channels found %d\n", __func__, max_ch); > > + pr_debug("%s: max channels found %d\n", __func__, max_ch); > > } else { > > - dev_dbg(dev, "%s: No format information found\n", __func__); > > + pr_debug("%s: No format information found\n", __func__); > > } > > > > if (cfg->device_config.config_type != NHLT_CONFIG_TYPE_MIC_ARRAY) { > > @@ -90,21 +92,21 @@ int intel_nhlt_get_dmic_geo(struct device *dev, struct nhlt_acpi_table *nhlt) > > dmic_geo = cfg_vendor->nb_mics; > > break; > > default: > > - dev_warn(dev, "%s: undefined DMIC array_type 0x%0x\n", > > + pr_warn("%s: undefined DMIC array_type 0x%0x\n", > > __func__, cfg->array_type); > > } > > > > if (dmic_geo > 0) { > > - dev_dbg(dev, "%s: Array with %d dmics\n", __func__, dmic_geo); > > + pr_debug("%s: Array with %d dmics\n", __func__, dmic_geo); > > } > > if (max_ch > dmic_geo) { > > - dev_dbg(dev, "%s: max channels %d exceed dmic number %d\n", > > + pr_debug("%s: max channels %d exceed dmic number %d\n", > > __func__, max_ch, dmic_geo); > > } > > } > > } > > > > - dev_dbg(dev, "%s: dmic number %d max_ch %d\n", > > + pr_debug("%s: dmic number %d max_ch %d\n", > > __func__, dmic_geo, max_ch); > > > > return dmic_geo; > > diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c > > index 5b1a15e39912..4f122616b636 100644 > > --- a/sound/soc/intel/skylake/skl.c > > +++ b/sound/soc/intel/skylake/skl.c > > @@ -517,8 +517,7 @@ static int skl_find_machine(struct skl_dev *skl, void *driver_data) > > if (pdata) { > > skl->use_tplg_pcm = pdata->use_tplg_pcm; > > mach->mach_params.dmic_num = > > - intel_nhlt_get_dmic_geo(&skl->pci->dev, > > - skl->nhlt); > > + intel_nhlt_get_dmic_geo(skl->nhlt); > > } > > > > return 0; > > @@ -1009,7 +1008,7 @@ static int skl_probe(struct pci_dev *pci, > > > > device_disable_async_suspend(bus->dev); > > > > - skl->nhlt = intel_nhlt_init(bus->dev); > > + skl->nhlt = intel_nhlt_init(); > > > > if (skl->nhlt == NULL) { > > #if !IS_ENABLED(CONFIG_SND_SOC_INTEL_SKYLAKE_HDAUDIO_CODEC) > > diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c > > index 883d78dd01b5..75c2ee91bf13 100644 > > --- a/sound/soc/sof/intel/hda.c > > +++ b/sound/soc/sof/intel/hda.c > > @@ -651,9 +651,9 @@ static int check_nhlt_dmic(struct snd_sof_dev *sdev) > > struct nhlt_acpi_table *nhlt; > > int dmic_num; > > > > - nhlt = intel_nhlt_init(sdev->dev); > > + nhlt = intel_nhlt_init(); > > if (nhlt) { > > - dmic_num = intel_nhlt_get_dmic_geo(sdev->dev, nhlt); > > + dmic_num = intel_nhlt_get_dmic_geo(nhlt); > > intel_nhlt_free(nhlt); > > if (dmic_num >= 1 && dmic_num <= 4) > > return dmic_num; > > >