MCPcopy Create free account
hub / github.com/F-Stack/f-stack / of_resource_name

Function of_resource_name

dpdk/drivers/bus/platform/platform.c:245–264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

243}
244
245static char *
246of_resource_name(const char *dev_name, int index)
247{
248 char path[PATH_MAX], buf[BUFSIZ] = { };
249 int num = 0, ret;
250 char *name;
251
252 snprintf(path, sizeof(path), PLATFORM_BUS_DEVICES_PATH "/%s/of_node/reg-names", dev_name);
253 ret = read_sysfs_string(path, buf, sizeof(buf) - 1);
254 if (ret)
255 return NULL;
256
257 for (name = buf; *name != 0; name += strlen(name) + 1) {
258 if (num++ != index)
259 continue;
260 return strdup(name);
261 }
262
263 return NULL;
264}
265
266static int
267device_map_resources(struct rte_platform_device *pdev, unsigned int num)

Callers 1

device_map_resourcesFunction · 0.85

Calls 3

snprintfFunction · 0.85
read_sysfs_stringFunction · 0.85
strdupFunction · 0.85

Tested by

no test coverage detected