[PATCH] dinput: Use a helper function to get device type.