Skip to content

Commit

Permalink
Seastone: fix platform fan psu and temperature issues (sonic-net#12567)
Browse files Browse the repository at this point in the history
Why I did it:
Fix multiple seastone platform issues caused by sonic kernel upgrade.

How I did it:
Get gpio base id with new label path in gpio sys fs.

How to verify it:
After the change, show platform fan/psustatus/temperature works well.
  • Loading branch information
qnos authored and mssonicbld committed Dec 7, 2022
1 parent fa31cac commit 0be4136
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def __search_file_by_name(self, directory, file_name):

def __get_gpio_base(self):
for r in os.listdir(GPIO_DIR):
label_path = os.path.join(GPIO_DIR, r, "label")
label_path = os.path.join(GPIO_DIR, r, "device/name")
if "gpiochip" in r and GPIO_LABEL in \
self._api_helper.read_txt_file(label_path):
return int(r[8:], 10)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def __search_file_by_contain(self, directory, search_str, file_start):

def __get_gpio_base(self):
for r in os.listdir(GPIO_DIR):
label_path = os.path.join(GPIO_DIR, r, "label")
label_path = os.path.join(GPIO_DIR, r, "device/name")
if "gpiochip" in r and GPIO_LABEL in self._api_helper.read_txt_file(label_path):
return int(r[8:], 10)
return 216 # Reserve
Expand Down

0 comments on commit 0be4136

Please sign in to comment.