]> Repositories - Adafruit_Blinka-hackapet.git/blobdiff - src/adafruit_blinka/microcontroller/amlogic/meson_g12_common/pin.py
Fix pylint by relying on implicit return of None. Also fix typing which should have...
[Adafruit_Blinka-hackapet.git] / src / adafruit_blinka / microcontroller / amlogic / meson_g12_common / pin.py
index 31ff8e1423d77aaef3f6d26d268c0a961ca29473..9bce640374003abd9aa367da28df51bcacd5f6b0 100644 (file)
@@ -11,6 +11,7 @@ Linux kernel 5.4.y (mainline)
     linux/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
 """
 
+from typing import Optional
 import os
 import re
 import gpiod
@@ -111,7 +112,7 @@ UART1_RX = GPIOX_13
 uartPorts = ((1, UART1_TX, UART1_RX),)
 
 
-def get_dts_alias(device: str) -> str:
+def get_dts_alias(device: str) -> Optional[str]:
     """Get the Device Tree Alias"""
     uevent_path = "/sys/bus/platform/devices/" + device + "/uevent"
     if os.path.exists(uevent_path):
@@ -123,8 +124,6 @@ def get_dts_alias(device: str) -> str:
               if match:
                   return match.group(1).upper()
 
-          return None
-
 
 # ordered as i2cId, sclId, sdaId
 i2cPorts = []