[PATCH v4 1/6] of: dynamic: Add of_changeset_update_prop_string

Andy Shevchenko andriy.shevchenko at linux.intel.com
Tue Aug 13 04:11:30 PDT 2024


On Thu, Aug 08, 2024 at 05:59:24PM +0800, Chen-Yu Tsai wrote:
> Add a helper function to add string property updates to an OF changeset.
> This is similar to of_changeset_add_prop_string(), but instead of adding
> the property (and failing if it exists), it will update the property.
> 
> This shall be used later in the DT hardware prober.

...

> +int of_changeset_update_prop_string(struct of_changeset *ocs,
> +				    struct device_node *np,
> +				    const char *prop_name, const char *str)
> +{
> +	struct property prop;
> +
> +	prop.name = (char *)prop_name;
> +	prop.length = strlen(str) + 1;
> +	prop.value = (void *)str;

Is it the existing style in the file? Otherwise I often see style like this

	struct property prop = {
		.name = (char *)prop_name;
		.length = strlen(str) + 1;
		.value = (void *)str;
	};

in the kernel (IRQ domain, platform core, ...).

> +	return of_changeset_update_prop_helper(ocs, np, &prop);
> +}

-- 
With Best Regards,
Andy Shevchenko





More information about the Linux-mediatek mailing list