[ Upstream commit
e922a33e0228fa314ffc4f70b3b9ffbc4aad1bbe ]
The hfi_session_init can be called many times and it returns
EINVAL when the session was already initialized. This error code
(EINVAL) is confusing for the callers. Change hfi_session_init to
return EALREADY error code when the session has been already
initialized.
Tested-by: Fritz Koenig <frkoenig@chromium.org>
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Stable-dep-of:
9edaaa8e3e15 ("media: venus: hfi_parser: refactor hfi packet parsing logic")
Signed-off-by: Sasha Levin <sashal@kernel.org>
int ret;
if (inst->state != INST_UNINIT)
- return -EINVAL;
+ return -EALREADY;
inst->hfi_codec = to_codec_type(pixfmt);
reinit_completion(&inst->done);
int ret;
ret = hfi_session_init(inst, inst->fmt_out->pixfmt);
- if (ret == -EINVAL)
+ if (ret == -EALREADY)
return 0;
else if (ret)
return ret;
int ret;
ret = hfi_session_init(inst, inst->fmt_cap->pixfmt);
- if (ret == -EINVAL)
+ if (ret == -EALREADY)
return 0;
else if (ret)
return ret;