lkml.org 
[lkml]   [2013]   [Mar]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: FW: Regulator API ignored return values
Date
On Tuesday 12 March 2013, Kevin Liu wrote:
> > - regulator_enable(host->vqmmc);
> > + ret = regulator_enable(host->vqmmc);
> > if (!regulator_is_supported_voltage(host->vqmmc, 1700000,
> > 1950000))
> > caps[1] &= ~(SDHCI_SUPPORT_SDR104 |
> > SDHCI_SUPPORT_SDR50 |
> > SDHCI_SUPPORT_DDR50);
> > + if (ret) {
> > + pr_warn("%s: Failed to enable vqmmc regulator: %d\n",
> > + mmc_hostname(mmc), ret);
>
> Need add regulator_put here since regulator_get has succeed?

Hmm, we still don't actually bail out if the error is encountered, so
the reference count is balanced with the current patch, but I maybe
a failed regulator_enable() should actually be a fatal error?

If we do that, using devm_regulator_get() would be a nice way to
track the reference counts.

Arnd


\
 
 \ /
  Last update: 2013-03-12 16:01    [W:0.059 / U:0.432 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site