scripts: dts: Match alpha numeric property values

For using alpha numeric property values in a devicetree node, we
need to match the values starts with a number. Current scenario will
return the value as a numeric literal if it starts with a number. This
will not work for a compatible like, "96b-ls-con" which is proposed in
issue #15598.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
This commit is contained in:
Manivannan Sadhasivam 2019-04-22 19:44:25 +05:30 committed by Kumar Gala
commit 7ac767b880

View file

@ -9,6 +9,7 @@
import sys
import pprint
import re
def read_until(line, fd, end):
out = [line]
@ -123,6 +124,9 @@ def parse_value(value):
return int(value, 16)
if value[0] == '0':
return int(value, 8)
# Match alpha numeric values
if re.match("\w", value):
return value
return int(value, 10)
return value