The module creates the device (not the file) with register_chrdev, which returns the value of the major number that was assigned. We then use class_create to create a udev class to contain the device, finally you call device_create to actually make the device file.
To remove the device, you call device_destroy to remove the device from the class, then class_unregister to remove the class from sysfs. class_destroy is called to delete the class and finally unregister_chrdev to remove the device from the kernel (the device not the file).
The relevant init and exit sections are:
static int pi_init(void)
struct device *err_dev;
msg = kmalloc(sizeof(char)*DIGITS, GFP_ATOMIC);
// register pi as a device
pi_Major = register_chrdev(0, DEVICE_NAME, &fops);
Hope that helps someone out there.