[PATCH 1/1] regulator: gpio-regulator: fix crash when no states property in dt

Frank Li lznuaa at gmail.com
Sun Nov 11 20:56:47 EST 2012


2012/11/10 Mark Brown <broonie at opensource.wolfsonmicro.com>:
> On Fri, Nov 09, 2012 at 04:34:36PM +0800, Frank Li wrote:
>
>>       /* Fetch states. */
>>       prop = of_find_property(np, "states", NULL);
>> -     proplen = prop->length / sizeof(int);
>> +     proplen = prop ? prop->length / sizeof(int) : 0;
>
> Aren't states mandatory for this driver, in which case shouldn't the
> probe fail here?

I think No.  GPIO-Regulator can be used as just turn on/off power
domain and not adjust voltage or current.  So "states" is option.
"gpios" was already options.



More information about the linux-arm-kernel mailing list