From patchwork Tue Jun 26 09:20:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 10488409 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 681C8602B3 for ; Tue, 26 Jun 2018 09:24:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 61FF72884E for ; Tue, 26 Jun 2018 09:24:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5567F28868; Tue, 26 Jun 2018 09:24:42 +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 075722884E for ; Tue, 26 Jun 2018 09:24:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933294AbeFZJY2 (ORCPT ); Tue, 26 Jun 2018 05:24:28 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:41256 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933680AbeFZJW2 (ORCPT ); Tue, 26 Jun 2018 05:22:28 -0400 Received: by mail-wr0-f193.google.com with SMTP id h10-v6so16447277wrq.8 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=GaBvoEmw/AH7v+zz56DfrBJoYgeC1/ptKEd7S5O5PW0yJ12/PNHzPh0w8aBX8toYE9 0a1jCxjy06T9v3gD9SsvUuH4YUcZnPZRbFeuFPIIjPOn8mBhyi/AWGXwJ2Qz7H2KN5mP rc8wZaL4Q2NuDPwjBcSkfjdHX3nmgxFtEPZ8QTOU4HCrRPjaV4BeSil+joHoHPJ/Q0EE TCvNwmzYi4INDpt4v/p4nKyDLkmM7rFWRMPE4gez9w1pnq7G49G1IwCZMvkJIYn926Ok xDNPJL8P2mfsTIBNVcuqiP1t+NawIugdNbCf+Vfzojuc5Mhd6CqQVT1j3jNwST9EThZo 7nEg== X-Gm-Message-State: APt69E0kJMXh003UZK0Ojx1GCN4O6XpmPyOMYYCk5wJMShKV0n5T1hjc XQ8De3Ly3pTO8Wy2JVtg2QwdTw== X-Google-Smtp-Source: AAOMgpd+uLbZssc2kK+bH2G/6CAXQBD+Mv7ZyBgOAYorHcX3t7N06eaDlAdNJ7NZCD3qUUUfemtM8g== 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-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/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; }