lkml.org 
[lkml]   [2022]   [Oct]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/3] cpufreq: qcom: pass pvs_name size along with its buffer
On 10-10-22, 11:22, Viresh Kumar wrote:
> On 01-10-22, 19:10, Fabien Parent wrote:
> > @@ -265,7 +269,7 @@ static int qcom_cpufreq_probe(struct platform_device *pdev)
> > struct nvmem_cell *speedbin_nvmem;
> > struct device_node *np;
> > struct device *cpu_dev;
> > - char *pvs_name = "speedXX-pvsXX-vXX";
> > + char *pvs_name = PVS_NAME_TEMPLATE;
> > unsigned cpu;
> > const struct of_device_id *match;
> > int ret;
> > @@ -306,8 +310,8 @@ static int qcom_cpufreq_probe(struct platform_device *pdev)
> > goto free_drv;
> > }
> >
> > - ret = drv->data->get_version(cpu_dev,
> > - speedbin_nvmem, &pvs_name, drv);
> > + ret = drv->data->get_version(cpu_dev, speedbin_nvmem, &pvs_name,
> > + sizeof(PVS_NAME_TEMPLATE), drv);
>
> Since the pvs name is always PVS_NAME_TEMPLATE, why are we even
> passing it and size here ? Why not directly use it in those
> get_version() implementations directly ?

I understand how &pvs_name is used here to later set the prop_name. I
think instead you should also implement drv->data->prop_name() here,
which can return valid name or NULL.

--
viresh

\
 
 \ /
  Last update: 2022-10-10 08:02    [W:0.055 / U:1.636 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site