summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/button.c
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2016-07-29 17:08:41 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-08-03 01:27:20 +0200
commite370cc8640305aa2fa42b852cccd89e80c28d9a0 (patch)
treea263b28989724854720f2d1a02fdb6fdaad3ebcb /drivers/acpi/button.c
parent3540c32a9ae4cb23ab70f7798f45affc02762fa7 (diff)
downloadop-kernel-dev-e370cc8640305aa2fa42b852cccd89e80c28d9a0.zip
op-kernel-dev-e370cc8640305aa2fa42b852cccd89e80c28d9a0.tar.gz
ACPI / button: remove pointer to old lid_sysfs on unbind
When we removed the procfs dir on error or if the driver is unbound, the two variables acpi_lid_dir and acpi_button_dir were not reset. On the next rebind, those static variables were not null and we couldn't re-register the device again. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Acked-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/button.c')
-rw-r--r--drivers/acpi/button.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
index 148f4e5..31abb0b 100644
--- a/drivers/acpi/button.c
+++ b/drivers/acpi/button.c
@@ -232,8 +232,10 @@ remove_dev_dir:
acpi_device_dir(device) = NULL;
remove_lid_dir:
remove_proc_entry(ACPI_BUTTON_SUBCLASS_LID, acpi_button_dir);
+ acpi_lid_dir = NULL;
remove_button_dir:
remove_proc_entry(ACPI_BUTTON_CLASS, acpi_root_dir);
+ acpi_button_dir = NULL;
goto done;
}
@@ -250,7 +252,9 @@ static int acpi_button_remove_fs(struct acpi_device *device)
acpi_lid_dir);
acpi_device_dir(device) = NULL;
remove_proc_entry(ACPI_BUTTON_SUBCLASS_LID, acpi_button_dir);
+ acpi_lid_dir = NULL;
remove_proc_entry(ACPI_BUTTON_CLASS, acpi_root_dir);
+ acpi_button_dir = NULL;
return 0;
}
OpenPOWER on IntegriCloud