def get_devmm(name):
    name = os.path.expanduser(name)

    if is_chrdev(name) or is_blkdev(name):
        stat_structure = os.stat(name)
        return (
                os.major(stat_structure.st_rdev),
                os.minor(stat_structure.st_rdev))
    else:
        return (0, 0)
Get major/minor info from a device
dataset/ETHPy150Open saltstack/salt/salt/modules/file.py/get_devmm