Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp4898110imm; Tue, 26 Jun 2018 02:24:51 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJtCyYa9B8a6frRwARfvMBYo4j0NBPaX5Q5bzP7gW65osM35162YF0CtsNcLmPFecvKF64P X-Received: by 2002:a17:902:280b:: with SMTP id e11-v6mr782404plb.298.1530005091179; Tue, 26 Jun 2018 02:24:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530005091; cv=none; d=google.com; s=arc-20160816; b=zVsjvN0eMVTRBhzHkLzKw1O/gAiPUgXx/cu75hNDE4bFN1zE1KxZbndMwhgXCR3g8H R+x9KeIzJF0fV3Qzq5nLyD245/7PIAFda2XYJO/EQ0dFklZphDA0nyZCsdkmZ/GH6s3O ZZE1ro9/G6p7r6OadyyficPefG/FoALiTL4M+FCoD1T+WdcxJh+cW+724FpcUbJswq0C ifmMQ8To4GY3ps7iQHGbE/xUtTpfpc1NKIrPhwr3+l9nIqWCw6SNp3qR+5/utcowrPcW oUufGSlQtZ+DnZ6ITe7Ld/hNsWSOxDJJTpP2+MryhU/JvC8WlHU+pTy51pSFW1uPhAA4 SIbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=9ntn7tvil3gnvbRPyAg0hZqRPLNr9XRiNe9LjAxmLwo=; b=LzXt4qnqLS03TDGiwmoBVyvCWaFU09F/HU/WTjemFhBSyPAxQDrpsiQaX6fQaUU3tG XF5dKexMXKLF4fAyrq15+fC9Bx5t7LAdai05AwGmdMTrVb8xBi4SViCmZAEBhMFvSwcT Ca9lnA12GId3WccJYfI4WmuiXAAYozeqJ4uPf8SBAMZXpvbO3KQiANJAFmKOoG2/BLRJ jUUJi9jCgVM8ujGLei9K9bWz82qEIx4d3m7GCKCO4VYJBm4qxdPN3Nm9aAAc5hlqE4qW Xh1cZr3llZ8AuCWPFkj5SrXxHdiuwmZDAj+u2VQss3s94742/XsomzYtlJRol5vd1VTe YyJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OrQYumjQ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o11-v6si1054325pgp.586.2018.06.26.02.24.37; Tue, 26 Jun 2018 02:24:51 -0700 (PDT) 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; dkim=pass header.i=@linaro.org header.s=google header.b=OrQYumjQ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933890AbeFZJWg (ORCPT + 99 others); Tue, 26 Jun 2018 05:22:36 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:53189 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933784AbeFZJWb (ORCPT ); Tue, 26 Jun 2018 05:22:31 -0400 Received: by mail-wm0-f67.google.com with SMTP id p126-v6so1040242wmb.2 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=BT+A8W4d/ksGD4KoT3fde0ZoHJsSxJva2qnlVlCe631hVhjr57jjEF+lpv1njvpq7Z AvnedXmIQmT2qTTwK2s4kzIj3aUPM5dDEQ1GUt4udUlQsmrGzBqHk3xTxalzUR+pxGlC FUhNiV+MkWG2+t9KLA6+Xr/JdpcB8XHy+aJWxFkQSxFJZKK60biPBeDBCWdgwQ1Qo/D+ pEkzo/TI+REy36jI5WhAtTN63jPqGBclb9qxT/rkDFw7fCLFUazElFKoJ3uDdGzbnLhp wKkriTLWAIuOZyeruIrUZDcrd3GKicq3E1of41VMgALazQ1rArouHpjKzyQWGA6BRI0R G1Dg== X-Gm-Message-State: APt69E3yNxP8CAxuHWYS2vGcrB3/N8BjFS9mwUUC25jxsiF4MiUL5xWC U3khpsDjo5LXlqOaehhCccIn6Q== 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; } -- 2.16.2