Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp2505244imb; Mon, 4 Mar 2019 06:54:54 -0800 (PST) X-Google-Smtp-Source: APXvYqxbWaAIiNEt6LFYfMaT1eP9B2W5yXxBIFXVFUFDqRJWkqU5fdeyIDRa0Z4GwUP0+Ywj2Eef X-Received: by 2002:a63:f658:: with SMTP id u24mr18891762pgj.399.1551711294516; Mon, 04 Mar 2019 06:54:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551711294; cv=none; d=google.com; s=arc-20160816; b=zL6tbLXEplfDAiLX5X0Pi7HR5UmYAw56AFfZjPxBa1Kpo5yA92Ho09gbxyM2tJe66G 42nSHd6wXyJrpJSkbBsVaotp8GzDDxb7ZN7/xcMj1nraC9M5mgrgmB6PkzQ7sdABo9Rr EMWHzmaFyMpYUWq5E/u7nSr/w6Xg3j3pd1vbfCYPweN3R3aQQ6CmaplFDIGm0S6vb/8b b9MQAHc6GMXZjzUU7kCjD1FW5bGK3XdgPviWUmQLC77hQrVrr5nhPLYSaaEu3uc+pnYS 28TbYgL9Ha44o/se5z+uxSjJfhhwiZ7AG7SsT2++BXCNuUuYGHfZyQuAn4mVwF2uLjp2 ccdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:to:from; bh=bVMlFD60wsAOT44bB/JbPdYOVxoUh+rpSsuUUH8Pems=; b=VzXdUqXZurO/IKK1ULDfz2XHdJtFYsDbi39D3dmpICBItChPO2gf6lLIDYUi55xbcy Ulo1Y/Q7x5ju0ycJ4DdtzFyBTN+uggYNLNg3NZH8zRk3ijogf/V9LVp9PTtmcVh4/GZg tSOxcZVBUeh/Khb3du+dhKbi1bF9o6iY4QfZ9I3mN252XrrgENCkbqe7stawAmw0m/Yl S39D9b7aVrn2uqrb78MQc6qDtsuEqn+Rswk4nrQcxIH70aigPzCyBcwS9ZHVN0ySMUqQ hvFWGQiUoqF0HlGbEJykcdi0hSi7T8cUMuivUbUaaqbcUW2KjKTkz4/vOkeiXdFnRQ9u M6GQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u8si5442437plz.97.2019.03.04.06.54.38; Mon, 04 Mar 2019 06:54:54 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726873AbfCDOyJ (ORCPT + 99 others); Mon, 4 Mar 2019 09:54:09 -0500 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:9241 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726693AbfCDOyF (ORCPT ); Mon, 4 Mar 2019 09:54:05 -0500 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x24EqEHi011052; Mon, 4 Mar 2019 15:53:08 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2qyhgam167-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 04 Mar 2019 15:53:08 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 942EB31; Mon, 4 Mar 2019 14:53:07 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas22.st.com [10.75.90.92]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 685C04DD7; Mon, 4 Mar 2019 14:53:07 +0000 (GMT) Received: from SAFEX1HUBCAS21.st.com (10.75.90.44) by Safex1hubcas22.st.com (10.75.90.92) with Microsoft SMTP Server (TLS) id 14.3.361.1; Mon, 4 Mar 2019 15:53:07 +0100 Received: from localhost (10.201.23.16) by Webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.361.1; Mon, 4 Mar 2019 15:53:06 +0100 From: Olivier Moysan To: , , , , , , , , , , , , Subject: [PATCH 2/3] ASoC: stm32: dfsdm: fix debugfs warnings on entry creation Date: Mon, 4 Mar 2019 15:52:44 +0100 Message-ID: <1551711165-28684-3-git-send-email-olivier.moysan@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1551711165-28684-1-git-send-email-olivier.moysan@st.com> References: <1551711165-28684-1-git-send-email-olivier.moysan@st.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.201.23.16] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-03-04_06:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Register platform component with a prefix, to avoid warnings on debugfs entries creation, due to component name redundancy. Signed-off-by: Olivier Moysan --- sound/soc/stm/stm32_adfsdm.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/sound/soc/stm/stm32_adfsdm.c b/sound/soc/stm/stm32_adfsdm.c index 71d341b732a4..24948b95eb19 100644 --- a/sound/soc/stm/stm32_adfsdm.c +++ b/sound/soc/stm/stm32_adfsdm.c @@ -304,6 +304,7 @@ MODULE_DEVICE_TABLE(of, stm32_adfsdm_of_match); static int stm32_adfsdm_probe(struct platform_device *pdev) { struct stm32_adfsdm_priv *priv; + struct snd_soc_component *component; int ret; priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); @@ -331,9 +332,15 @@ static int stm32_adfsdm_probe(struct platform_device *pdev) if (IS_ERR(priv->iio_cb)) return PTR_ERR(priv->iio_cb); - ret = devm_snd_soc_register_component(&pdev->dev, - &stm32_adfsdm_soc_platform, - NULL, 0); + component = devm_kzalloc(&pdev->dev, sizeof(*component), GFP_KERNEL); + if (!component) + return -ENOMEM; +#ifdef CONFIG_DEBUG_FS + component->debugfs_prefix = "pcm"; +#endif + + ret = snd_soc_add_component(&pdev->dev, component, + &stm32_adfsdm_soc_platform, NULL, 0); if (ret < 0) dev_err(&pdev->dev, "%s: Failed to register PCM platform\n", __func__); @@ -341,12 +348,20 @@ static int stm32_adfsdm_probe(struct platform_device *pdev) return ret; } +static int stm32_adfsdm_remove(struct platform_device *pdev) +{ + snd_soc_unregister_component(&pdev->dev); + + return 0; +} + static struct platform_driver stm32_adfsdm_driver = { .driver = { .name = STM32_ADFSDM_DRV_NAME, .of_match_table = stm32_adfsdm_of_match, }, .probe = stm32_adfsdm_probe, + .remove = stm32_adfsdm_remove, }; module_platform_driver(stm32_adfsdm_driver); -- 2.7.4