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

Function cdx_detach_dev

dpdk/drivers/bus/cdx/cdx.c:528–558  ·  view source on GitHub ↗

* If vendor/device ID match, call the remove() function of the * driver. */

Source from the content-addressed store, hash-verified

526 * driver.
527 */
528static int
529cdx_detach_dev(struct rte_cdx_device *dev)
530{
531 struct rte_cdx_driver *dr;
532 int ret = 0;
533
534 if (dev == NULL)
535 return -EINVAL;
536
537 dr = dev->driver;
538
539 CDX_BUS_DEBUG("detach device %s using driver: %s",
540 dev->device.name, dr->driver.name);
541
542 if (dr->remove) {
543 ret = dr->remove(dev);
544 if (ret < 0)
545 return ret;
546 }
547
548 /* clear driver structure */
549 dev->driver = NULL;
550 dev->device.driver = NULL;
551
552 rte_cdx_unmap_device(dev);
553
554 rte_intr_instance_free(dev->intr_handle);
555 dev->intr_handle = NULL;
556
557 return 0;
558}
559
560static int
561cdx_plug(struct rte_device *dev)

Callers 1

cdx_unplugFunction · 0.85

Calls 2

rte_cdx_unmap_deviceFunction · 0.85
rte_intr_instance_freeFunction · 0.85

Tested by

no test coverage detected