All of lore.kernel.org
 help / color / mirror / Atom feed
From: Niklas Cassel <niklas.cassel@linaro.org>
To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: rohkumar@qti.qualcomm.com, devicetree@vger.kernel.org,
	alsa-devel@alsa-project.org, bgoswami@codeaurora.org,
	linux-arm-msm@vger.kernel.org, plai@codeaurora.org,
	lgirdwood@gmail.com, robh+dt@kernel.org, tiwai@suse.com,
	broonie@kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 06/11] ASoC: qdsp6: q6afe: use of_platform_populate/depopulate()
Date: Mon, 25 Jun 2018 20:02:14 +0200	[thread overview]
Message-ID: <20180625180214.GE10876@centauri.lan> (raw)
In-Reply-To: <20180625143115.8346-7-srinivas.kandagatla@linaro.org>

Acked-by: Niklas Cassel <niklas.cassel@linaro.org>

On Mon, Jun 25, 2018 at 03:31:10PM +0100, Srinivas Kandagatla wrote:
> 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 <srinivas.kandagatla@linaro.org>
> ---
>  sound/soc/qcom/qdsp6/q6afe.c | 16 ++--------------
>  1 file changed, 2 insertions(+), 14 deletions(-)
> 
> diff --git a/sound/soc/qcom/qdsp6/q6afe.c b/sound/soc/qcom/qdsp6/q6afe.c
> index 01f43218984b..621b67b34db9 100644
> --- a/sound/soc/qcom/qdsp6/q6afe.c
> +++ b/sound/soc/qcom/qdsp6/q6afe.c
> @@ -316,7 +316,6 @@ struct q6afe {
>  	struct mutex lock;
>  	struct list_head port_list;
>  	spinlock_t port_list_lock;
> -	struct platform_device *pdev_dais;
>  };
>  
>  struct afe_port_cmd_device_start {
> @@ -1438,7 +1437,6 @@ static int q6afe_probe(struct apr_device *adev)
>  {
>  	struct q6afe *afe;
>  	struct device *dev = &adev->dev;
> -	struct device_node *dais_np;
>  
>  	afe = devm_kzalloc(dev, sizeof(*afe), GFP_KERNEL);
>  	if (!afe)
> @@ -1453,22 +1451,12 @@ static int q6afe_probe(struct apr_device *adev)
>  
>  	dev_set_drvdata(dev, afe);
>  
> -	dais_np = of_get_child_by_name(dev->of_node, "dais");
> -	if (dais_np) {
> -		afe->pdev_dais = of_platform_device_create(dais_np,
> -							   "q6afe-dai", dev);
> -		of_node_put(dais_np);
> -	}
> -
> -	return 0;
> +	return of_platform_populate(dev->of_node, NULL, NULL, dev);
>  }
>  
>  static int q6afe_remove(struct apr_device *adev)
>  {
> -	struct q6afe *afe = dev_get_drvdata(&adev->dev);
> -
> -	if (afe->pdev_dais)
> -		of_platform_device_destroy(&afe->pdev_dais->dev, NULL);
> +	of_platform_depopulate(&adev->dev);
>  
>  	return 0;
>  }
> -- 
> 2.16.2
> 

WARNING: multiple messages have this Message-ID (diff)
From: niklas.cassel@linaro.org (Niklas Cassel)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 06/11] ASoC: qdsp6: q6afe: use of_platform_populate/depopulate()
Date: Mon, 25 Jun 2018 20:02:14 +0200	[thread overview]
Message-ID: <20180625180214.GE10876@centauri.lan> (raw)
In-Reply-To: <20180625143115.8346-7-srinivas.kandagatla@linaro.org>

Acked-by: Niklas Cassel <niklas.cassel@linaro.org>

On Mon, Jun 25, 2018 at 03:31:10PM +0100, Srinivas Kandagatla wrote:
> 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 <srinivas.kandagatla@linaro.org>
> ---
>  sound/soc/qcom/qdsp6/q6afe.c | 16 ++--------------
>  1 file changed, 2 insertions(+), 14 deletions(-)
> 
> diff --git a/sound/soc/qcom/qdsp6/q6afe.c b/sound/soc/qcom/qdsp6/q6afe.c
> index 01f43218984b..621b67b34db9 100644
> --- a/sound/soc/qcom/qdsp6/q6afe.c
> +++ b/sound/soc/qcom/qdsp6/q6afe.c
> @@ -316,7 +316,6 @@ struct q6afe {
>  	struct mutex lock;
>  	struct list_head port_list;
>  	spinlock_t port_list_lock;
> -	struct platform_device *pdev_dais;
>  };
>  
>  struct afe_port_cmd_device_start {
> @@ -1438,7 +1437,6 @@ static int q6afe_probe(struct apr_device *adev)
>  {
>  	struct q6afe *afe;
>  	struct device *dev = &adev->dev;
> -	struct device_node *dais_np;
>  
>  	afe = devm_kzalloc(dev, sizeof(*afe), GFP_KERNEL);
>  	if (!afe)
> @@ -1453,22 +1451,12 @@ static int q6afe_probe(struct apr_device *adev)
>  
>  	dev_set_drvdata(dev, afe);
>  
> -	dais_np = of_get_child_by_name(dev->of_node, "dais");
> -	if (dais_np) {
> -		afe->pdev_dais = of_platform_device_create(dais_np,
> -							   "q6afe-dai", dev);
> -		of_node_put(dais_np);
> -	}
> -
> -	return 0;
> +	return of_platform_populate(dev->of_node, NULL, NULL, dev);
>  }
>  
>  static int q6afe_remove(struct apr_device *adev)
>  {
> -	struct q6afe *afe = dev_get_drvdata(&adev->dev);
> -
> -	if (afe->pdev_dais)
> -		of_platform_device_destroy(&afe->pdev_dais->dev, NULL);
> +	of_platform_depopulate(&adev->dev);
>  
>  	return 0;
>  }
> -- 
> 2.16.2
> 

  reply	other threads:[~2018-06-25 18:02 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-25 14:31 [PATCH 00/11] ASoC: qdsp6: Fix dt based module loading Srinivas Kandagatla
2018-06-25 14:31 ` Srinivas Kandagatla
2018-06-25 14:31 ` [PATCH 01/11] ASoC: q6adm: dt-bindings: add compatible string to routing Srinivas Kandagatla
2018-06-25 14:31   ` Srinivas Kandagatla
2018-06-25 17:59   ` Niklas Cassel
2018-06-25 17:59     ` Niklas Cassel
2018-06-26 15:11   ` Applied "ASoC: q6adm: dt-bindings: add compatible string to routing" to the asoc tree Mark Brown
2018-06-26 15:11     ` Mark Brown
2018-06-25 14:31 ` [PATCH 02/11] ASoC: q6asm: dt-bindings: add compatible string to dais Srinivas Kandagatla
2018-06-25 14:31   ` Srinivas Kandagatla
2018-06-25 18:00   ` Niklas Cassel
2018-06-25 18:00     ` Niklas Cassel
2018-06-26 15:11   ` Applied "ASoC: q6asm: dt-bindings: add compatible string to dais" to the asoc tree Mark Brown
2018-06-26 15:11     ` Mark Brown
2018-06-25 14:31 ` [PATCH 03/11] ASoC: q6afe: dt-bindings: add compatible string to dais Srinivas Kandagatla
2018-06-25 14:31   ` Srinivas Kandagatla
2018-06-25 18:01   ` Niklas Cassel
2018-06-25 18:01     ` Niklas Cassel
2018-06-26  8:53     ` Srinivas Kandagatla
2018-06-26  8:53       ` Srinivas Kandagatla
2018-06-25 14:31 ` [PATCH 04/11] ASoC: qdsp6: q6adm: use of_platform_populate/depopulate() Srinivas Kandagatla
2018-06-25 14:31   ` Srinivas Kandagatla
2018-06-25 18:03   ` Niklas Cassel
2018-06-25 18:03     ` Niklas Cassel
2018-06-26  8:56     ` Srinivas Kandagatla
2018-06-26  8:56       ` Srinivas Kandagatla
2018-06-25 14:31 ` [PATCH 05/11] ASoC: qdsp6: q6asm: " Srinivas Kandagatla
2018-06-25 14:31   ` Srinivas Kandagatla
2018-06-25 18:01   ` Niklas Cassel
2018-06-25 18:01     ` Niklas Cassel
2018-06-26  8:52     ` Srinivas Kandagatla
2018-06-26  8:52       ` Srinivas Kandagatla
2018-06-25 14:31 ` [PATCH 06/11] ASoC: qdsp6: q6afe: " Srinivas Kandagatla
2018-06-25 14:31   ` Srinivas Kandagatla
2018-06-25 18:02   ` Niklas Cassel [this message]
2018-06-25 18:02     ` Niklas Cassel
2018-06-26 15:11   ` Applied "ASoC: qdsp6: q6afe: use of_platform_populate/depopulate()" to the asoc tree Mark Brown
2018-06-26 15:11     ` Mark Brown
2018-06-25 14:31 ` [PATCH 07/11] ASoC: qdsp6: q6afe-dai: support dt based module loading Srinivas Kandagatla
2018-06-25 14:31   ` Srinivas Kandagatla
2018-06-25 18:03   ` Niklas Cassel
2018-06-25 18:03     ` Niklas Cassel
2018-06-26  8:56     ` Srinivas Kandagatla
2018-06-26  8:56       ` Srinivas Kandagatla
2018-06-25 14:31 ` [PATCH 08/11] ASoC: qdsp6: q6asm-dai: " Srinivas Kandagatla
2018-06-25 14:31   ` Srinivas Kandagatla
2018-06-25 14:31 ` [PATCH 09/11] ASoC: qdsp6: q6routing: " Srinivas Kandagatla
2018-06-25 14:31   ` Srinivas Kandagatla
2018-06-25 14:31 ` [PATCH 10/11] ASoC: qcom: apq8096: remove redundant owner assignment Srinivas Kandagatla
2018-06-25 14:31   ` Srinivas Kandagatla
2018-06-25 18:03   ` Niklas Cassel
2018-06-25 18:03     ` Niklas Cassel
2018-06-26 15:10   ` Applied "ASoC: qcom: apq8096: remove redundant owner assignment" to the asoc tree Mark Brown
2018-06-26 15:10     ` Mark Brown
2018-06-25 14:31 ` [PATCH 11/11] ASoC: qdsp6: q6routing: add proper error check Srinivas Kandagatla
2018-06-25 14:31   ` Srinivas Kandagatla
2018-06-25 18:04   ` Niklas Cassel
2018-06-25 18:04     ` Niklas Cassel
2018-06-26  8:53     ` Srinivas Kandagatla
2018-06-26  8:53       ` Srinivas Kandagatla
2018-06-26 15:10   ` Applied "ASoC: qdsp6: q6routing: add proper error check" to the asoc tree Mark Brown
2018-06-26 15:10     ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180625180214.GE10876@centauri.lan \
    --to=niklas.cassel@linaro.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=bgoswami@codeaurora.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=plai@codeaurora.org \
    --cc=robh+dt@kernel.org \
    --cc=rohkumar@qti.qualcomm.com \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.