diff options
author | Maxim Devaev <[email protected]> | 2022-03-31 16:17:52 +0300 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2022-03-31 16:17:52 +0300 |
commit | b775239d7265a1bcbb6e32f06546e53d389802d6 (patch) | |
tree | 98c7112425e79e0075c5e3859567b085bf9bab17 /kvmd/apps/otgnet | |
parent | ab09f88d80ac67c76f012b2fcb853f2d69ab6b7d (diff) |
refactoring
Diffstat (limited to 'kvmd/apps/otgnet')
-rw-r--r-- | kvmd/apps/otgnet/__init__.py | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/kvmd/apps/otgnet/__init__.py b/kvmd/apps/otgnet/__init__.py index ad1f6a28..3f2d99b8 100644 --- a/kvmd/apps/otgnet/__init__.py +++ b/kvmd/apps/otgnet/__init__.py @@ -20,7 +20,6 @@ # ========================================================================== # -import os import asyncio import ipaddress import dataclasses @@ -34,9 +33,9 @@ from ...logging import get_logger from ...yamlconf import Section -from ... import env from ... import tools from ... import aioproc +from ... import usb from .. import init @@ -176,11 +175,7 @@ class _Service: # pylint: disable=too-many-instance-attributes real_driver = self.__driver if self.__driver == "rndis5": real_driver = "rndis" - path = env.SYSFS_PREFIX + os.path.join( - "/sys/kernel/config/usb_gadget", - self.__gadget, - f"functions/{real_driver}.usb0/ifname", - ) + path = usb.get_gadget_path(self.__gadget, usb.G_FUNCTIONS, f"{real_driver}.usb0/ifname") logger.info("Using OTG gadget %r ...", self.__gadget) with open(path) as iface_file: iface = iface_file.read().strip() |