From patchwork Mon Jun 25 14:31: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: 10486451 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 10FDD6023A for ; Mon, 25 Jun 2018 14:36:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB3B82847B for ; Mon, 25 Jun 2018 14:36:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF1D4285A8; Mon, 25 Jun 2018 14:36:44 +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 806122847B for ; Mon, 25 Jun 2018 14:36:44 +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=BsSbgu/SEaaIfcYUkO/t6oQ95JxzEgCUG9Mu6jIQbxs=; b=Mp+dBgmmtfcJ8toTTkRoG0Fd1K g+aYn54iyDfMBlk0lzVEuk3ZVfL9SaHRkBKnxmxw0aJ7kfxAVaZW5zBWgDAmotKjw7Z7kXktZP+1N WEQG25B2nYYbjHq7/faa/sBWZTha4dlKeGM8sCoUG+03fvfp8MyQeVoQi/OWMtFN1LOhYoAUAmSCP oMjwF1C+1i0BEKKLo7K42zjSqPqKu4o5OYZ1XfQh/66X8XVYG6V7eCQMOYT+7GWovpJZLvMfTBSrM SfLKWrLLUS+VcqSuKhw1aFfIfTIdEBLYqXcof7ywssJWhN30eTRKmwurUB2tVeyhpvuRjFpX6QJaj QdLpuVuA==; 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 1fXSbe-00070F-VI; Mon, 25 Jun 2018 14:36:38 +0000 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fXSZ9-0003Q9-OS for linux-arm-kernel@lists.infradead.org; Mon, 25 Jun 2018 14:34:05 +0000 Received: by mail-wr0-x241.google.com with SMTP id s7-v6so4708717wro.12 for ; Mon, 25 Jun 2018 07:33:53 -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=zeigN2rFjXHvJK3Jeu+ik7aelP61Hx9dVViaQbsLrsc=; b=Ia5uQDyeALxs5UPR7IAZtB05R5zd3VtuNqEsPIyPr3sRtbrPKcmNmZlVf8duq5Krfh a4Rp5EiJXaeMdx0/QAPqPdqBA2EPq1D1k3lux5OJa6wMjax+0drGA6lA8CQJtlqp2eQN OgJkIGumnxzMTg/Q8Lp0Sf7u1sN50zqD7ml6s= 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=zeigN2rFjXHvJK3Jeu+ik7aelP61Hx9dVViaQbsLrsc=; b=UigVMvMFbYrv+T5XwM9c04ECLUGaxf1JPNP8Vs1uxiQ1fScsS6nqLLwWQgJJbf9YI4 S552hArL2B65HQpnIg/DqnZy4Z/UYoEiGayBjlQoHbGRuHxuBH7v2mExBEHb/RHdZaLS l5YEF2hUURUKO3vZSCHlMoMH1wKqT0wJSzM5r9tmmLGZLMBGvoD1ai40ucgy7+tVY/ny HrhivFLcZu6Hf2wHLh+95LaYFfk4ScK6z+YEoXniFtAwPbl97sRAvCKQ+MfJ910XwRrO h2Z6iAK/WIP9tWNjDvWDK16Wdo3OcoMYhCY+3ex91aDMIUbxwR6qkxa6wlDcOHKvs+a6 PZQw== X-Gm-Message-State: APt69E2xrivCzCGAIhBF2wipKt1RGBS6hKjppTbIA3T8A5lyusL2/QJW 57y+D6Ey4zMtkFNknv0Kwnz3pw== X-Google-Smtp-Source: AAOMgpekcKafnAQ6gr+gZrDMOIzilfcPlcrn7OXdQfmR5eFOUk9E6/MfNgsuuWkDG3PdSmwY6aO/qA== X-Received: by 2002:a5d:44ca:: with SMTP id z10-v6mr10803329wrr.210.1529937231990; Mon, 25 Jun 2018 07:33:51 -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 s12-v6sm1321193wrr.43.2018.06.25.07.33.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 25 Jun 2018 07:33:51 -0700 (PDT) From: Srinivas Kandagatla To: broonie@kernel.org, linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, robh+dt@kernel.org, bgoswami@codeaurora.org Subject: [PATCH 05/11] ASoC: qdsp6: q6asm: use of_platform_populate/depopulate() Date: Mon, 25 Jun 2018 15:31:09 +0100 Message-Id: <20180625143115.8346-6-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180625143115.8346-1-srinivas.kandagatla@linaro.org> References: <20180625143115.8346-1-srinivas.kandagatla@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180625_073403_813985_5AE16489 X-CRM114-Status: GOOD ( 13.18 ) 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: rohkumar@qti.qualcomm.com, devicetree@vger.kernel.org, plai@codeaurora.org, tiwai@suse.com, lgirdwood@gmail.com, perex@perex.cz, srinivas.kandagatla@linaro.org, niklas.cassel@linaro.org, linux-arm-kernel@lists.infradead.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 --- sound/soc/qcom/qdsp6/q6asm.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/sound/soc/qcom/qdsp6/q6asm.c b/sound/soc/qcom/qdsp6/q6asm.c index 530852385cad..2b2c7233bb5f 100644 --- a/sound/soc/qcom/qdsp6/q6asm.c +++ b/sound/soc/qcom/qdsp6/q6asm.c @@ -174,10 +174,8 @@ struct q6asm { struct device *dev; struct q6core_svc_api_info ainfo; wait_queue_head_t mem_wait; - struct platform_device *pcmdev; spinlock_t slock; struct audio_client *session[MAX_SESSIONS + 1]; - struct platform_device *pdev_dais; }; struct audio_client { @@ -1344,7 +1342,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 +1356,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; }