hwcontext: Make it easier to work with device types