/* Return: 0 for successful request, else a corresponding error value  */
static int ti_sci_reset_set(struct reset_ctl *rst, bool assert)
/* Return: 0 for successful request, else a corresponding error value  */
static int ti_sci_reset_set(struct reset_ctl *rst, bool assert)
{
	struct ti_sci_reset_data *data = dev_get_priv(rst->dev);
	const struct ti_sci_handle *sci = data->sci;
	const struct ti_sci_dev_ops *dops = &sci->ops.dev_ops;
	u32 reset_state;
	int ret;
	ret = dops->get_device_resets(sci, rst->id, &reset_state);
	if (ret) {
		dev_err(rst->dev, "%s: get_device_resets failed (%d)\n",
			__func__, ret);
		return ret;
	}
	if (assert)
		reset_state |= rst->data;
	else
		reset_state &= ~rst->data;
	ret = dops->set_device_resets(sci, rst->id, reset_state);
	if (ret) {
		dev_err(rst->dev, "%s: set_device_resets failed (%d)\n",
			__func__, ret);
		return ret;
	}
	return 0;
}