scripts: generalize kobject -> enum naming

This was done inconsistently in a few place, centralize it.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2018-05-23 10:57:39 -07:00 committed by Andrew Boie
commit f20efcfbe7
2 changed files with 12 additions and 21 deletions

View file

@ -25,8 +25,13 @@ def subsystem_to_enum(subsys):
return "K_OBJ_DRIVER_" + subsys[:-11].upper()
def kobject_to_enum(ko):
return "K_OBJ_" + ko[2:].upper()
def kobject_to_enum(kobj):
if kobj.startswith("k_") or kobj.startswith("_k_"):
name = kobj[2:]
else:
name = kobj
return "K_OBJ_%s" % name.upper()
DW_OP_addr = 0x3