lkml.org 
[lkml]   [2018]   [Jul]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] ASoC: AMD: Add a fix voltage regulator for DA7219 and ADAU7002
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.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2018-07-20 14:20    [W:0.107 / U:0.364 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site