/* Return: pointer to handle if successful, else EINVAL if invalid conditions are encountered.  */
const struct ti_sci_handle* ti_sci_get_handle_from_sysfw(struct udevice *sci_dev)
/* Return: pointer to handle if successful, else EINVAL if invalid conditions are encountered.  */
const struct ti_sci_handle* ti_sci_get_handle_from_sysfw(struct udevice *sci_dev)
{
	if (!sci_dev)
		return ERR_PTR(-EINVAL);
	struct ti_sci_info *info = dev_get_priv(sci_dev);
	if (!info)
		return ERR_PTR(-EINVAL);
	struct ti_sci_handle *handle = &info->handle;
	if (!handle)
		return ERR_PTR(-EINVAL);
	return handle;
}