Re: sdhci vccq regulator support drops UHS-I flags

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Oct 30, 2012 at 3:07 PM, Philip Rakity <prakity@xxxxxxxxxx> wrote:
> The intent is if there is no regulator should hit this if statement.
>
> +       if (IS_ERR(host->vqmmc)) {
> +               pr_info("%s: no vqmmc regulator found\n", mmc_hostname(mmc));
> +               host->vqmmc = NULL;

There's a bug here then.
When there is no regulator, host->vqmmc is NULL.
NULL is not an error recognised by IS_ERR.

Double checked this with a simple test:

#include <stdio.h>

#define MAX_ERRNO       4095
#define IS_ERR_VALUE(x) ((x) >= (unsigned long)-MAX_ERRNO)

static inline long IS_ERR(const void *ptr)
{
return IS_ERR_VALUE((unsigned long)ptr);
}

int main(void)
{
if (IS_ERR(NULL))
printf("NULL is error\n");
else
printf("NULL is not error\n");
}



result: NULL is not error
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux