Thread (20 messages) 20 messages, 3 authors, 2024-08-21

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

From: Chen-Yu Tsai <wenst@chromium.org>
Date: 2024-08-14 04:27:01
Also in: chrome-platform, linux-arm-kernel, linux-i2c, linux-mediatek, lkml

On Wed, Aug 14, 2024 at 3:18 AM Rob Herring [off-list ref] wrote:
On Tue, Aug 13, 2024 at 02:11:30PM +0300, Andy Shevchenko wrote:
quoted
On Thu, Aug 08, 2024 at 05:59:24PM +0800, Chen-Yu Tsai wrote:
quoted
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.
...
quoted
+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
Yeah. This was mostly copy pasted.
quoted
      struct property prop = {
              .name = (char *)prop_name;
              .length = strlen(str) + 1;
              .value = (void *)str;
      };

in the kernel (IRQ domain, platform core, ...).
Okay with me to use this style regardless of existing style.
Ack. I'll update it to the more modern style.

ChenYu
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help