[PATCH 3/3] cpufreq: Add cpufreq driver for Freescale e500mc SOCs

Kim Phillips kim.phillips at freescale.com
Thu Mar 28 06:32:36 EST 2013


On Tue, 26 Mar 2013 10:36:31 +0800
<Yuantian.Tang at freescale.com> wrote:

> +static int __init ppc_corenet_cpufreq_init(void)
> +{
> +	int ret = 0;
> +	struct device_node  *np;
> +	const struct of_device_id *match;
> +
> +	np = of_find_matching_node(NULL, node_matches);
> +	if (!np)
> +		return -ENODEV;
> +
> +	match = of_match_node(node_matches, np);
> +	freq_data.cpus_per_cluster = (long)match->data;
> +	mutex_init(&freq_data.cpufreq_lock);
> +	of_node_put(np);
> +
> +	ret = cpufreq_register_driver(&ppc_corenet_cpufreq_driver);
> +	if (ret)
> +		return ret;
> +
> +	pr_info("Freescale PowerPC corenet CPU frequency scaling driver\n");
> +
> +	return ret;
> +}
> +
> +static void __exit ppc_corenet_cpufreq_exit(void)
> +{
> +	cpufreq_unregister_driver(&ppc_corenet_cpufreq_driver);
> +}
> +
> +module_init(ppc_corenet_cpufreq_init);
> +module_exit(ppc_corenet_cpufreq_exit);

this needs to be a module_platform_driver.

Kim



More information about the Linuxppc-dev mailing list