Seastone: fix platform fan psu and temperature issues (#12567)
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.
This commit is contained in:
parent
e5808020a7
commit
ad49100985
@ -97,7 +97,7 @@ class Fan(FanBase):
|
||||
|
||||
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)
|
||||
|
@ -69,7 +69,7 @@ class Psu(PsuBase):
|
||||
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user