Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp964370ybv; Wed, 19 Feb 2020 12:58:19 -0800 (PST) X-Google-Smtp-Source: APXvYqyjCRKmY3kbZWeg+9XAWvm+ZcTaQ433d1GiVnVvRRWIGqUPZ8S+/quEjSNcjmNGW5uOwXlz X-Received: by 2002:a05:6808:312:: with SMTP id i18mr6187402oie.44.1582145898863; Wed, 19 Feb 2020 12:58:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582145898; cv=none; d=google.com; s=arc-20160816; b=BvRlw/83meqltbTayG7AQAVJmK513spSkQsY20QhkkWwa7l40UFB5uyN/v7xt+gIPn z2Fdd2aovaqsk1O8Owe+j06H/irsNfMzG+t+mCH70sQ90vNXrQ8uWIoOMH9einM79WuU 2Q6KwI9fxWel5huvRAtkfBF17LL09uAcIB8FPEtdsvWqp3mQKKK6wIyvZlIvkohDYY5o CFZamUmy2EsG7TzinWWMwLggIRZ/26qG5VhoOwcI0yDFE1vIYwc821j7a98rM5Q+1The zSrZhXnBvi1TieLznfOJzMINC0pRm7642nBn+C+H8X3AYx3Z5ikB6nUINgOzaQs5E2cb UgRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:in-reply-to:subject:cc:to:from :date; bh=5wVbKa9fQ3NpEWa5qPh30LF0AFzceFOtf3j5buEo+2s=; b=Hd3HqH2ggWko7ewGjgejPqUzULyfutrg3osPVELaC3f2RERrtTEra6iDu2hJxgaWLA oLRPFMA5T80BM8z8zxLDTyS9A64Z2Noa4A301M36zBSQljvNWsRyNjzfls3bmhOKV/kH /VVw2+Yt0z+uVCpkyPxUCCH3swsX8JoPZGHHNfQti+7CRgIy9RXKR2ZCjXLe4ukhiM9r 6xydAeZoJjDeOO1Zo7EP72cmHGTNii5LYWTV66Ij6oZtQ7MDACYgpHTBgFn5LxCr2M+X t3td3ZjZ3hMYtzwAxXHHHPUIbWbHe/Yywy9Crb76RH7ytC2+l0iRiiFnHrJXP2+WvP5w lFAQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b8si482912otf.32.2020.02.19.12.58.07; Wed, 19 Feb 2020 12:58:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727681AbgBSU57 (ORCPT + 99 others); Wed, 19 Feb 2020 15:57:59 -0500 Received: from foss.arm.com ([217.140.110.172]:56808 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726739AbgBSU56 (ORCPT ); Wed, 19 Feb 2020 15:57:58 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 73597FEC; Wed, 19 Feb 2020 12:57:58 -0800 (PST) Received: from localhost (unknown [10.37.6.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EC82E3F68F; Wed, 19 Feb 2020 12:57:57 -0800 (PST) Date: Wed, 19 Feb 2020 20:57:56 +0000 From: Mark Brown To: Jerome Brunet Cc: alsa-devel@alsa-project.org, devicetree@vger.kernel.org, Liam Girdwood , linux-kernel@vger.kernel.org, linux-rpi-kernel , Marek Szyprowski , Mark Brown Subject: Applied "ASoC: fix card registration regression." to the asoc tree In-Reply-To: <20200219102526.692126-1-jbrunet@baylibre.com> Message-Id: X-Patchwork-Hint: ignore Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch ASoC: fix card registration regression. has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark From 6b62fa95b56bcc77cbbcc76e45f5170b4ec229b1 Mon Sep 17 00:00:00 2001 From: Jerome Brunet Date: Wed, 19 Feb 2020 11:25:26 +0100 Subject: [PATCH] ASoC: fix card registration regression. This reverts commit b2354e4009a773c00054b964d937e1b81cb92078. This change might have been desirable to ensure the uniqueness of the component name. It would have helped to better support linux devices which register multiple components, something is which more common than initially thought. However, some card driver are directly using dev_name() to fill the component names of the dai_link which is a problem if want to change the way ASoC generates the component names. Until we figure out the appropriate way to deal with this, revert the change and keep the names as they were. There might be a couple of warning related to debugfs (which were already present before the change) but it is still better than breaking working audio cards. Signed-off-by: Jerome Brunet Tested-by: Marek Szyprowski Cc: Marek Szyprowski Link: https://lore.kernel.org/r/20200219102526.692126-1-jbrunet@baylibre.com Signed-off-by: Mark Brown --- sound/soc/soc-core.c | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 30c17fde14ca..518b652cf872 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -2442,33 +2442,6 @@ static int snd_soc_register_dais(struct snd_soc_component *component, return ret; } -static char *snd_soc_component_unique_name(struct device *dev, - struct snd_soc_component *component) -{ - struct snd_soc_component *pos; - int count = 0; - char *name, *unique; - - name = fmt_single_name(dev, &component->id); - if (!name) - return name; - - /* Count the number of components registred by the device */ - for_each_component(pos) { - if (dev == pos->dev) - count++; - } - - /* Keep naming as it is for the 1st component */ - if (!count) - return name; - - unique = devm_kasprintf(dev, GFP_KERNEL, "%s-%d", name, count); - devm_kfree(dev, name); - - return unique; -} - static int snd_soc_component_initialize(struct snd_soc_component *component, const struct snd_soc_component_driver *driver, struct device *dev) { @@ -2477,7 +2450,7 @@ static int snd_soc_component_initialize(struct snd_soc_component *component, INIT_LIST_HEAD(&component->card_list); mutex_init(&component->io_mutex); - component->name = snd_soc_component_unique_name(dev, component); + component->name = fmt_single_name(dev, &component->id); if (!component->name) { dev_err(dev, "ASoC: Failed to allocate name\n"); return -ENOMEM; -- 2.20.1