* If vendor/device ID match, call the remove() function of the * driver. */
| 526 | * driver. |
| 527 | */ |
| 528 | static int |
| 529 | cdx_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 | |
| 560 | static int |
| 561 | cdx_plug(struct rte_device *dev) |
no test coverage detected