Commit f0f84027 authored by Len Brown's avatar Len Brown

Merge intel.com:/home/lenb/src/old/linux-acpi-test-2.6.5

into intel.com:/home/lenb/src/linux-acpi-test-2.6.6
parents a0e99577 9028100e
......@@ -185,6 +185,9 @@ acpi_ac_remove_fs (
ACPI_FUNCTION_TRACE("acpi_ac_remove_fs");
if (acpi_device_dir(device)) {
remove_proc_entry(ACPI_AC_FILE_STATE,
acpi_device_dir(device));
remove_proc_entry(acpi_device_bid(device), acpi_ac_dir);
acpi_device_dir(device) = NULL;
}
......
......@@ -863,6 +863,29 @@ static int __init asus_hotk_add_fs(struct acpi_device *device)
return 0;
}
static int asus_hotk_remove_fs(struct acpi_device* device)
{
struct asus_hotk* hotk = acpi_driver_data(device);
if(acpi_device_dir(device)){
remove_proc_entry(PROC_INFO,acpi_device_dir(device));
if (hotk->methods->mt_wled)
remove_proc_entry(PROC_WLED,acpi_device_dir(device));
if (hotk->methods->mt_mled)
remove_proc_entry(PROC_MLED,acpi_device_dir(device));
if (hotk->methods->mt_tled)
remove_proc_entry(PROC_TLED,acpi_device_dir(device));
if (hotk->methods->mt_lcd_switch && hotk->methods->lcd_status)
remove_proc_entry(PROC_LCD, acpi_device_dir(device));
if ((hotk->methods->brightness_up && hotk->methods->brightness_down) || (hotk->methods->brightness_get && hotk->methods->brightness_get))
remove_proc_entry(PROC_BRN, acpi_device_dir(device));
if (hotk->methods->display_set)
remove_proc_entry(PROC_DISP, acpi_device_dir(device));
}
return 0;
}
static void asus_hotk_notify(acpi_handle handle, u32 event, void *data)
{
......@@ -1111,7 +1134,6 @@ static int __init asus_hotk_add(struct acpi_device *device)
return(result);
}
static int asus_hotk_remove(struct acpi_device *device, int type)
{
acpi_status status = 0;
......@@ -1127,6 +1149,8 @@ static int asus_hotk_remove(struct acpi_device *device, int type)
if (ACPI_FAILURE(status))
printk(KERN_ERR "Asus ACPI: Error removing notify handler\n");
asus_hotk_remove_fs(device);
kfree(hotk);
return(0);
......
......@@ -679,6 +679,13 @@ acpi_battery_remove_fs (
ACPI_FUNCTION_TRACE("acpi_battery_remove_fs");
if (acpi_device_dir(device)) {
remove_proc_entry(ACPI_BATTERY_FILE_ALARM,
acpi_device_dir(device));
remove_proc_entry(ACPI_BATTERY_FILE_STATUS,
acpi_device_dir(device));
remove_proc_entry(ACPI_BATTERY_FILE_INFO,
acpi_device_dir(device));
remove_proc_entry(acpi_device_bid(device), acpi_battery_dir);
acpi_device_dir(device) = NULL;
}
......
......@@ -108,9 +108,6 @@ static struct file_operations acpi_button_state_fops = {
-------------------------------------------------------------------------- */
static struct proc_dir_entry *acpi_button_dir;
extern struct acpi_device *acpi_fixed_pwr_button;
extern struct acpi_device *acpi_fixed_sleep_button;
static int acpi_button_info_seq_show(struct seq_file *seq, void *offset)
{
......@@ -241,6 +238,16 @@ acpi_button_remove_fs (
button = acpi_driver_data(device);
if (acpi_device_dir(device)) {
if (button->type == ACPI_BUTTON_TYPE_LID)
remove_proc_entry(ACPI_BUTTON_FILE_STATE,
acpi_device_dir(device));
remove_proc_entry(ACPI_BUTTON_FILE_INFO,
acpi_device_dir(device));
remove_proc_entry(acpi_device_bid(device),
acpi_device_dir(device)->parent);
switch (button->type) {
case ACPI_BUTTON_TYPE_POWER:
case ACPI_BUTTON_TYPE_POWERF:
......@@ -530,12 +537,6 @@ acpi_button_exit (void)
{
ACPI_FUNCTION_TRACE("acpi_button_exit");
if(acpi_fixed_pwr_button)
acpi_button_remove(acpi_fixed_pwr_button, ACPI_BUS_TYPE_POWER_BUTTON);
if(acpi_fixed_sleep_button)
acpi_button_remove(acpi_fixed_sleep_button, ACPI_BUS_TYPE_SLEEP_BUTTON);
acpi_bus_unregister_driver(&acpi_button_driver);
remove_proc_entry(ACPI_BUTTON_CLASS, acpi_root_dir);
......
......@@ -548,6 +548,12 @@ acpi_ec_remove_fs (
{
ACPI_FUNCTION_TRACE("acpi_ec_remove_fs");
if (acpi_device_dir(device)) {
remove_proc_entry(ACPI_EC_FILE_INFO, acpi_device_dir(device));
remove_proc_entry(acpi_device_bid(device), acpi_ec_dir);
acpi_device_dir(device) = NULL;
}
return_VALUE(0);
}
......
......@@ -185,6 +185,8 @@ acpi_fan_remove_fs (
ACPI_FUNCTION_TRACE("acpi_fan_remove_fs");
if (acpi_device_dir(device)) {
remove_proc_entry(ACPI_FAN_FILE_STATE,
acpi_device_dir(device));
remove_proc_entry(acpi_device_bid(device), acpi_fan_dir);
acpi_device_dir(device) = NULL;
}
......
......@@ -482,6 +482,8 @@ acpi_power_remove_fs (
ACPI_FUNCTION_TRACE("acpi_power_remove_fs");
if (acpi_device_dir(device)) {
remove_proc_entry(ACPI_POWER_FILE_STATUS,
acpi_device_dir(device));
remove_proc_entry(acpi_device_bid(device), acpi_power_dir);
acpi_device_dir(device) = NULL;
}
......
......@@ -4,7 +4,6 @@
#include <linux/init.h>
#include <linux/acpi.h>
#include <linux/module.h>
#include <acpi/acpi_drivers.h>
#include <acpi/acinterp.h> /* for acpi_ex_eisa_id_to_string() */
......@@ -16,12 +15,6 @@ ACPI_MODULE_NAME ("scan")
#define STRUCT_TO_INT(s) (*((int*)&s))
extern struct acpi_device *acpi_root;
struct acpi_device *acpi_fixed_pwr_button;
struct acpi_device *acpi_fixed_sleep_button;
EXPORT_SYMBOL(acpi_fixed_pwr_button);
EXPORT_SYMBOL(acpi_fixed_sleep_button);
#define ACPI_BUS_CLASS "system_bus"
......@@ -909,13 +902,10 @@ acpi_bus_scan_fixed (
struct acpi_device *root)
{
int result = 0;
struct acpi_device *device = NULL;
ACPI_FUNCTION_TRACE("acpi_bus_scan_fixed");
acpi_fixed_pwr_button = NULL;
acpi_fixed_sleep_button = NULL;
if (!root)
return_VALUE(-ENODEV);
......@@ -923,11 +913,11 @@ acpi_bus_scan_fixed (
* Enumerate all fixed-feature devices.
*/
if (acpi_fadt.pwr_button == 0)
result = acpi_bus_add(&acpi_fixed_pwr_button, acpi_root,
result = acpi_bus_add(&device, acpi_root,
NULL, ACPI_BUS_TYPE_POWER_BUTTON);
if (acpi_fadt.sleep_button == 0)
result = acpi_bus_add(&acpi_fixed_sleep_button, acpi_root,
result = acpi_bus_add(&device, acpi_root,
NULL, ACPI_BUS_TYPE_SLEEP_BUTTON);
return_VALUE(result);
......
......@@ -1139,6 +1139,16 @@ acpi_thermal_remove_fs (
ACPI_FUNCTION_TRACE("acpi_thermal_remove_fs");
if (acpi_device_dir(device)) {
remove_proc_entry(ACPI_THERMAL_FILE_POLLING_FREQ,
acpi_device_dir(device));
remove_proc_entry(ACPI_THERMAL_FILE_COOLING_MODE,
acpi_device_dir(device));
remove_proc_entry(ACPI_THERMAL_FILE_TRIP_POINTS,
acpi_device_dir(device));
remove_proc_entry(ACPI_THERMAL_FILE_TEMPERATURE,
acpi_device_dir(device));
remove_proc_entry(ACPI_THERMAL_FILE_STATE,
acpi_device_dir(device));
remove_proc_entry(acpi_device_bid(device), acpi_thermal_dir);
acpi_device_dir(device) = NULL;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment