lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 26 Nov 2013 11:59:33 +0100
From:	Lothar Waßmann <LW@...O-electronics.de>
To:	Xiubo Li <Li.Xiubo@...escale.com>
Cc:	<lgirdwood@...il.com>, <broonie@...nel.org>, <perex@...ex.cz>,
	<tiwai@...e.de>, <fabio.estevam@...escale.com>, <oskar@...ra.com>,
	<alsa-devel@...a-project.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCHv1] ASoC: SGTL5000: Fix kernel failed while getting
 regulator consumers

Hi,

Xiubo Li wrote:
> SGTL5000 codec allows to use the internal LDO instead of VDDD, if the
> internal LDO is used, this caused the following kernel failed while trying
> to get the external VDDD regulator consumer.
> 
> Adding sgtl5000_external_vddd_used() to fix it. And this has been tested on
> VF610-TWR board.
> 
> sgtl5000 0-000a: Failed to get supply 'VDDD': -19
> 
> Signed-off-by: Xiubo Li <Li.Xiubo@...escale.com>
> ---
> 
>  sound/soc/codecs/sgtl5000.c | 18 +++++++++++++++---
>  1 file changed, 15 insertions(+), 3 deletions(-)
> 
> diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c
> index 1f4093f..1a2d35a 100644
> --- a/sound/soc/codecs/sgtl5000.c
> +++ b/sound/soc/codecs/sgtl5000.c
> @@ -1298,6 +1298,20 @@ static int sgtl5000_replace_vddd_with_ldo(struct snd_soc_codec *codec)
>  	return 0;
>  }
>  
> +static int sgtl5000_external_vddd_used(struct snd_soc_codec *codec)
> +{
> +	struct regulator *consumer;
> +	struct sgtl5000_priv *sgtl5000 = snd_soc_codec_get_drvdata(codec);
> +
> +	consumer = regulator_get(codec->dev, sgtl5000->supplies[VDDD].supply);
> +	if (IS_ERR(consumer)) {
> +		return 0;
> +	}
> +	regulator_put(consumer);
> +
> +	return 1;
> +}
> +
>  static int sgtl5000_enable_regulators(struct snd_soc_codec *codec)
>  {
>  	int reg;
> @@ -1310,9 +1324,7 @@ static int sgtl5000_enable_regulators(struct snd_soc_codec *codec)
>  	for (i = 0; i < ARRAY_SIZE(sgtl5000->supplies); i++)
>  		sgtl5000->supplies[i].supply = supply_names[i];
>  
> -	ret = regulator_bulk_get(codec->dev, ARRAY_SIZE(sgtl5000->supplies),
> -				sgtl5000->supplies);
> -	if (!ret)
> +	if (sgtl5000_external_vddd_used(codec))
>  		external_vddd = 1;
>  	else {
>  		ret = sgtl5000_replace_vddd_with_ldo(codec);
>
You could fix the coding style issue (braces on both branches
of the if clause) here too.


Lothar Waßmann
-- 
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info@...o-electronics.de
___________________________________________________________
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ