/* Return: 0 if all went well, else returns appropriate error value.  */
static int ti_sci_cmd_proc_shutdown_no_wait(const struct ti_sci_handle *handle, u8 proc_id)
/* Return: 0 if all went well, else returns appropriate error value.  */
static int ti_sci_cmd_proc_shutdown_no_wait(const struct ti_sci_handle *handle, u8 proc_id)
{
	int ret;
	ret = ti_sci_proc_wait_boot_status_no_wait(handle, proc_id,
		U8_MAX, 100, U8_MAX, U8_MAX,
		0, PROC_BOOT_STATUS_FLAG_R5_WFE | PROC_BOOT_STATUS_FLAG_R5_WFI,
		0, 0);
	if (ret) {
		dev_err(info->dev, "Sending core %u wait message fail %d\n",
			proc_id, ret);
		return ret;
	}
	ret = ti_sci_set_device_state_no_wait(handle, proc_id, 0,
					      MSG_DEVICE_SW_STATE_AUTO_OFF);
	if (ret)
		dev_err(info->dev, "Sending core %u shutdown message fail %d\n",
			proc_id, ret);
	return ret;
}