Skip to content

Commit

Permalink
[devices]: Dell SMF driver hwmon number reorder fix for Dell S6100/Z9…
Browse files Browse the repository at this point in the history
…100 (#2305)
  • Loading branch information
paavaanan authored and lguohan committed Dec 5, 2018
1 parent f5e678c commit bcd4e1e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion device/dell/x86_64-dell_s6100_c2538-r0/plugins/psuutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
except ImportError as e:
raise ImportError(str(e) + "- required module not found")

HWMON_DIR = "/sys/devices/platform/SMF.512/hwmon/"
HWMON_NODE = os.listdir(HWMON_DIR)[0]

class PsuUtil(PsuBase):
"""Platform-specific PSUutil class"""
Expand All @@ -20,7 +22,7 @@ def __init__(self):

# Get a mailbox register
def get_pmc_register(self, reg_name):
mailbox_dir = "/sys/devices/platform/SMF.512/hwmon/hwmon1"
mailbox_dir = HWMON_DIR + HWMON_NODE
retval = 'ERR'
mb_reg_file = mailbox_dir+'/' + reg_name
if (not os.path.isfile(mb_reg_file)):
Expand Down
4 changes: 3 additions & 1 deletion device/dell/x86_64-dell_z9100_c2538-r0/plugins/psuutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
except ImportError as e:
raise ImportError(str(e) + "- required module not found")

HWMON_DIR = "/sys/devices/platform/SMF.512/hwmon/"
HWMON_NODE = os.listdir(HWMON_DIR)[0]

class PsuUtil(PsuBase):
"""Platform-specific PSUutil class"""
Expand All @@ -20,7 +22,7 @@ def __init__(self):

# Get a mailbox register
def get_pmc_register(self, reg_name):
mailbox_dir = "/sys/devices/platform/SMF.512/hwmon/hwmon1"
mailbox_dir = HWMON_DIR + HWMON_NODE
retval = 'ERR'
mb_reg_file = mailbox_dir+'/' + reg_name
if (not os.path.isfile(mb_reg_file)):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
S6100_MAX_PSUS = 2
S6100_MAX_IOMS = 4

MAILBOX_DIR = "/sys/devices/platform/SMF.512/hwmon/hwmon1"
HWMON_DIR = "/sys/devices/platform/SMF.512/hwmon/"
HWMON_NODE = os.listdir(HWMON_DIR)[0]
MAILBOX_DIR = HWMON_DIR + HWMON_NODE
iom_status_list = []

# Get a mailbox register
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
Z9100_MAX_PSUS = 2
S6100_MAX_IOMS = 4

MAILBOX_DIR = "/sys/devices/platform/SMF.512/hwmon/hwmon0"
HWMON_DIR = "/sys/devices/platform/SMF.512/hwmon/"
HWMON_NODE = os.listdir(HWMON_DIR)[0]
MAILBOX_DIR = HWMON_DIR + HWMON_NODE

# Get a mailbox register

Expand Down

0 comments on commit bcd4e1e

Please sign in to comment.