Skip to content

Commit 610c704

Browse files
committed
Fix bug which can cause permissions issues
1 parent a3c6c8c commit 610c704

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cros_ec_python/devices/lpc.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,14 @@ def detect() -> bool:
5252
return True
5353

5454
@staticmethod
55-
def find_address(*addresses, portio: PortIO = PortIO()) -> int | None:
55+
def find_address(*addresses, portio: PortIO | None = None) -> int | None:
5656
"""
5757
Find the EC memory map address.
5858
:param addresses: A list of addresses to check.
5959
:return: The address of the EC memory map, or None if not found.
6060
"""
61+
if portio is None:
62+
portio = PortIO()
6163
for a in addresses:
6264
if res := portio.ioperm(a, EC_MEMMAP_SIZE, True):
6365
if res == errno.EPERM:

0 commit comments

Comments
 (0)