Re: [PATCH v5 2/2] leds: lm3601x: Introduce the lm3601x LED driver

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

 



Jacek

On 05/11/2018 06:56 AM, Dan Murphy wrote:
<snip>

>>> +    }
>>> +
>>> +    if (led->strobe_node) {
>>> +        ret = of_property_read_string(led->strobe_node, "label", &name);
>>> +        if (!ret)
>>> +            snprintf(led->strobe, sizeof(led->strobe),
>>> +                "%s:%s", led->strobe_node->name, name);
>>> +        else
>>> +            snprintf(led->strobe, sizeof(led->strobe),
>>> +                "%s::strobe", led->strobe_node->name);
>>> +
>>> +        ret = of_property_read_u32(led->strobe_node,
>>> +                    "flash-max-microamp",
>>> +                    &led->strobe_current_max);
>>> +        if (ret < 0) {
>>> +            led->strobe_current_max = LM3601X_MIN_STROBE_I_MA;
>>> +            dev_warn(&led->client->dev,
>>> +                 "flash-max-microamp DT property missing\n");
>>> +        }
>>> +
>>> +        ret = of_property_read_u32(led->strobe_node,
>>> +                    "flash-max-timeout-us",
>>> +                    &led->max_strobe_timeout);
>>> +        if (ret < 0) {
>>> +            led->max_strobe_timeout = strobe_timeouts[0].reg_val;
>>> +            dev_warn(&led->client->dev,
>>> +                 "flash-max-timeout-us DT property missing\n");
>>> +        }
>>
>> Common LED bindings state that flash-max-microamp and
>> flash-max-timeout-us properties are mandatory.
> 
> OK.

OK I looked at the max776973 driver and well if the flash-max-microamp and
flash-max-timeout-us nodes are missing it sets a default value for each if the
node is not present.

So should we remove this code from the Max77693 driver too and fail probe as being asked
in this driver?

Dan

> 
>>
>>> +
>>> +        lm3601x_init_flash_timeout(led);

<snip>

>>>
>>
> 
> 


-- 
------------------
Dan Murphy



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux