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: 139920 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp5006118lji; Tue, 26 Jun 2018 02:22:43 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKuxqZ5ZKJdnFvEP5cTJ40dC8HjpsmW+NGOGgLyLP2NPBi3msrShgTV2dQwC0oBGz/1Gf2c X-Received: by 2002:a63:980a:: with SMTP id q10-v6mr672854pgd.50.1530004963549; Tue, 26 Jun 2018 02:22:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530004963; cv=none; d=google.com; s=arc-20160816; b=yzGiXBSSsDhjdfoeWD/phJhMYGwf7CjRL5Jl7BaM0vpYjOfXWtWf72rtd9hqtK6JKw X17bFF0pay80Q10IglJwIpwO9tRts9nmsukPNAi3Sv/IGh3GxPJvzsPlDng1ZtO7J7cq RQCI+tPBqluk9DKTssGYf6M4YA1GJcJluxilP4uPH5Zt/IfUcP9qpbNQJG5haJPUDzA+ 2yRyXKbSzLrOvPz9UPPvIzKjGN6FY3Edg+g95CrJ5FtqeACZGd/0TRh4KfwsR9hjePXd tzL2aUNue89lE0zAd2v5/pfT3mlclaGyNfIMUmM2dsh0ReWvnfaqc1djucM45nEtB2e1 80uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=zli9OPXToTCwTxHVHeLl0HZXVWIpoxlzZHDFGirmZxw=; b=BkZ3wo3dVKdsJ+qQj7CEI+zwG2P5RwoK6LyL1Q0Y8XxjJlsjnkjKt+Tag9yQoTCSAy 4duSkngRfdbkOTmrmmeA6CqXbyRe+vMQLagqMCM2pBykwfUffiHi8hzp+HvtTMwvHkyJ 22nFPeDwKNj9kK9AQ/HYBR0jsRlRYNRA3B4Nfiu8MY8z154c21cH0sjtkZmMNCRthGr4 zpmIk3jLKj5EO7XTtBMEOEbMaqhYmBshGWQPDl/nQ93J61jFeneNQtg4ll/GUEbibJS8 do8jFTFHlEYiN0Y277ylX2+ZtUK5EHOmXKNeGOwEsYDEH2V71uPXI4InrncHu4UWn30/ UqWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="ca/XOO6G"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e7-v6si1199851plk.397.2018.06.26.02.22.43; Tue, 26 Jun 2018 02:22:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="ca/XOO6G"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934010AbeFZJWl (ORCPT + 31 others); Tue, 26 Jun 2018 05:22:41 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:38365 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933780AbeFZJWa (ORCPT ); Tue, 26 Jun 2018 05:22:30 -0400 Received: by mail-wm0-f65.google.com with SMTP id 69-v6so993975wmf.3 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=klTn8JrpohEOc2ZIWq8M5Kacx3FGHNyUCh5xCYqP23NYBnTqCepBM/XTT4rPr5mB8K QmPCA8Em7n6hruOTmjGLTs86svfO0hVXegfhLDAIdn8NM+Vxt6UauIsSecOswORPkhtO Ld6BNVXzUvtP+bwcS4ls+2DwMZ8Wsol1fFXSB+cXmWOYASCEjwvx/mSNXMDUzO7aSeG7 E+EMo/LwQGt1u6NffIabVmadMN4cqBz+nSO+64OZ0ayj4WlGMLW2n2/2EG4mDnV0HJEy 1bA+2ByUxftW8QSa0hF0Qd+XkoHHiUKhmwpBwXt1+1CCp/XSYhlGjy+bmWDzFid51rbn EUTg== X-Gm-Message-State: APt69E1yJe0d07zh0kzFSCXFIqhKm+m451M8I1+ikDO5kuukKqlgLKak rRLJZ9bifJDPb8fnsMtjKPDtfg== 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) -- 2.16.2 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; }