MCPcopy
hub / github.com/jaypipes/ghw / getDeviceDriver

Function getDeviceDriver

pkg/pci/pci_linux.go:114–126  ·  view source on GitHub ↗
(paths *linuxpath.Paths, pciAddr *pciaddr.Address)

Source from the content-addressed store, hash-verified

112}
113
114func 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
128type deviceModaliasInfo struct {
129 vendorID string

Callers 1

getDevicesMethod · 0.85

Calls 1

StringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…