lkml.org 
[lkml]   [2014]   [Apr]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] sdhci: Forward EPROBE_DEFER on vmmc and vqmmc regulators
On 07/04/14 13:09, Mike Looijmans wrote:
> On 04/07/2014 10:11 AM, Arnd Bergmann wrote:
>> On Monday 07 April 2014 08:38:28 Mike Looijmans wrote:
>>> index 34aef81..43b90c1 100644
>>> --- a/drivers/mmc/host/sdhci.c
>>> +++ b/drivers/mmc/host/sdhci.c
>>> @@ -2972,6 +2972,8 @@ int sdhci_add_host(struct sdhci_host *host)
>>> host->vqmmc = regulator_get_optional(mmc_dev(mmc), "vqmmc");
>>> if (IS_ERR_OR_NULL(host->vqmmc)) {
>>> if (PTR_ERR(host->vqmmc) < 0) {
>>> + if (PTR_ERR(host->vqmmc) == -EPROBE_DEFER)
>>> + return -EPROBE_DEFER;
>>> pr_info("%s: no vqmmc regulator found\n",
>>> mmc_hostname(mmc));
>>> host->vqmmc = NULL;
>>> @@ -3048,8 +3050,10 @@ int sdhci_add_host(struct sdhci_host *host)
>>> host->vmmc = regulator_get_optional(mmc_dev(mmc), "vmmc");
>>> if (IS_ERR_OR_NULL(host->vmmc)) {
>>> if (PTR_ERR(host->vmmc) < 0) {
>>> - pr_info("%s: no vmmc regulator found\n",
>>> - mmc_hostname(mmc));
>>> + if (PTR_ERR(host->vmmc) == -EPROBE_DEFER)
>>> + return -EPROBE_DEFER;
>>> + pr_info("%s: no vmmc regulator found (%d)\n",
>>> + mmc_hostname(mmc), PTR_ERR(host->vmmc));
>>> host->vmmc = NULL;
>>> }
>>
>> Please change the code to not use IS_ERR_OR_NULL() instead, getting
>> a NULL return value from regulator_get_optional() should not be
>> considered a bug, while getting an error return should always
>> cause the probe function to fail.

Surely it needs to be changed to IS_ERR(), nor IS_ERR_OR_NULL()?


--
Ben Dooks http://www.codethink.co.uk/
Senior Engineer Codethink - Providing Genius


\
 
 \ /
  Last update: 2014-04-07 15:21    [W:2.241 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site