From patchwork Mon Oct 9 11:54:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maarten Lankhorst X-Patchwork-Id: 149985 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp1811590vqo; Mon, 9 Oct 2023 04:55:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF7x08Q9WMTCfT+/8YP/d9UFydjGV+7A1sAVedbNOtbsU9mTKBXTh1Tb5dmsBP/7/2l+SH4 X-Received: by 2002:a05:6870:f151:b0:1d6:5e48:c133 with SMTP id l17-20020a056870f15100b001d65e48c133mr17196618oac.21.1696852549500; Mon, 09 Oct 2023 04:55:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696852549; cv=none; d=google.com; s=arc-20160816; b=AH5t9aZnOyLUgMXh5o4P+gAgrQ+ti+oqrUYZniaacCE5hFyO/vDbQWvbKL5bbxhejz mtFqEQETA4N0UoElnLtglcpp+/qsOT9nc1El/ecyxq9mNZqYV26Mbc4OhJo0lomlJWTp Bt3Uc4thGkbG7pct0o3dhfcbRf83RHeFrlKJ8AjZshMxqYkJ5OBCWt7oOAIVoNsb7BI/ 93qkg4yY4MM4fXh/cPuqFHNM35ykqVSGJ0uaImvau41cDzjKhFJObkZdCdB/MXvxVfAL cHJ13yc+TA4IpxL4A3FuzQzgjloJl9rM1aDt+IUkkmSyY5x/HYk/FSIS+0x2hnrX6wU6 ZuQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ZqYY4i1RzlVXt9wN7D14438jyXVzNR63bn44U+x0Hq8=; fh=gSlqDyTAaX4sD5o7lNdgN6GT1mkO6Z4/Ye0T8jAhwnM=; b=eyHy29cFLE/o7L6Q+KBcat2DrpUEb8HsDSe/Zn/iak0NmLxe6ooAVSDdLQdWHPVB2i 3/uM2Ajn2dy9QVnOru/4hvJEs+2WjsPNEayObrWGevd/hzod7M6aRnxt6gTzm66FUNA2 RazXZY5+ALS/eS590g9zH6UfwQAEgyiXKe1FDP3kaEyKTJ38FPDQBuuTe85gTA1lVuCG 8t0UwragBXkYq5YRLngEHr8v8QU0jRVEHMxRKsQm4VAygV5Q0e59GnkeSKQ2DcrdIjqg bVGGbiC+4SIOooBiH0nIycjfWNWcc23GEZsdtY4T7M5Xe6GWsgz6sfb6V0fROWjDbjgX ANAA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id m9-20020a056a00080900b00690296eb869si7507359pfk.257.2023.10.09.04.55.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 04:55:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 41F0E802A6F3; Mon, 9 Oct 2023 04:55:48 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346376AbjJILzh (ORCPT + 18 others); Mon, 9 Oct 2023 07:55:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346437AbjJILzR (ORCPT ); Mon, 9 Oct 2023 07:55:17 -0400 Received: from mblankhorst.nl (lankhorst.se [IPv6:2a02:2308:0:7ec:e79c:4e97:b6c4:f0ae]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 528B5133 for ; Mon, 9 Oct 2023 04:55:03 -0700 (PDT) From: Maarten Lankhorst To: alsa-devel@alsa-project.org Cc: Maarten Lankhorst , Jaroslav Kysela , Takashi Iwai , Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Peter Ujfalusi , Bard Liao , Ranjani Sridharan , Kai Vehmanen , Mark Brown , Daniel Baluta , linux-kernel@vger.kernel.org, sound-open-firmware@alsa-project.org Subject: [PATCH v7 13/13] ALSA: hda: i915: Remove extra argument from snd_hdac_i915_init Date: Mon, 9 Oct 2023 13:54:37 +0200 Message-Id: <20231009115437.99976-14-maarten.lankhorst@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231009115437.99976-1-maarten.lankhorst@linux.intel.com> References: <20231009115437.99976-1-maarten.lankhorst@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE, SPF_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 09 Oct 2023 04:55:48 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779278858711045682 X-GMAIL-MSGID: 1779278858711045682 Now that all drivers have moved from modprobe loading to handling -EPROBE_DEFER, we can remove the argument again. Signed-off-by: Maarten Lankhorst Reviewed-by: Kai Vehmanen --- include/sound/hda_i915.h | 4 ++-- sound/hda/hdac_i915.c | 14 +++----------- sound/pci/hda/hda_intel.c | 2 +- sound/soc/intel/avs/core.c | 2 +- sound/soc/intel/skylake/skl.c | 2 +- sound/soc/sof/intel/hda-codec.c | 2 +- 6 files changed, 9 insertions(+), 17 deletions(-) diff --git a/include/sound/hda_i915.h b/include/sound/hda_i915.h index f91bd66360865..6b79614a893b9 100644 --- a/include/sound/hda_i915.h +++ b/include/sound/hda_i915.h @@ -9,12 +9,12 @@ #ifdef CONFIG_SND_HDA_I915 void snd_hdac_i915_set_bclk(struct hdac_bus *bus); -int snd_hdac_i915_init(struct hdac_bus *bus, bool allow_modprobe); +int snd_hdac_i915_init(struct hdac_bus *bus); #else static inline void snd_hdac_i915_set_bclk(struct hdac_bus *bus) { } -static inline int snd_hdac_i915_init(struct hdac_bus *bus, bool allow_modprobe) +static inline int snd_hdac_i915_init(struct hdac_bus *bus) { return -ENODEV; } diff --git a/sound/hda/hdac_i915.c b/sound/hda/hdac_i915.c index 0765e5350e7ba..365c36fdf2058 100644 --- a/sound/hda/hdac_i915.c +++ b/sound/hda/hdac_i915.c @@ -156,7 +156,7 @@ static int i915_gfx_present(struct pci_dev *hdac_pci) * * Returns zero for success or a negative error code. */ -int snd_hdac_i915_init(struct hdac_bus *bus, bool allow_modprobe) +int snd_hdac_i915_init(struct hdac_bus *bus) { struct drm_audio_component *acomp; int err; @@ -172,18 +172,10 @@ int snd_hdac_i915_init(struct hdac_bus *bus, bool allow_modprobe) acomp = bus->audio_component; if (!acomp) return -ENODEV; - if (allow_modprobe && !acomp->ops) { - if (!IS_ENABLED(CONFIG_MODULES) || - !request_module("i915")) { - /* 60s timeout */ - wait_for_completion_killable_timeout(&acomp->master_bind_complete, - msecs_to_jiffies(60 * 1000)); - } - } if (!acomp->ops) { - int err = allow_modprobe ? -ENODEV : -EPROBE_DEFER; snd_hdac_acomp_exit(bus); - return dev_err_probe(bus->dev, err, "couldn't bind with audio component\n"); + return dev_err_probe(bus->dev, -EPROBE_DEFER, + "couldn't bind with audio component\n"); } return 0; } diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index c729ce192a7d2..976e9d388cc78 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -2138,7 +2138,7 @@ static int azx_probe(struct pci_dev *pci, #ifdef CONFIG_SND_HDA_I915 /* bind with i915 if needed */ if (chip->driver_caps & AZX_DCAPS_I915_COMPONENT) { - err = snd_hdac_i915_init(azx_bus(chip), false); + err = snd_hdac_i915_init(azx_bus(chip)); if (err < 0) { /* if the controller is bound only with HDMI/DP * (for HSW and BDW), we need to abort the probe; diff --git a/sound/soc/intel/avs/core.c b/sound/soc/intel/avs/core.c index 8a20639582487..33044f353575d 100644 --- a/sound/soc/intel/avs/core.c +++ b/sound/soc/intel/avs/core.c @@ -461,7 +461,7 @@ static int avs_pci_probe(struct pci_dev *pci, const struct pci_device_id *id) pci_set_drvdata(pci, bus); device_disable_async_suspend(dev); - ret = snd_hdac_i915_init(bus, false); + ret = snd_hdac_i915_init(bus); if (ret == -EPROBE_DEFER) goto err_i915_init; else if (ret < 0) diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c index 24bdbe2a53bec..f46f109d5856e 100644 --- a/sound/soc/intel/skylake/skl.c +++ b/sound/soc/intel/skylake/skl.c @@ -1056,7 +1056,7 @@ static int skl_probe(struct pci_dev *pci, } if (IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI)) { - err = snd_hdac_i915_init(bus, false); + err = snd_hdac_i915_init(bus); if (err < 0) goto out_dmic_unregister; } diff --git a/sound/soc/sof/intel/hda-codec.c b/sound/soc/sof/intel/hda-codec.c index f1fd5b44aaac9..8a5e99a898ecb 100644 --- a/sound/soc/sof/intel/hda-codec.c +++ b/sound/soc/sof/intel/hda-codec.c @@ -415,7 +415,7 @@ int hda_codec_i915_init(struct snd_sof_dev *sdev) return 0; /* i915 exposes a HDA codec for HDMI audio */ - ret = snd_hdac_i915_init(bus, true); + ret = snd_hdac_i915_init(bus); if (ret < 0) return ret;