Sort the list of devices before returning it.