Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions drivers/media/platform/msm/vidc/msm_vidc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1533,16 +1533,16 @@ int msm_vidc_destroy(struct msm_vidc_inst *inst)
return 0;
}

int msm_vidc_close(void *instance)
static void close_helper(struct kref *kref)
{
void close_helper(struct kref *kref)
{
struct msm_vidc_inst *inst = container_of(kref,
struct msm_vidc_inst, kref);
struct msm_vidc_inst *inst = container_of(kref,
struct msm_vidc_inst, kref);

msm_vidc_destroy(inst);
}
msm_vidc_destroy(inst);
}

int msm_vidc_close(void *instance)
{
struct msm_vidc_inst *inst = instance;
struct buffer_info *bi, *dummy;
int rc = 0, i = 0;
Expand Down
14 changes: 7 additions & 7 deletions drivers/media/platform/msm/vidc/msm_vidc_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -712,16 +712,16 @@ static void handle_sys_init_done(enum hal_command_response cmd, void *data)
return;
}

static void put_inst(struct msm_vidc_inst *inst)
static void put_inst_helper(struct kref *kref)
{
void put_inst_helper(struct kref *kref)
{
struct msm_vidc_inst *inst = container_of(kref,
struct msm_vidc_inst, kref);
struct msm_vidc_inst *inst = container_of(kref, struct msm_vidc_inst,
kref);

msm_vidc_destroy(inst);
}
msm_vidc_destroy(inst);
}

static void put_inst(struct msm_vidc_inst *inst)
{
if (!inst)
return;

Expand Down
29 changes: 14 additions & 15 deletions drivers/media/platform/msm/vidc/msm_vidc_res_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,16 @@ static size_t get_u32_array_num_elements(struct device_node *np,
return 0;
}

static inline enum imem_type read_imem_type(struct platform_device *pdev)
static inline bool is_compatible(char *compat)
{
bool is_compatible(char *compat)
{
return !!of_find_compatible_node(NULL, NULL, compat);
}
return !!of_find_compatible_node(NULL, NULL, compat);
}

static inline enum imem_type read_imem_type(struct platform_device *pdev)
{
return is_compatible("qcom,msm-ocmem") ? IMEM_OCMEM :
is_compatible("qcom,msm-vmem") ? IMEM_VMEM :
IMEM_NONE;

}

static inline void msm_vidc_free_allowed_clocks_table(
Expand Down Expand Up @@ -518,20 +517,20 @@ static int msm_vidc_load_cycles_per_mb_table(
return rc;
}

/* A comparator to compare loads (needed later on) */
static int cmp_load_freq_table(const void *a, const void *b)
{
/* want to sort in reverse so flip the comparison */
return ((struct load_freq_table *)b)->load -
((struct load_freq_table *)a)->load;
}

static int msm_vidc_load_freq_table(struct msm_vidc_platform_resources *res)
{
int rc = 0;
int num_elements = 0;
struct platform_device *pdev = res->pdev;

/* A comparator to compare loads (needed later on) */
int cmp(const void *a, const void *b)
{
/* want to sort in reverse so flip the comparison */
return ((struct load_freq_table *)b)->load -
((struct load_freq_table *)a)->load;
}

if (!of_find_property(pdev->dev.of_node, "qcom,load-freq-tbl", NULL)) {
/* qcom,load-freq-tbl is an optional property. It likely won't
* be present on cores that we can't clock scale on. */
Expand Down Expand Up @@ -571,7 +570,7 @@ static int msm_vidc_load_freq_table(struct msm_vidc_platform_resources *res)
* logic to work, just sort it ourselves
*/
sort(res->load_freq_tbl, res->load_freq_tbl_size,
sizeof(*res->load_freq_tbl), cmp, NULL);
sizeof(*res->load_freq_tbl), cmp_load_freq_table, NULL);
return rc;
}

Expand Down