Please no arch specific code here, also this is still from the stm lib instead of libopencm3.
In any case most of this code should not be needed at all, since this imu driver should use the new mpu60x0 peripheral.