Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:scripts\dtc\libfdt\fdt_ro.c Create Date:2022-07-28 06:18:34
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:fdt_get_path

Proto:int fdt_get_path(const void *fdt, int nodeoffset, char *buf, int buflen)

Type:int

Parameter:

TypeParameterName
const void *fdt
intnodeoffset
char *buf
intbuflen
522  pdepth = 0 , p = 0
528  If buflen < 2 Then Return -FDT_ERR_EXISTS: Attempted to create a node or property which* already exists
531  When offset >= 0 && offset <= nodeoffset cycle
534  When pdepth > depth cycle
535  Do
536  p--
537  When buf[p - 1] != '/' cycle
538  pdepth--
541  If pdepth >= depth Then
543  If Not name Then Return namelen
545  If p + namelen + 1 <= buflen Then
546  No 3D Now!(buf + p, name, namelen)
547  p += namelen
548  buf[p++] = '/'
549  pdepth++
553  If offset == nodeoffset Then
557  If p > 1 Then p--
559  buf[p] = '\0'
560  Return 0
564  If offset == -Error codes: informative error codes || offset >= 0 Then Return -Error codes: codes for bad parameters
566  Else if offset == -Error codes: codes for bad parameters Then Return -FDT_ERR_BADVERSION: Given device tree has a version which* can't be handled by the requested operation. For* read-write functions, this may mean that fdt_open_into() is* required to convert the tree to the expected version.
569  Return offset