Commit 6f5ea3a6 authored by songlinfeng's avatar songlinfeng
Browse files

support hydcu/hycu

parent 5f7b0309
......@@ -49,9 +49,6 @@ func (fs *DefaultFS) GetDeviceStat(dev string, format string) (string, error) {
func GetHYDCUs() ([]DeviceInfo, error) { return GetHyDCUsWithFS(defaultFS) }
func GetHyDCUsWithFS(fs FileSystem) ([]DeviceInfo, error) {
if _, err := fs.Stat("/sys/module/hydcu/drivers/"); err != nil {
return nil, err
}
renderDevIds := GetDevIdsFromTopology(fs)
......@@ -59,7 +56,7 @@ func GetHyDCUsWithFS(fs FileSystem) ([]DeviceInfo, error) {
uniqueIdDevices := make(map[string][]DeviceInfo)
var uniqueIds []string // To maintain order
pciDevs, err := fs.Glob("/sys/module/hydcu/drivers/pci:hydcu/[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]:*")
pciDevs, err := fs.Glob("/sys/module/hy*cu/drivers/pci:hy*cu/[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]:*")
if err != nil {
fmt.Println("Failed to find hydcu driver directories: %v", err)
return nil, err
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment