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:
parent
4a2e50f6b0
commit
f20efcfbe7
2 changed files with 12 additions and 21 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue