break;
timeout_ms -= AK8975_CONVERSION_DONE_POLL_TIME;
}
- if (!timeout_ms) {
- dev_err(&client->dev, "Conversion timeout happened\n");
- return -EINVAL;
- }
+ if (!timeout_ms)
+ return -ETIMEDOUT;
ret = i2c_smbus_read_byte_data(client, data->def->ctrl_regs[ST1]);
if (ret < 0)
break;
timeout_ms -= AK8975_CONVERSION_DONE_POLL_TIME;
}
- if (!timeout_ms) {
- dev_err(&client->dev, "Conversion timeout happened\n");
- return -EINVAL;
- }
+ if (!timeout_ms)
+ return -ETIMEDOUT;
return read_status;
}
-/* Returns 0 if the end of conversion interrupt occurred or -ETIME otherwise */
+/* Returns 0 if the end of conversion interrupt occurred or -ETIMEDOUT otherwise */
static int wait_conversion_complete_interrupt(struct ak8975_data *data)
{
int ret;
AK8975_DATA_READY_TIMEOUT);
clear_bit(0, &data->flags);
- return ret > 0 ? 0 : -ETIME;
+ return ret > 0 ? 0 : -ETIMEDOUT;
}
static int ak8975_start_read_axis(struct ak8975_data *data,