From patchwork Tue Jun 26 09:20:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 10488397 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 BE3F3602D8 for ; Tue, 26 Jun 2018 09:24:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA08A28857 for ; Tue, 26 Jun 2018 09:24:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AE3E22886E; Tue, 26 Jun 2018 09:24:01 +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 5603528857 for ; Tue, 26 Jun 2018 09:24:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934186AbeFZJX7 (ORCPT ); Tue, 26 Jun 2018 05:23:59 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:40812 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933768AbeFZJWa (ORCPT ); Tue, 26 Jun 2018 05:22:30 -0400 Received: by mail-wm0-f65.google.com with SMTP id z13-v6so997401wma.5 for ; Tue, 26 Jun 2018 02:22:29 -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=zli9OPXToTCwTxHVHeLl0HZXVWIpoxlzZHDFGirmZxw=; b=ca/XOO6G31Et+xOwCvbmdclHba/ISE/w+hGyUIzppQVZBNoVWlm5OtGBuXjR949Hsh S0ye8ty+SqRo35BEE+HSasdBO4gM2+kYERF/qh4/UjxgrFCIp/WLtmD5HRjFkC/DBzJ9 8m6FNGSPgxsVR3upCmq/9kly72y+tj0fw0Fjg= 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=zli9OPXToTCwTxHVHeLl0HZXVWIpoxlzZHDFGirmZxw=; b=tJD4pqJmdAHj/SLQnUmZ5nkiAyfz1+yvOofMjk30A1y5ZCcqWYzDyW6Y9yp1THh7I5 QwDaHuWkwwYYEqCFeKHf7z8KWJ8ssttvRjvigFqQn7OgXdzd1sWgCGjhJL1BrhULLHpJ 9E64pxpE7Uyno0XaYmy0xmtmDZ/zIgrHaRfO8Gk1ggCMWC5B5QsV3cWkZAjRt4mE2D+A VyZF3ypnbOL8sopexpqJclFFIqWrG/JWKoNQ6QFMP3+a/aFbR1foc55sVhdOcP2c4RiN e3K/06iBlDgMYWOhE/1J9RyHpKLRFgUzF/1r5gEu0+LYiNArQFD6+ywQI5STWfMLZeig Wg7w== X-Gm-Message-State: APt69E0i8XQ8dBq9lJZATVaybvyaTyUZLCnw1zyVmwIv+wYcJGK7Qo7o lwwm9CYNgAq0qIPUjGSlaRHkzQ== X-Google-Smtp-Source: AAOMgpej43uQyJwhyDiQGoYLFHI173ZJ5BAYof79OOxzUo9dKNFFHJK55JHQ5h7Zv2uGVXbYiCsn7A== X-Received: by 2002:a1c:6b56:: with SMTP id g83-v6mr936231wmc.143.1530004948848; Tue, 26 Jun 2018 02:22:28 -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.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 26 Jun 2018 02:22:28 -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 05/12] ASoC: qdsp6: q6asm: use of_platform_populate/depopulate() Date: Tue, 26 Jun 2018 10:20:09 +0100 Message-Id: <20180626092016.9296-6-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/q6asm.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/sound/soc/qcom/qdsp6/q6asm.c b/sound/soc/qcom/qdsp6/q6asm.c index 530852385cad..c4fd28f168d5 100644 --- a/sound/soc/qcom/qdsp6/q6asm.c +++ b/sound/soc/qcom/qdsp6/q6asm.c @@ -177,7 +177,6 @@ struct q6asm { struct platform_device *pcmdev; spinlock_t slock; struct audio_client *session[MAX_SESSIONS + 1]; - struct platform_device *pdev_dais; }; struct audio_client { @@ -1344,7 +1343,6 @@ EXPORT_SYMBOL_GPL(q6asm_cmd_nowait); static int q6asm_probe(struct apr_device *adev) { struct device *dev = &adev->dev; - struct device_node *dais_np; struct q6asm *q6asm; q6asm = devm_kzalloc(dev, sizeof(*q6asm), GFP_KERNEL); @@ -1359,22 +1357,12 @@ static int q6asm_probe(struct apr_device *adev) spin_lock_init(&q6asm->slock); dev_set_drvdata(dev, q6asm); - dais_np = of_get_child_by_name(dev->of_node, "dais"); - if (dais_np) { - q6asm->pdev_dais = of_platform_device_create(dais_np, - "q6asm-dai", dev); - of_node_put(dais_np); - } - - return 0; + return of_platform_populate(dev->of_node, NULL, NULL, dev); } static int q6asm_remove(struct apr_device *adev) { - struct q6asm *q6asm = dev_get_drvdata(&adev->dev); - - if (q6asm->pdev_dais) - of_platform_device_destroy(&q6asm->pdev_dais->dev, NULL); + of_platform_depopulate(&adev->dev); return 0; }