Re: [PATCH v6 2/3] drm: Add support for the LogiCVC display controller

From: Emil Velikov
Date: Mon May 04 2020 - 09:31:15 EST


Hi Paul,

Just had a casual quick look for custom KMS properties, since new
drivers made that mistake in the past.
Thanks for not including any o/

I made a couple of trivial suggestions - if you agree, feel free to
keep them as follow-up patches.

On Thu, 30 Apr 2020 at 20:28, Paul Kocialkowski
<paul.kocialkowski@xxxxxxxxxxx> wrote:

> +int logicvc_of_property_parse_u32(struct device_node *of_node,
> + const char *name, u32 *target)
> +{
> + struct logicvc_of_property *property;
> + const char *string;
> + u32 value;
> + int ret;
> +
> + property = logicvc_of_property_lookup(name);
> + if (!property)
> + return -EINVAL;
> +
One could have the logicvc_of_properties[] entries indexed with the
logicvc_of_property_parse_{u32,bool} caller, using that instead of the
name string.

Aside: I suspect the array (as most other arrays in this patch) should
be annotated const, correct?


> + if (property->range[0] || property->range[1])
> + if (value < property->range[0] || value > property->range[1])
Combine the two ifs?

-Emil