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

Function driver_match_device

dpdk/drivers/bus/platform/platform.c:408–438  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

406}
407
408static bool
409driver_match_device(struct rte_platform_driver *pdrv, struct rte_platform_device *pdev)
410{
411 bool match = false;
412 char *kdrv;
413
414 kdrv = dev_kernel_driver_name(pdev->name);
415 if (!kdrv)
416 return false;
417
418 /* match by driver name */
419 if (!strcmp(kdrv, pdrv->driver.name)) {
420 match = true;
421 goto out;
422 }
423
424 /* match by driver alias */
425 if (pdrv->driver.alias != NULL && !strcmp(kdrv, pdrv->driver.alias)) {
426 match = true;
427 goto out;
428 }
429
430 /* match by device name */
431 if (!strcmp(pdev->name, pdrv->driver.name))
432 match = true;
433
434out:
435 free(kdrv);
436
437 return match;
438}
439
440static int
441device_attach(struct rte_platform_device *pdev)

Callers 2

device_attachFunction · 0.85
platform_bus_parseFunction · 0.85

Calls 3

dev_kernel_driver_nameFunction · 0.85
strcmpFunction · 0.85
freeFunction · 0.50

Tested by

no test coverage detected