add detach function to drivers

Signed-off-by: Jens Nyberg <jens.nyberg@gmail.com>