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: 139917 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp5006075lji; Tue, 26 Jun 2018 02:22:40 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJASDu7BjUZf7NN/iK/nHTa76vKeoq630eAcjAGledaAn5gIg9rB/OGYPn3bX36e6EUqawj X-Received: by 2002:a63:8a41:: with SMTP id y62-v6mr623842pgd.291.1530004960177; Tue, 26 Jun 2018 02:22:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530004960; cv=none; d=google.com; s=arc-20160816; b=HMvNv8dw3EPb3AdepgpBBrtysvlN9yteYGFe9jPpw2CZKLVXs6lHgV9QiyWcbOwFv4 ZJsK0UlbM/hMwc6MWZrEMO2v+b82TGc2abC6mOdm5Shezt0exzTdpJ7WGBVbWmmWq35x 2/xzQoDLSmyX9bZR6fduaWo3xl2HRHlBqLc4KbnwV2M+kE7U+rE4Vf0wHUtSjh+M0nJr CTm0R8gpDHUHnRK4Fa29NeJLWe+Ow8LpWxldraRXGARz2tyOV+XnAH4r4FkgwiA/mlJ2 4ppvqT9JFfrw6IJT2o6TFGKxpCuTnQBvwAKkoCIr4RHUdlQX9nilnpfu77u4E1Rs026l F38w== 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 e7-v6si1199851plk.397.2018.06.26.02.22.39; Tue, 26 Jun 2018 02:22:40 -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 S933899AbeFZJWh (ORCPT + 31 others); Tue, 26 Jun 2018 05:22:37 -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(-) -- 2.16.2 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; }