(paths *linuxpath.Paths, pciAddr *pciaddr.Address)
| 112 | } |
| 113 | |
| 114 | func getDeviceDriver(paths *linuxpath.Paths, pciAddr *pciaddr.Address) string { |
| 115 | driverPath := filepath.Join(paths.SysBusPciDevices, pciAddr.String(), "driver") |
| 116 | |
| 117 | if _, err := os.Stat(driverPath); err != nil { |
| 118 | return "" |
| 119 | } |
| 120 | |
| 121 | dest, err := os.Readlink(driverPath) |
| 122 | if err != nil { |
| 123 | return "" |
| 124 | } |
| 125 | return filepath.Base(dest) |
| 126 | } |
| 127 | |
| 128 | type deviceModaliasInfo struct { |
| 129 | vendorID string |
no test coverage detected
searching dependent graphs…