video: driver: add resource ops macro support

Added call_res_op() macro and used at all possible
places to avoid invalid pointer dereference issue.

Also added changes to cleanup unused functions.

Change-Id: Id77711ad9eaf7b407208567b0fde1f2693588641
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
This commit is contained in:
Govindaraj Rajagopal
2022-10-10 10:57:25 +05:30
parent ca9cc59d28
commit 3560442234
17 changed files with 84 additions and 189 deletions

View File

@@ -197,6 +197,10 @@ struct msm_vidc_resource {
int fw_cookie;
};
#define call_res_op(c, op, ...) \
(((c) && (c)->res_ops && (c)->res_ops->op) ? \
((c)->res_ops->op(__VA_ARGS__)) : 0)
struct msm_vidc_resources_ops {
int (*init)(struct msm_vidc_core *core);