Message ID | 3005031.0yf0g1BPEE@vostro.rjw.lan (mailing list archive) |
---|---|
State | Superseded, archived |
Headers | show |
On 25 October 2013 15:40, Rafael J. Wysocki <rjw@rjwysocki.net> wrote: > And in my opinion acpi_cpufreq_init() should just return an error code if it > can't register the driver, like in the (untested) patch below. > > Rafael > > > --- > drivers/cpufreq/acpi-cpufreq.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > Index: linux-pm/drivers/cpufreq/acpi-cpufreq.c > =================================================================== > --- linux-pm.orig/drivers/cpufreq/acpi-cpufreq.c > +++ linux-pm/drivers/cpufreq/acpi-cpufreq.c > @@ -988,10 +988,10 @@ static int __init acpi_cpufreq_init(void > > /* don't keep reloading if cpufreq_driver exists */ > if (cpufreq_get_current_driver()) > - return 0; > + return -EEXIST; > > if (acpi_disabled) > - return 0; > + return -ENODEV; > > pr_debug("acpi_cpufreq_init\n"); Much better.. And probably the first return has caused the bug Linus faced.. Acked-by: Viresh Kumar <viresh.kumar@linaro.org> -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Fri, Oct 25, 2013 at 11:10 AM, Rafael J. Wysocki <rjw@rjwysocki.net> wrote: > On Friday, October 25, 2013 11:51:40 AM Rafael J. Wysocki wrote: > > /* don't keep reloading if cpufreq_driver exists */ > if (cpufreq_get_current_driver()) > - return 0; > + return -EEXIST; > > if (acpi_disabled) > - return 0; > + return -ENODEV; > > pr_debug("acpi_cpufreq_init\n"); I think: - EBUSY is a better error return than EEXIST here/ - do the ENODEV case first, because claiming something is busy when you couldn't have used it anyway is kind of stupid) but yeah, this looks like the right thing. Let's make sure there aren't any annoying error messages etc printed out as a result of this, though. Linus -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Index: linux-pm/drivers/cpufreq/acpi-cpufreq.c =================================================================== --- linux-pm.orig/drivers/cpufreq/acpi-cpufreq.c +++ linux-pm/drivers/cpufreq/acpi-cpufreq.c @@ -988,10 +988,10 @@ static int __init acpi_cpufreq_init(void /* don't keep reloading if cpufreq_driver exists */ if (cpufreq_get_current_driver()) - return 0; + return -EEXIST; if (acpi_disabled) - return 0; + return -ENODEV; pr_debug("acpi_cpufreq_init\n");