cpufreq: imx-cpufreq-dt: Remove global platform match list

This is not currently needed, instead a platform device is always created
from SOC-specific code.

We can use of_machine_is_compatible for per-SOC behavior instead.

Suggested-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
This commit is contained in:
Leonard Crestez 2019-06-05 13:37:05 +03:00 committed by Viresh Kumar
parent 4c5681fcc6
commit 7d5f589a52

View File

@ -19,12 +19,6 @@
#define OCOTP_CFG3_MKT_SEGMENT_SHIFT 6
#define OCOTP_CFG3_MKT_SEGMENT_MASK (0x3 << 6)
static const struct of_device_id imx_cpufreq_dt_match_list[] = {
{ .compatible = "fsl,imx8mm" },
{ .compatible = "fsl,imx8mq" },
{}
};
/* cpufreq-dt device registered by imx-cpufreq-dt */
static struct platform_device *cpufreq_dt_pdev;
static struct opp_table *cpufreq_opp_table;
@ -32,18 +26,10 @@ static struct opp_table *cpufreq_opp_table;
static int imx_cpufreq_dt_probe(struct platform_device *pdev)
{
struct device *cpu_dev = get_cpu_device(0);
struct device_node *np;
const struct of_device_id *match;
u32 cell_value, supported_hw[2];
int speed_grade, mkt_segment;
int ret;
np = of_find_node_by_path("/");
match = of_match_node(imx_cpufreq_dt_match_list, np);
of_node_put(np);
if (!match)
return -ENODEV;
ret = nvmem_cell_read_u32(cpu_dev, "speed_grade", &cell_value);
if (ret)
return ret;
@ -61,8 +47,8 @@ static int imx_cpufreq_dt_probe(struct platform_device *pdev)
* Applies to 8mq and 8mm.
*/
if (mkt_segment == 0 && speed_grade == 0 && (
!strcmp(match->compatible, "fsl,imx8mm") ||
!strcmp(match->compatible, "fsl,imx8mq")))
of_machine_is_compatible("fsl,imx8mm") ||
of_machine_is_compatible("fsl,imx8mq")))
speed_grade = 1;
supported_hw[0] = BIT(speed_grade);