[PATCH v2 01/16] chardev: add helper function to register char devs with a struct device