driver-core: Move kobj_to_dev from genhd.h to device.h
This function is not really specific to the genhd layer and there are various
re-implementations or open-coded variants of it all throughout the kernel. To
avoid further duplications move the function to a more generic place.
While moving also convert it from a macro to a inline function.
Potential users of this function can be detected and converted using the
following coccinelle patch: