Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp4898947imm; Tue, 26 Jun 2018 02:26:00 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKi6MIjYJ1dTMsbbmVDX7/qZQWiLESbYpUrIaP30zRQ+W1y0kdE5mSGOGSyfh6PnmMqRSd1 X-Received: by 2002:a63:ac11:: with SMTP id v17-v6mr686839pge.274.1530005160683; Tue, 26 Jun 2018 02:26:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530005160; cv=none; d=google.com; s=arc-20160816; b=sPNW63/hsNXuvv75rZKcM95Ju0ey7T3Wc6GmHS0JWSekOdpBLL8tqqaCEEKQquFMwi WvlqH/FkokG4VlSqlvX3guNA/n+Thfk7YZI1gatcTw87S28K6NtVmDyO6uIWN9U3DMFU /ck2NND3gOSTzUT2FdlLu4TUOh7YUUEurKLhJeUk4ht7vr/VCCpulxngfWRP9urN5BxM LDiwaVq2DDqzyQJ9whQguR0hpxsEQCechV2QDR/H2safxnnvUqiqLOgvdIynse5wc9IT KsF6HnpLX9T1M9o/TpRnlqcPrHXslfHjvBLTdPf61gO5QcQMoOSm1jeS0VScbiML2Der qP4w== 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=cEqIPpNtjb9dQHb944VG2jBsTOC/VovGjNwlIJ+31Dg=; b=zcV+dZFMOsT1Dte6rh6PZ6VNonxOdSo5Xu4PL9tiOVRxQeoQg0dK5SQ3n6M/zKevGH w4YpUNwjqhPWK1sk+FhndeuqF9KuIINl6uv/CUnmVcnhfbrJhYss6ENxn9WznwJ8Jvzt gS8vHoDZ1qyix8rlzLIyKhDazVPcqSVlwe8WaoA5Nmin/wnTWVSYKeO0k3Mez62yNaXy sZyE9wIIFnzmix3H/YzhCHll+fJDjWDwV8k+ur0EYIStxDwl13RGtvC/xiXLXGMY6Nnf ZCHG+YZJ+aNamMjnM5bF5W3wGtnpMLdBUnWMvGsYVe/ZR+7aQd41uPGbCman77i1ytaJ Jjrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YEzKI8ML; 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 w16-v6si1399048plk.79.2018.06.26.02.25.46; Tue, 26 Jun 2018 02:26:00 -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=YEzKI8ML; 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 S933997AbeFZJY2 (ORCPT + 99 others); Tue, 26 Jun 2018 05:24:28 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:40020 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933677AbeFZJW2 (ORCPT ); Tue, 26 Jun 2018 05:22:28 -0400 Received: by mail-wr0-f195.google.com with SMTP id g18-v6so16452982wro.7 for ; Tue, 26 Jun 2018 02:22:28 -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=cEqIPpNtjb9dQHb944VG2jBsTOC/VovGjNwlIJ+31Dg=; b=YEzKI8MLQZfuWw9gYQhtHgB5gdDGlKPY1gKV+yUFrT3XdbWybEYPlHTjR/CBkJqcqd 4T4VEo9rXJKgUPtP1J7Tl/R6NOHP+xQob37Bie4z3o+0lr/jxinDQDjjmkju8ONGTJb/ r1ehZNGBo3C2IF+94XFq8Jpg/SKK+iYJIV10I= 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=cEqIPpNtjb9dQHb944VG2jBsTOC/VovGjNwlIJ+31Dg=; b=I80wRIiV14mEJMyNxtP4oBCQq3KedQ9xanKGCSYduO1a/cPzAvFrk8eD2kIByu48jW Dzb4W5AUS/GDT00cLMRcCP/EyskClCw2S+HI/ueVrhX1bWno2PbZwQekYSC04aBlEZHc iBRMHjPMpYQJZMWW1q1BlJqfGsvPDvzlOqst66cLHEqeRIlJFT/ht5hmbEiI8iuQGyIa e1GTzdQRtAkX7gac4xKwEJjNkhLgLUZw1WIaOMsqVZX8MZCmzA1rAQIL7pM5t/W6UMd2 xD7mDLIVtD2vJBOI/K00FIb6UI0WL5YtUMQd5foWann37Zdzm4bSMAJ7BUwvd1inHPdM utjw== X-Gm-Message-State: APt69E0b7SOemFgjm+jDj6v02PoG0Itr0p0dAn8ueIbkafRxpY2X+4HW ZFlyAsrjrTyIJK3YMuaHhcsY9w== X-Received: by 2002:adf:9246:: with SMTP id 64-v6mr755074wrj.109.1530004947635; Tue, 26 Jun 2018 02:22:27 -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.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 26 Jun 2018 02:22:26 -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 04/12] ASoC: qdsp6: q6adm: use of_platform_populate/depopulate() Date: Tue, 26 Jun 2018 10:20:08 +0100 Message-Id: <20180626092016.9296-5-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 --- sound/soc/qcom/qdsp6/q6adm.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/sound/soc/qcom/qdsp6/q6adm.c b/sound/soc/qcom/qdsp6/q6adm.c index 9983c665a941..932c3ebfd252 100644 --- a/sound/soc/qcom/qdsp6/q6adm.c +++ b/sound/soc/qcom/qdsp6/q6adm.c @@ -64,7 +64,6 @@ struct q6adm { struct aprv2_ibasic_rsp_result_t result; struct mutex lock; wait_queue_head_t matrix_map_wait; - struct platform_device *pdev_routing; }; struct q6adm_cmd_device_open_v5 { @@ -588,7 +587,6 @@ EXPORT_SYMBOL_GPL(q6adm_close); static int q6adm_probe(struct apr_device *adev) { struct device *dev = &adev->dev; - struct device_node *dais_np; struct q6adm *adm; adm = devm_kzalloc(&adev->dev, sizeof(*adm), GFP_KERNEL); @@ -605,22 +603,12 @@ static int q6adm_probe(struct apr_device *adev) INIT_LIST_HEAD(&adm->copps_list); spin_lock_init(&adm->copps_list_lock); - dais_np = of_get_child_by_name(dev->of_node, "routing"); - if (dais_np) { - adm->pdev_routing = of_platform_device_create(dais_np, - "q6routing", dev); - of_node_put(dais_np); - } - - return 0; + return of_platform_populate(dev->of_node, NULL, NULL, dev); } static int q6adm_remove(struct apr_device *adev) { - struct q6adm *adm = dev_get_drvdata(&adev->dev); - - if (adm->pdev_routing) - of_platform_device_destroy(&adm->pdev_routing->dev, NULL); + of_platform_depopulate(&adev->dev); return 0; } -- 2.16.2