@@ -40,37 +40,22 @@ static uint32_t overlay_get_target_phandle(const void *fdto, int fragment)
40
40
return fdt32_to_cpu (* val );
41
41
}
42
42
43
- /**
44
- * overlay_get_target - retrieves the offset of a fragment's target
45
- * @fdt: Base device tree blob
46
- * @fdto: Device tree overlay blob
47
- * @fragment: node offset of the fragment in the overlay
48
- * @pathp: pointer which receives the path of the target (or NULL)
49
- *
50
- * overlay_get_target() retrieves the target offset in the base
51
- * device tree of a fragment, no matter how the actual targeting is
52
- * done (through a phandle or a path)
53
- *
54
- * returns:
55
- * the targeted node offset in the base device tree
56
- * Negative error code on error
57
- */
58
- static int overlay_get_target (const void * fdt , const void * fdto ,
59
- int fragment , char const * * pathp )
43
+ int fdt_overlay_target_offset (const void * fdt , const void * fdto ,
44
+ int fragment_offset , char const * * pathp )
60
45
{
61
46
uint32_t phandle ;
62
47
const char * path = NULL ;
63
48
int path_len = 0 , ret ;
64
49
65
50
/* Try first to do a phandle based lookup */
66
- phandle = overlay_get_target_phandle (fdto , fragment );
51
+ phandle = overlay_get_target_phandle (fdto , fragment_offset );
67
52
if (phandle == (uint32_t )-1 )
68
53
return - FDT_ERR_BADPHANDLE ;
69
54
70
55
/* no phandle, try path */
71
56
if (!phandle ) {
72
57
/* And then a path based lookup */
73
- path = fdt_getprop (fdto , fragment , "target-path" , & path_len );
58
+ path = fdt_getprop (fdto , fragment_offset , "target-path" , & path_len );
74
59
if (path )
75
60
ret = fdt_path_offset (fdt , path );
76
61
else
@@ -636,7 +621,7 @@ static int overlay_merge(void *fdt, void *fdto)
636
621
if (overlay < 0 )
637
622
return overlay ;
638
623
639
- target = overlay_get_target (fdt , fdto , fragment , NULL );
624
+ target = fdt_overlay_target_offset (fdt , fdto , fragment , NULL );
640
625
if (target < 0 )
641
626
return target ;
642
627
@@ -779,7 +764,7 @@ static int overlay_symbol_update(void *fdt, void *fdto)
779
764
return - FDT_ERR_BADOVERLAY ;
780
765
781
766
/* get the target of the fragment */
782
- ret = overlay_get_target (fdt , fdto , fragment , & target_path );
767
+ ret = fdt_overlay_target_offset (fdt , fdto , fragment , & target_path );
783
768
if (ret < 0 )
784
769
return ret ;
785
770
target = ret ;
@@ -801,7 +786,7 @@ static int overlay_symbol_update(void *fdt, void *fdto)
801
786
802
787
if (!target_path ) {
803
788
/* again in case setprop_placeholder changed it */
804
- ret = overlay_get_target (fdt , fdto , fragment , & target_path );
789
+ ret = fdt_overlay_target_offset (fdt , fdto , fragment , & target_path );
805
790
if (ret < 0 )
806
791
return ret ;
807
792
target = ret ;
0 commit comments