[POWERPC] bootwrapper: Add find_node_by_alias and dt_fixup_mac_address_by_alias
[sfrench/cifs-2.6.git] / arch / powerpc / boot / ops.h
index 6036a98e646afa1aca3ff90db53396d84e158fe0..5872ef1779ae5d93c94e7a2b367931f2ec48ed3b 100644 (file)
@@ -159,9 +159,23 @@ static inline void *find_node_by_devtype(const void *prev,
        return find_node_by_prop_value_str(prev, "device_type", type);
 }
 
+static inline void *find_node_by_alias(const char *alias)
+{
+       void *devp = finddevice("/aliases");
+
+       if (devp) {
+               char path[MAX_PATH_LEN];
+               if (getprop(devp, alias, path, MAX_PATH_LEN) > 0)
+                       return finddevice(path);
+       }
+
+       return NULL;
+}
+
 void dt_fixup_memory(u64 start, u64 size);
 void dt_fixup_cpu_clocks(u32 cpufreq, u32 tbfreq, u32 busfreq);
 void dt_fixup_clock(const char *path, u32 freq);
+void dt_fixup_mac_address_by_alias(const char *alias, const u8 *addr);
 void dt_fixup_mac_address(u32 index, const u8 *addr);
 void __dt_fixup_mac_addresses(u32 startindex, ...);
 #define dt_fixup_mac_addresses(...) \