Unregister and free a root device
void root_device_unregister(struct device * dev);
dev
device going away
This function unregisters and cleans up a device that was created by root_device_register.