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: 10486407 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 85A4F6023A for ; Mon, 25 Jun 2018 14:33:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6C356285BD for ; Mon, 25 Jun 2018 14:33:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 609CF285C3; Mon, 25 Jun 2018 14:33:57 +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 EC68D285BD for ; Mon, 25 Jun 2018 14:33:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934396AbeFYOdy (ORCPT ); Mon, 25 Jun 2018 10:33:54 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:46612 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934362AbeFYOdx (ORCPT ); Mon, 25 Jun 2018 10:33:53 -0400 Received: by mail-wr0-f193.google.com with SMTP id l14-v6so8866280wrq.13 for ; Mon, 25 Jun 2018 07:33:52 -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=h0M46+DYjKVlC9DQPJRc1YCGqd+dj4zNtJkv/YzYGpgdaz6t4JWDGV2R0tfRJRxDCd u4OErhH3bii7Y2iq0w72YECXVbO+Lp08A8t+Q1XDUYhQUnI8g1BPJd0GyP6d0UFA4aGQ hbRDn12mzT05YIM/sfegbkfCWOPWfwe4sYxbzPzwhYyF6Jfbc+Eb7asAVoNVMlDBU8DY BrdCHzKaK0AHIL+eQIgKitn8+X0s80TS47M4koJKTYZWfOUq6QGUIH1L3YdxrDjduUni R3p+Ovx/Ag9hZZ0pPJ1XOqhZupjFLaiAaeJwX0Lg/aJkEtLT6gBt835PuMmy+HpVdUOE aU5w== X-Gm-Message-State: APt69E1w6pYRLaNFM36ZbTa8b5bj1TWYa7iC5UOS3ur46FoQ+Kbjk0Sq 9INwY+WVhcDXMObQugdhi7ZQyg== 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 Cc: lgirdwood@gmail.com, plai@codeaurora.org, tiwai@suse.com, perex@perex.cz, devicetree@vger.kernel.org, rohkumar@qti.qualcomm.com, linux-arm-kernel@lists.infradead.org, srinivas.kandagatla@linaro.org, niklas.cassel@linaro.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> 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 --- 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; }