[Cbe-oss-dev] Subject: cell: add spu aware cpufreq governor

Akinobu Mita mita at fixstars.com
Mon Jan 21 14:09:23 EST 2008


> +/*
> + * module init and destoy
> + */
> +
> +static int __init spu_gov_init(void)
> +{
> +if (!machine_is(cell))
> +return -ENODEV;
> +
> +kspugov_wq = create_workqueue("kspugov");
> +if (!kspugov_wq) {
> +printk(KERN_ERR "creation of kspugov failed\n");
> +return -EFAULT;
> +}
> +
> +return cpufreq_register_governor(&spu_governor);

Missing an error handling. This line should be something like:

    err = cpufreq_register_governor(&spu_governor);
    if (err) {
        destroy_workqueue(kspugov_wq);
        return err;
    }

    return 0;

It seems like this is copied from drivers/cpufreq/cpufreq_governor.c
Althought this is not big problem, it would be nice to fix as well.

> +}






More information about the cbe-oss-dev mailing list