All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jaehoon Chung <jh80.chung@samsung.com>
To: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Cc: linux-kernel@vger.kernel.org, Chris Ball <cjb@laptop.org>,
	linux-mmc@vger.kernel.org
Subject: Re: [PATCH] sdhci: put regulator if probe fails
Date: Sat, 13 Oct 2012 16:01:14 +0900	[thread overview]
Message-ID: <507911BA.3080204@samsung.com> (raw)
In-Reply-To: <1350089717-4050-1-git-send-email-cascardo@holoscopio.com>

On 10/13/2012 09:55 AM, Thadeu Lima de Souza Cascardo wrote:
> When using the dummy regulator, SDHCI may fail its probing because the
> regulator does not support any voltages.
> 
> When reloading the driver, you will get a warning about a duplicate
> sysfs link.
> 
> [72211.963386] 0000:03:00.0 supply vmmc not found, using dummy regulator
> [72211.963409] ------------[ cut here ]------------
> [72211.963420] WARNING: at fs/sysfs/dir.c:536 sysfs_add_one+0x99/0xad()
> [72211.963424] Hardware name:
> [72211.963429] sysfs: cannot create duplicate filename '/devices/platform/reg-dummy/regulator/regulator.0/0000:03:00.0-vmmc'
> 
> Avoid this by properly cleaning up when the probe fails calling
> regulator_put. Other fail paths get fixed as well.
> 
> Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
> ---
>  drivers/mmc/host/sdhci.c |    6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index 7922adb..dd6bc26 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -2992,7 +2992,8 @@ int sdhci_add_host(struct sdhci_host *host)
>  	if (mmc->ocr_avail == 0) {
>  		pr_err("%s: Hardware doesn't report any "
>  			"support voltages.\n", mmc_hostname(mmc));
> -		return -ENODEV;
> +		ret = -ENODEV;
> +		goto out_vmmc;
>  	}
>  
>  	spin_lock_init(&host->lock);
> @@ -3121,6 +3122,9 @@ reset:
>  untasklet:
>  	tasklet_kill(&host->card_tasklet);
>  	tasklet_kill(&host->finish_tasklet);
> +out_vmmc:
> +	if (host->vmmc)
> +		regulator_put(host->vmmc);
If fall down to untasklet, need not to disable regulator for vmmc?

Best Regards,
Jaehoon Chung
>  
>  	return ret;
>  }
> 


      reply	other threads:[~2012-10-13  7:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-13  0:55 [PATCH] sdhci: put regulator if probe fails Thadeu Lima de Souza Cascardo
2012-10-13  7:01 ` Jaehoon Chung [this message]

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=507911BA.3080204@samsung.com \
    --to=jh80.chung@samsung.com \
    --cc=cascardo@holoscopio.com \
    --cc=cjb@laptop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    /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.