def METHOD_NAME(name, version):
    """Check the USB specification number for both hub port and device."""
    path = rootdir_pattern.sub('', os.readlink('/sys/block/%s' % name))
    # Remove the usb config.interface part of the path
    m = re.match('((.*usb\d+).*\/)\d-[\d\.:\-]+\/.*', path)  # noqa: W605
    if m:
        device_path = m.group(1)
        hub_port_path = m.group(2)
        # Check the highest version of USB the device supports
        with open('/sys/devices/%s/version' % device_path, "rt") as f:
            if float(f.readline()) < version:
                return 'unsupported'
        # Check the highest version of USB the hub supports
        with open('/sys/devices/%s/version' % hub_port_path, "rt") as f:
            if float(f.readline()) < version:
                return 'unsupported'
        return 'supported'
    return 'unsupported'