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>
Este cometimento está contido em:
@@ -231,6 +231,5 @@ static inline bool is_mmrm_supported(struct msm_vidc_core *core)
|
||||
|
||||
int msm_vidc_init_platform(struct platform_device *pdev);
|
||||
int msm_vidc_deinit_platform(struct platform_device *pdev);
|
||||
int msm_vidc_read_efuse(struct msm_vidc_core *core);
|
||||
|
||||
#endif // _MSM_VIDC_PLATFORM_H_
|
||||
|
@@ -6,7 +6,6 @@
|
||||
|
||||
#include <linux/io.h>
|
||||
#include <linux/of.h>
|
||||
#include <soc/qcom/of_common.h>
|
||||
|
||||
#include "msm_vidc_platform.h"
|
||||
#include "msm_vidc_debug.h"
|
||||
@@ -447,51 +446,3 @@ int msm_vidc_init_platform(struct platform_device *pdev)
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
int msm_vidc_read_efuse(struct msm_vidc_core *core)
|
||||
{
|
||||
int rc = 0;
|
||||
void __iomem *base;
|
||||
u32 i = 0, efuse = 0, efuse_data_count = 0;
|
||||
struct msm_vidc_efuse_data *efuse_data = NULL;
|
||||
struct msm_vidc_platform_data *platform_data;
|
||||
|
||||
if (!core || !core->platform || !core->pdev) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
platform_data = &core->platform->data;
|
||||
efuse_data = platform_data->efuse_data;
|
||||
efuse_data_count = platform_data->efuse_data_size;
|
||||
|
||||
if (!efuse_data)
|
||||
return 0;
|
||||
|
||||
for (i = 0; i < efuse_data_count; i++) {
|
||||
switch (efuse_data[i].purpose) {
|
||||
case SKU_VERSION:
|
||||
base = devm_ioremap(&core->pdev->dev, efuse_data[i].start_address,
|
||||
efuse_data[i].size);
|
||||
if (!base) {
|
||||
d_vpr_e("failed efuse: start %#x, size %d\n",
|
||||
efuse_data[i].start_address,
|
||||
efuse_data[i].size);
|
||||
return -EINVAL;
|
||||
}
|
||||
efuse = readl_relaxed(base);
|
||||
platform_data->sku_version =
|
||||
(efuse & efuse_data[i].mask) >>
|
||||
efuse_data[i].shift;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (platform_data->sku_version) {
|
||||
d_vpr_h("efuse 0x%x, platform version 0x%x\n",
|
||||
efuse, platform_data->sku_version);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
Criar uma nova questão referindo esta
Bloquear um utilizador