From e77a7b12fb377b3a0ae27f519dbb30ba2b5438b4 Mon Sep 17 00:00:00 2001 From: paavaanan Date: Sat, 9 Feb 2019 11:36:15 +0530 Subject: [PATCH] [devices]: Dell SMF driver hwmon number reorder fix for Dell S6100/Z9100 (#2542) --- device/dell/x86_64-dell_s6100_c2538-r0/plugins/psuutil.py | 4 +++- device/dell/x86_64-dell_z9100_c2538-r0/plugins/psuutil.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/device/dell/x86_64-dell_s6100_c2538-r0/plugins/psuutil.py b/device/dell/x86_64-dell_s6100_c2538-r0/plugins/psuutil.py index 5f9661a51e3c..eef8d6c8f131 100644 --- a/device/dell/x86_64-dell_s6100_c2538-r0/plugins/psuutil.py +++ b/device/dell/x86_64-dell_s6100_c2538-r0/plugins/psuutil.py @@ -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 = ', '.join(os.listdir(HWMON_DIR)) class PsuUtil(PsuBase): """Platform-specific PSUutil class""" @@ -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)): diff --git a/device/dell/x86_64-dell_z9100_c2538-r0/plugins/psuutil.py b/device/dell/x86_64-dell_z9100_c2538-r0/plugins/psuutil.py index 66253850e6ff..28390561c628 100644 --- a/device/dell/x86_64-dell_z9100_c2538-r0/plugins/psuutil.py +++ b/device/dell/x86_64-dell_z9100_c2538-r0/plugins/psuutil.py @@ -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 = ', '.join(os.listdir(HWMON_DIR)) class PsuUtil(PsuBase): """Platform-specific PSUutil class""" @@ -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)):