Add fdt_get_unit() function.
Obtained from: Semihalf
This commit is contained in:
parent
2f0da24b47
commit
2c99056488
@ -697,3 +697,14 @@ fdt_get_mem_regions(struct mem_region *mr, int *mrcnt, uint32_t *memsize)
|
||||
out:
|
||||
return (rv);
|
||||
}
|
||||
|
||||
int
|
||||
fdt_get_unit(device_t dev)
|
||||
{
|
||||
const char * name;
|
||||
|
||||
name = ofw_bus_get_name(dev);
|
||||
name = strchr(name, '@') + 1;
|
||||
|
||||
return (strtol(name,NULL,0));
|
||||
}
|
||||
|
@ -110,5 +110,6 @@ int fdt_pci_route_intr(int, int, int, int, struct fdt_pci_intr *, int *);
|
||||
int fdt_ranges_verify(pcell_t *, int, int, int, int);
|
||||
int fdt_reg_to_rl(phandle_t, struct resource_list *);
|
||||
int fdt_pm(phandle_t);
|
||||
int fdt_get_unit(device_t);
|
||||
|
||||
#endif /* _FDT_COMMON_H_ */
|
||||
|
Loading…
Reference in New Issue
Block a user