Skip to content

Commit

Permalink
acpi-cpufreq: Fail initialization if driver cannot be registered
Browse files Browse the repository at this point in the history
Make acpi_cpufreq_init() return error codes when the driver cannot be
registered so that the module doesn't stay useless in memory and so
that acpi_cpufreq_exit() doesn't attempt to unregister things that
have never been registered when the module is unloaded.

Signed-off-by: Rafael J. Wysocki <[email protected]>
Acked-by: Viresh Kumar <[email protected]>
  • Loading branch information
rafaeljw committed Oct 25, 2013
1 parent d3c345d commit 75c0758
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/cpufreq/acpi-cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -986,12 +986,12 @@ static int __init acpi_cpufreq_init(void)
{
int ret;

if (acpi_disabled)
return -ENODEV;

/* don't keep reloading if cpufreq_driver exists */
if (cpufreq_get_current_driver())
return 0;

if (acpi_disabled)
return 0;
return -EEXIST;

pr_debug("acpi_cpufreq_init\n");

Expand Down

0 comments on commit 75c0758

Please sign in to comment.