This would be enough, wouldn't it?

    string t = GetDeviceType( name, newdev);