All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Akshu Agrawal <akshu.agrawal@amd.com>
Cc: "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER
	MANAGEM..." <alsa-devel@alsa-project.org>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	open list <linux-kernel@vger.kernel.org>,
	Takashi Iwai <tiwai@suse.com>,
	djkurtz@chromium.org, Liam Girdwood <lgirdwood@gmail.com>,
	Wei Yongjun <weiyongjun1@huawei.com>,
	"Mukunda, Vijendar" <Vijendar.Mukunda@amd.com>,
	Alexander.Deucher@amd.com, Dylan Reid <dgreid@chromium.org>
Subject: Re: [PATCH] ASoC: AMD: Add a fix voltage regulator for DA7219 and ADAU7002
Date: Fri, 20 Jul 2018 13:18:16 +0100	[thread overview]
Message-ID: <20180720121816.GD10784@sirena.org.uk> (raw)
In-Reply-To: <1532068715-2992-1-git-send-email-akshu.agrawal@amd.com>


[-- Attachment #1.1: Type: text/plain, Size: 680 bytes --]

On Fri, Jul 20, 2018 at 02:38:11PM +0800, Akshu Agrawal wrote:

>  static int cz_probe(struct platform_device *pdev)
>  {
>  	int ret;
>  	struct snd_soc_card *card;
>  	struct acp_platform_info *machine;
> +	static bool regulators_registered;
> +
> +	if (!regulators_registered) {
> +		ret = platform_device_register(&acp_da7219_regulator);
> +		if (ret) {
> +			dev_err(&pdev->dev, "Failed to register regulator: %d\n",
> +				ret);
> +			return ret;
> +		}
> +		regulators_registered = true;
> +	}

You should be unregistering the regulator in your remove function, not
doing this hack here.  I'd also expect to see the card made the parent
of the device that gets registered.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



WARNING: multiple messages have this Message-ID (diff)
From: Mark Brown <broonie@kernel.org>
To: Akshu Agrawal <akshu.agrawal@amd.com>
Cc: djkurtz@chromium.org, Alexander.Deucher@amd.com,
	Liam Girdwood <lgirdwood@gmail.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Dylan Reid <dgreid@chromium.org>,
	"Mukunda, Vijendar" <Vijendar.Mukunda@amd.com>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	Wei Yongjun <weiyongjun1@huawei.com>,
	"moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER
	MANAGEM..."  <alsa-devel@alsa-project.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ASoC: AMD: Add a fix voltage regulator for DA7219 and ADAU7002
Date: Fri, 20 Jul 2018 13:18:16 +0100	[thread overview]
Message-ID: <20180720121816.GD10784@sirena.org.uk> (raw)
In-Reply-To: <1532068715-2992-1-git-send-email-akshu.agrawal@amd.com>

[-- Attachment #1: Type: text/plain, Size: 680 bytes --]

On Fri, Jul 20, 2018 at 02:38:11PM +0800, Akshu Agrawal wrote:

>  static int cz_probe(struct platform_device *pdev)
>  {
>  	int ret;
>  	struct snd_soc_card *card;
>  	struct acp_platform_info *machine;
> +	static bool regulators_registered;
> +
> +	if (!regulators_registered) {
> +		ret = platform_device_register(&acp_da7219_regulator);
> +		if (ret) {
> +			dev_err(&pdev->dev, "Failed to register regulator: %d\n",
> +				ret);
> +			return ret;
> +		}
> +		regulators_registered = true;
> +	}

You should be unregistering the regulator in your remove function, not
doing this hack here.  I'd also expect to see the card made the parent
of the device that gets registered.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2018-07-20 12:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-20  6:38 [PATCH] ASoC: AMD: Add a fix voltage regulator for DA7219 and ADAU7002 Akshu Agrawal
2018-07-20  6:38 ` Akshu Agrawal
2018-07-20 12:18 ` Mark Brown [this message]
2018-07-20 12:18   ` Mark Brown
2018-07-23  5:26   ` Agrawal, Akshu
2018-07-23  5:26     ` Agrawal, Akshu
2018-07-24 17:14     ` Mark Brown
2018-07-24 17:14       ` Mark Brown
2018-07-25  9:00       ` Agrawal, Akshu
2018-07-25  9:00         ` Agrawal, Akshu

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=20180720121816.GD10784@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=Alexander.Deucher@amd.com \
    --cc=Vijendar.Mukunda@amd.com \
    --cc=akshu.agrawal@amd.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=dgreid@chromium.org \
    --cc=djkurtz@chromium.org \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tiwai@suse.com \
    --cc=weiyongjun1@huawei.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.