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: 10488439 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 81028602B3 for ; Tue, 26 Jun 2018 09:26:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7DEE528868 for ; Tue, 26 Jun 2018 09:26:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7279228871; Tue, 26 Jun 2018 09:26:12 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E95B228868 for ; Tue, 26 Jun 2018 09:26:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=sa28+E/jkbqc44eayMAeDLHe1CvFfbfrYqoxPD/p9/o=; b=SueCS0mSlQEQ/J3vzrTIGuDsrU wkwI+WE7Iem/cDCO418HfbuSRG7QSflbGdCXBbCK067ykWPeKG2UBcZ02rlkpwAegidwQiHbpq1EB +U/qTcEfL1QZdBhdL5ArMfitXwBBqqpEcOrgpsNg0Rgi1nlFm0O4AVPzMC34LF//N1NtwJKAY3Xbz gHumTGgqcIYgRx3dAd8gFxYIeD18wuGR/P6z8V40+hMsDm1Gpeo54J67YZhoEXi2hee6V4i1MTrNP xJCDC0GbTV6A5p/u/XZRlbmwDkn/9oP/sGtYkIJxYi5zHI29aNhH7QbhKX+6e4wGQ3s75vgReAyWN bRO7l9tA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fXkEZ-0003Z5-G9; Tue, 26 Jun 2018 09:25:59 +0000 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fXkBM-0000VZ-HU for linux-arm-kernel@lists.infradead.org; Tue, 26 Jun 2018 09:22:47 +0000 Received: by mail-wm0-x244.google.com with SMTP id z137-v6so1015663wmc.0 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=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=rkRHwumgzUpxdGjlqB6LGV30eGkX4fYI0qW1zdcLLR4uqzXK9ULXNR9WN+YScMqI3r gIGPWGXb3b3gpkeyc73JSgXdLYOs8j60ySHNduOJ3RcKikqh9USVDK3S+Du96UDW9YBs ieOPz0B5cqOzAOXPLlAvlrMRms+edpfyUyT7izKw5o5D0FrNrcDKc8xerB2eRDttdVHL wv48M9c1l4jax7b8doKTBgznntusW9ID8ffEIXiWzDaw5+/nFQa7eSEFlr9/DYqU4FrW 5smRcyyiLNYTa3/SuEkyWszk2mZP/FEi9zGBqc3/4IRd3vheCF96pPih7kKzEjBhznwj xeSw== X-Gm-Message-State: APt69E0210m0CbJtoMn0+Hf7aXzM5jmcHyKyr2AMFpWKYlCvcwg36Grb vJ1GEkoBx9+pn8gmuS/bbdClB/dISFE= 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180626_022240_604542_FDB2D243 X-CRM114-Status: GOOD ( 13.48 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, bgoswami@codeaurora.org, lgirdwood@gmail.com, linux-arm-msm@vger.kernel.org, tiwai@suse.com, perex@perex.cz, Srinivas Kandagatla , linux-arm-kernel@lists.infradead.org, niklas.cassel@linaro.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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; }