Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1452255
| From | "Zheng, Lv" <lv.zheng@intel.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | RE: [PATCH] ACPI / button: remove pointer to old lid_sysfs on unbind |
| Date | 2016-07-29 06:40 +0200 |
| Message-ID | <s07Kx-8d5-1@gated-at.bofh.it> (permalink) |
| References | <rZQA2-4S8-25@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hi, Benjamin > From: linux-acpi-owner@vger.kernel.org [mailto:linux-acpi- > owner@vger.kernel.org] On Behalf Of Benjamin Tissoires > Subject: [PATCH] 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> > --- > drivers/acpi/button.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c > index 5c3b091..e413599 100644 > --- a/drivers/acpi/button.c > +++ b/drivers/acpi/button.c > @@ -188,9 +188,11 @@ done: [Lv Zheng] I have a concern here for acpi_button_add_fs(). It looks like that this function doesn't support 2 lid devices. So why do we need /proc/acpi/button/lid/LID0 folder? > remove_dev_dir: > remove_proc_entry(acpi_device_bid(device), > acpi_lid_dir); > + acpi_lid_dir = NULL; > acpi_device_dir(device) = NULL; > remove_lid_dir: > remove_proc_entry(ACPI_BUTTON_SUBCLASS_LID, > acpi_button_dir); [Lv Zheng] Should acpi_lid_dir = NULL be put here? > + acpi_button_dir = NULL; > remove_button_dir: > remove_proc_entry(ACPI_BUTTON_CLASS, acpi_root_dir); [Lv Zheng] Should acpi_button_dir = NULL be put here? > goto done; > @@ -207,8 +209,10 @@ static int acpi_button_remove_fs(struct > acpi_device *device) > acpi_device_dir(device)); > remove_proc_entry(acpi_device_bid(device), > acpi_lid_dir); > + acpi_lid_dir = NULL; > acpi_device_dir(device) = NULL; > remove_proc_entry(ACPI_BUTTON_SUBCLASS_LID, > acpi_button_dir); [Lv Zheng] Should acpi_lid_dir = NULL be put here? > + acpi_button_dir = NULL; > remove_proc_entry(ACPI_BUTTON_CLASS, acpi_root_dir); [Lv Zheng] Should acpi_button_dir = NULL be put here? Thanks and best regards Lv > > return 0; > -- > 2.5.5 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-acpi" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] ACPI / button: remove pointer to old lid_sysfs on unbind Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2016-07-28 12:20 +0200
RE: [PATCH] ACPI / button: remove pointer to old lid_sysfs on unbind "Zheng, Lv" <lv.zheng@intel.com> - 2016-07-29 06:40 +0200
Re: [PATCH] ACPI / button: remove pointer to old lid_sysfs on unbind Benjamin Tissoires <benjamin.tissoires@redhat.com> - 2016-07-29 10:00 +0200
csiph-web