From patchwork Tue Aug 29 15:36:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Stach X-Patchwork-Id: 9927655 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 735976022E for ; Tue, 29 Aug 2017 15:37:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6370C289C0 for ; Tue, 29 Aug 2017 15:37:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6224B289CD; Tue, 29 Aug 2017 15:37:24 +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=-1.9 required=2.0 tests=BAYES_00, 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 C03FE289C0 for ; Tue, 29 Aug 2017 15:37:12 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 4925A266D9D; Tue, 29 Aug 2017 17:37:10 +0200 (CEST) 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 C758F266DF0; Tue, 29 Aug 2017 17:37:08 +0200 (CEST) Received: from metis.ext.4.pengutronix.de (metis.ext.4.pengutronix.de [92.198.50.35]) by alsa0.perex.cz (Postfix) with ESMTP id 1A51D266C6D for ; Tue, 29 Aug 2017 17:37:06 +0200 (CEST) Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7] helo=dude.pengutronix.de.) by metis.ext.pengutronix.de with esmtp (Exim 4.84_2) (envelope-from ) id 1dmiZV-0008Ex-11; Tue, 29 Aug 2017 17:36:57 +0200 From: Lucas Stach To: Liam Girdwood , Mark Brown , Kuninori Morimoto Date: Tue, 29 Aug 2017 17:36:53 +0200 Message-Id: <20170829153653.11766-1-l.stach@pengutronix.de> X-Mailer: git-send-email 2.11.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: l.stach@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: alsa-devel@alsa-project.org Cc: alsa-devel@alsa-project.org, patchwork-lst@pengutronix.de, Takashi Iwai , kernel@pengutronix.de Subject: [alsa-devel] [PATCH] Revert "ASoC: simple-card-utils: enable "label" on asoc_simple_card_parse_card_name" 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 This commit breaks existing systems, as snd_soc_of_parse_card_name() doesn't return an error if the DT name property is missing, which would be required to hit the fallback path in the offending commit at all. Signed-off-by: Lucas Stach --- This should be fixed properly, but given the timing with the 4.13 release being really close, I opted for just reverting the offending commit. --- sound/soc/generic/simple-card-utils.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c index 7d7ab4aee42e..e6f472360cfc 100644 --- a/sound/soc/generic/simple-card-utils.c +++ b/sound/soc/generic/simple-card-utils.c @@ -125,21 +125,15 @@ EXPORT_SYMBOL_GPL(asoc_simple_card_set_dailink_name); int asoc_simple_card_parse_card_name(struct snd_soc_card *card, char *prefix) { + char prop[128]; int ret; - if (!prefix) - prefix = ""; + snprintf(prop, sizeof(prop), "%sname", prefix); /* Parse the card name from DT */ - ret = snd_soc_of_parse_card_name(card, "label"); - if (ret < 0) { - char prop[128]; - - snprintf(prop, sizeof(prop), "%sname", prefix); - ret = snd_soc_of_parse_card_name(card, prop); - if (ret < 0) - return ret; - } + ret = snd_soc_of_parse_card_name(card, prop); + if (ret < 0) + return ret; if (!card->name && card->dai_link) card->name = card->dai_link->name;