| 243 | } |
| 244 | |
| 245 | static char * |
| 246 | of_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 | |
| 266 | static int |
| 267 | device_map_resources(struct rte_platform_device *pdev, unsigned int num) |
no test coverage detected