[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <7da12517180c0330d96cd0e3d48382191748a1a7.1698328110.git.geert+renesas@glider.be>
Date: Thu, 26 Oct 2023 15:55:31 +0200
From: Geert Uytterhoeven <geert+renesas@...der.be>
To: Rob Herring <robh+dt@...nel.org>,
Frank Rowand <frowand.list@...il.com>
Cc: devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
Geert Uytterhoeven <geert+renesas@...der.be>
Subject: [PATCH 1/2] scripts: dt_to_config: Fix nul-separated compatible values
When using dt_to_config on a DTB:
-------------- : /soc/adc@...59000 : renesas,r9a07g043-adc\0renesas,rzg2l-adc : no_driver : no_config : none
When using dt_to_config on a DTS:
+M------------ : /soc/adc@...59000 : renesas,r9a07g043-adc : no_driver : no_config : none
+Md-c--------- : /soc/adc@...59000 : renesas,rzg2l-adc : drivers/iio/adc/rzg2l_adc.c : CONFIG_RZG2L_ADC : none
As of commit 32b9c61307629ac7 ("Preserve datatype markers when emitting
dts format") in dtc v1.4.7, "dtc -O dts" no longer outputs compatible
properties containing multiple values as multiple strings. Instead, it
outputs single strings, where the individual values are internally
separated by an escaped nul character.
Fix this by translating nul-separated compatible values to the
traditional multi-string format before splitting them.
Fixes: f858927fd6ce394a ("scripts/dtc: Update to upstream version v1.4.7-14-gc86da84d30e4")
Signed-off-by: Geert Uytterhoeven <geert+renesas@...der.be>
---
scripts/dtc/dt_to_config | 1 +
1 file changed, 1 insertion(+)
diff --git a/scripts/dtc/dt_to_config b/scripts/dtc/dt_to_config
index 299d1c2b20d7785a..563362f363e8cec1 100755
--- a/scripts/dtc/dt_to_config
+++ b/scripts/dtc/dt_to_config
@@ -748,6 +748,7 @@ sub handle_compatible()
$pn_arg{node} = $node;
$pn_arg{node_enabled} = $node_enabled;
+ $compatible =~ s/\\0/", "/g;
my @compatibles = split('", "', $compatible);
$compatibles[0] =~ s/^"//;
--
2.34.1
Powered by blists - more mailing lists