From 7cc9f0d9a1ab04cedc60d64fd8dcf7df224a3b4d Mon Sep 17 00:00:00 2001 From: Dave Jones Date: Fri, 19 Mar 2004 20:35:52 +0000 Subject: [CPUFREQ] If ->init fails, unregister cpufreq driver. Some cpufreq drivers can only tell whether they work while the per-CPU ->init() function is executed [e.g. the acpi driver]. So that cpufreq_driver isn't blocked by such stale drivers, unload them unless the driver sets a special flag. --- include/linux/cpufreq.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/linux') diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 3a8e279897ed..f48a064221b4 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -175,6 +175,7 @@ struct freq_attr; struct cpufreq_driver { struct module *owner; char name[CPUFREQ_NAME_LEN]; + u8 flags; /* needed by all drivers */ int (*init) (struct cpufreq_policy *policy); @@ -192,6 +193,11 @@ struct cpufreq_driver { struct freq_attr **attr; }; +/* flags */ + +#define CPUFREQ_STICKY 0x01 /* the driver isn't removed even if + all ->init() calls failed */ + int cpufreq_register_driver(struct cpufreq_driver *driver_data); int cpufreq_unregister_driver(struct cpufreq_driver *driver_data); -- cgit v1.2.3