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] [day] [month] [year] [list]
Date:   Fri, 6 Nov 2020 12:26:33 +0000
From:   Mark Brown <broonie@...nel.org>
To:     Shane Chien <shane.chien@...iatek.com>
Cc:     Matthias Brugger <matthias.bgg@...il.com>,
        linux-kernel@...r.kernel.org, linux-mediatek@...ts.infradead.org,
        devicetree@...r.kernel.org, wsd_upstream@...iatek.com,
        jiaxin.yu@...iatek.com, chipeng.chang@...iatek.com
Subject: Re: [PATCH] ASoC: Fix vaud18 power leakage of mt6359

On Fri, Nov 06, 2020 at 02:18:37PM +0800, Shane Chien wrote:

> +static int mt_vaud18_event(struct snd_soc_dapm_widget *w,
> +			   struct snd_kcontrol *kcontrol,
> +			   int event)
> +{
> +	struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm);
> +	struct mt6359_priv *priv = snd_soc_component_get_drvdata(cmpnt);
> +	int ret = 0;
> +
> +	switch (event) {
> +	case SND_SOC_DAPM_PRE_PMU:
> +		ret = regulator_enable(priv->avdd_reg);
> +		if (ret)
> +			dev_err(priv->dev, "regulator_enable err: %d\n", ret);
> +		break;
> +	case SND_SOC_DAPM_POST_PMD:
> +		ret = regulator_disable(priv->avdd_reg);
> +		if (ret)
> +			dev_err(priv->dev, "regulator_disable err: %d\n", ret);
> +		break;

This is just a SND_SOC_DAPM_REGULATOR_SUPPLY widget as far as I can see
- why not use one of those rather than open coding?

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ