[PATCH] cpufreq: Add test cases to validate the frequency and pstate table
Jeremy Kerr
jk at ozlabs.org
Fri Apr 22 08:54:34 UTC 2016
Hi Shilpasri,
> +static int read_device_tree_file(const char *path, int *val)
[...]
> +static int read_device_tree_array(const char *path, int *arr, int *len)
[...]
> +static int cpufreq_test_pstate_limits(fwts_framework *fw)
> +{
> + char *dev_tree_path = "/proc/device-tree/ibm,opal/power-mgt/";
[...]
We already have a representation of the device tree loaded, in fw->fdt.
You can use the standard libfdt accessors on this data.
Then, the compile time check becomes FWTS_HAS_DEVICETREE (to determine
whether you can use the libfdt functions), and you'd skip the test if
you have no fdt data:
if (!fw->fdt)
return FWTS_SKIPPED;
Cheers,
Jeremy
More information about the fwts-devel
mailing list