pci: remove unused unbind support
[dpdk.git] / lib / librte_eal / linuxapp / eal / eal_pci.c
index 876ba38..4350134 100644 (file)
  * IGB_UIO driver (or doesn't initialize, if the device wasn't bound to it).
  */
 
-/* unbind kernel driver for this device */
-int
-pci_unbind_kernel_driver(struct rte_pci_device *dev)
-{
-       int n;
-       FILE *f;
-       char filename[PATH_MAX];
-       char buf[BUFSIZ];
-       struct rte_pci_addr *loc = &dev->addr;
-
-       /* open /sys/bus/pci/devices/AAAA:BB:CC.D/driver */
-       snprintf(filename, sizeof(filename),
-               "%s/" PCI_PRI_FMT "/driver/unbind", pci_get_sysfs_path(),
-               loc->domain, loc->bus, loc->devid, loc->function);
-
-       f = fopen(filename, "w");
-       if (f == NULL) /* device was not bound */
-               return 0;
-
-       n = snprintf(buf, sizeof(buf), PCI_PRI_FMT "\n",
-                    loc->domain, loc->bus, loc->devid, loc->function);
-       if ((n < 0) || (n >= (int)sizeof(buf))) {
-               RTE_LOG(ERR, EAL, "%s(): snprintf failed\n", __func__);
-               goto error;
-       }
-       if (fwrite(buf, n, 1, f) == 0) {
-               RTE_LOG(ERR, EAL, "%s(): could not write to %s\n", __func__,
-                               filename);
-               goto error;
-       }
-
-       fclose(f);
-       return 0;
-
-error:
-       fclose(f);
-       return -1;
-}
-
 static int
 pci_get_kernel_driver_by_path(const char *filename, char *dri_name)
 {