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

Function dev_kernel_driver_name

dpdk/drivers/bus/platform/platform.c:117–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115}
116
117static char *
118dev_kernel_driver_name(const char *dev_name)
119{
120 char path[PATH_MAX], buf[BUFSIZ] = { };
121 char *kdrv;
122 int ret;
123
124 snprintf(path, sizeof(path), PLATFORM_BUS_DEVICES_PATH "/%s/driver", dev_name);
125 /* save space for NUL */
126 ret = readlink(path, buf, sizeof(buf) - 1);
127 if (ret <= 0)
128 return NULL;
129
130 /* last token is kernel driver name */
131 kdrv = strrchr(buf, '/');
132 if (kdrv != NULL)
133 return strdup(kdrv + 1);
134
135 return NULL;
136}
137
138static bool
139dev_is_bound_vfio_platform(const char *dev_name)

Callers 2

driver_match_deviceFunction · 0.85

Calls 3

snprintfFunction · 0.85
strrchrFunction · 0.85
strdupFunction · 0.85

Tested by

no test coverage detected