[PATCH 3.16 233/245] chardev: add helper function to register char devs with a struct device