video: driver: check for regulator support before initializing
Upstream doesn't support regulators, while downstream kernel does. So add a condition to check for regulator support before init. Change-Id: Icab8aec20796546a33ac571963f871d146970002 Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
This commit is contained in:
@@ -229,6 +229,11 @@ static inline bool is_mmrm_supported(struct msm_vidc_core *core)
|
||||
return !!core->platform->data.supports_mmrm;
|
||||
}
|
||||
|
||||
static inline bool is_regulator_supported(struct msm_vidc_core *core)
|
||||
{
|
||||
return !!core->platform->data.regulator_tbl_size;
|
||||
}
|
||||
|
||||
int msm_vidc_init_platform(struct platform_device *pdev);
|
||||
int msm_vidc_deinit_platform(struct platform_device *pdev);
|
||||
|
||||
|
@@ -234,6 +234,12 @@ static int __init_regulators(struct msm_vidc_core *core)
|
||||
}
|
||||
regulators = &core->resource->regulator_set;
|
||||
|
||||
/* skip init if regulators not supported */
|
||||
if (!is_regulator_supported(core)) {
|
||||
d_vpr_h("%s: regulators are not available in database\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
regulator_tbl = core->platform->data.regulator_tbl;
|
||||
regulator_count = core->platform->data.regulator_tbl_size;
|
||||
|
||||
|
Reference in New Issue
Block a user