def METHOD_NAME(args, device):
    if args.destroy_vfs:
        LOG.warning('--destroy-vfs only applicable with "assign"')
    try:
        device.fme.release_port(args.port)
    except (OSError, IOError) as err:
        LOG.warning('releasing port %d for device %s: %s', args.port,
                    device.pci_node, err)
    else:
        if args.numvfs:
            set_numvfs(device, args.numvfs)