Pass the device object.

No idea how this wasn't in master. Was in a local topic branch that
I *thought* was branched from master. Probably some merge error from
when we had the seperate branches...