From patchwork Tue Jun 26 09:20:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 10488353 X-Patchwork-Delegate: agross@codeaurora.org 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 65B9160386 for ; Tue, 26 Jun 2018 09:22:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 60B1928848 for ; Tue, 26 Jun 2018 09:22:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 552FB28856; Tue, 26 Jun 2018 09:22:41 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F3D4A2884E for ; Tue, 26 Jun 2018 09:22:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933916AbeFZJWh (ORCPT ); Tue, 26 Jun 2018 05:22:37 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:55874 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933473AbeFZJWb (ORCPT ); Tue, 26 Jun 2018 05:22:31 -0400 Received: by mail-wm0-f68.google.com with SMTP id v16-v6so1031938wmv.5 for ; Tue, 26 Jun 2018 02:22:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9ntn7tvil3gnvbRPyAg0hZqRPLNr9XRiNe9LjAxmLwo=; b=OrQYumjQI+tnScHt4ElZzhag3QVDdpjFroKkraRlfebj8KKGyZXtzb7vL9MuyhXwaC m5bsQRZXcUMPBZqzSnch419tdNcJoqf3DmJDt0vsZh4lRDUT4Cv7y6Dxi+4pthPWto68 EYLyfGbl83PioMQ6V/nOSPuirpGbv6b16EHf0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=9ntn7tvil3gnvbRPyAg0hZqRPLNr9XRiNe9LjAxmLwo=; b=lvPVml50/kfmZTWhYDXQgdB73zmGt48rTvQde0fOnhEspXsWwuxLuiBAgP/tN1A4in rAbXqebx30XiclDDNFgTaDQEv8U0FeE7cTd1QntJpQWRUE6ARt9pCwAqJksrFHGgpRpt LbNIIOPsBTY7wos9XAgjx7Fd2X2XMKUjBzfkTp+nI6EZIJ80SfSNgK1jaXgkCiwPsETM LgX+G5OykaAMrvWHpWoZOFqw1OT25VsNQotNSn6u07AR3aFbtWiM5KCzmffJN9rTfgVJ 8qxK7OxNtxealhgD26zrPvmbaa0JHDlVz5UFtifjpP8vOQz3o8LcqTTWYLvZty/ZfYyp Ecbw== X-Gm-Message-State: APt69E00CBpKqKsqbqt/SUfgHBLqxct2L/B9N10pNKLFXri3pFXyLPSo SzL5hBwn9Wc3XYDaThFq5eAP7xJ0hHY= X-Google-Smtp-Source: AAOMgpfXxRRU6Qz0gU8X83f2nn2bOt89rKFbnvLzhkYLT+d9wfW1yEJCw3s85M5wt1MCOGYmACSpoA== X-Received: by 2002:a1c:8893:: with SMTP id k141-v6mr931940wmd.133.1530004950022; Tue, 26 Jun 2018 02:22:30 -0700 (PDT) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id x5-v6sm1438456wrr.3.2018.06.26.02.22.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 26 Jun 2018 02:22:29 -0700 (PDT) From: Srinivas Kandagatla To: broonie@kernel.org, robh+dt@kernel.org, alsa-devel@alsa-project.org Cc: devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, lgirdwood@gmail.com, bgoswami@codeaurora.org, tiwai@suse.com, perex@perex.cz, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, niklas.cassel@linaro.org, Srinivas Kandagatla Subject: [PATCH v2 06/12] ASoC: qdsp6: q6afe: use of_platform_populate/depopulate() Date: Tue, 26 Jun 2018 10:20:10 +0100 Message-Id: <20180626092016.9296-7-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180626092016.9296-1-srinivas.kandagatla@linaro.org> References: <20180626092016.9296-1-srinivas.kandagatla@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Now that the child nodes have there own compatible strings, Use of_platform_populate/depopulate() instead of less common of_platform_device_create()/destroy(). Signed-off-by: Srinivas Kandagatla Acked-by: Niklas Cassel --- sound/soc/qcom/qdsp6/q6afe.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/sound/soc/qcom/qdsp6/q6afe.c b/sound/soc/qcom/qdsp6/q6afe.c index 01f43218984b..621b67b34db9 100644 --- a/sound/soc/qcom/qdsp6/q6afe.c +++ b/sound/soc/qcom/qdsp6/q6afe.c @@ -316,7 +316,6 @@ struct q6afe { struct mutex lock; struct list_head port_list; spinlock_t port_list_lock; - struct platform_device *pdev_dais; }; struct afe_port_cmd_device_start { @@ -1438,7 +1437,6 @@ static int q6afe_probe(struct apr_device *adev) { struct q6afe *afe; struct device *dev = &adev->dev; - struct device_node *dais_np; afe = devm_kzalloc(dev, sizeof(*afe), GFP_KERNEL); if (!afe) @@ -1453,22 +1451,12 @@ static int q6afe_probe(struct apr_device *adev) dev_set_drvdata(dev, afe); - dais_np = of_get_child_by_name(dev->of_node, "dais"); - if (dais_np) { - afe->pdev_dais = of_platform_device_create(dais_np, - "q6afe-dai", dev); - of_node_put(dais_np); - } - - return 0; + return of_platform_populate(dev->of_node, NULL, NULL, dev); } static int q6afe_remove(struct apr_device *adev) { - struct q6afe *afe = dev_get_drvdata(&adev->dev); - - if (afe->pdev_dais) - of_platform_device_destroy(&afe->pdev_dais->dev, NULL); + of_platform_depopulate(&adev->dev); return 0; }