device: Move device creation func into device.c