On 14.06.2023 20:02, Jason Andryuk wrote: > @@ -121,6 +122,12 @@ int __init cpufreq_register_governor(struct > cpufreq_governor *governor) > if (!governor) > return -EINVAL; > > + if (cpufreq_governor_internal && !governor->internal) > + return -EINVAL; > + > + if (!cpufreq_governor_internal && governor->internal) > + return -EINVAL;
First just a nit: Why not simply if (cpufreq_governor_internal != governor->internal) return -EINVAL; ? Yet then I find this approach a little odd anyway. I think the registration attempts would better be suppressed, thus also not resulting in (apparently) failed init-calls. Especially for the userspace governor this would then also mean / allow to avoid registering of the CPU notifier. Jan