All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] ACPI / button: remove pointer to old lid_sysfs on unbind
@ 2016-07-29 15:08 Benjamin Tissoires
  2016-08-01  0:35 ` Zheng, Lv
  0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Tissoires @ 2016-07-29 15:08 UTC (permalink / raw)
  To: Rafael J. Wysocki, Lv Zheng; +Cc: linux-acpi, linux-kernel

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>

--
changes in v2:
- put the NULL assignments at their correct place
---
 drivers/acpi/button.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
index 5c3b091..a3873b3 100644
--- a/drivers/acpi/button.c
+++ b/drivers/acpi/button.c
@@ -191,8 +191,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;
 }
 
@@ -209,7 +211,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;
 }
-- 
2.5.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: [PATCH v2] ACPI / button: remove pointer to old lid_sysfs on unbind
  2016-07-29 15:08 [PATCH v2] ACPI / button: remove pointer to old lid_sysfs on unbind Benjamin Tissoires
@ 2016-08-01  0:35 ` Zheng, Lv
  0 siblings, 0 replies; 2+ messages in thread
From: Zheng, Lv @ 2016-08-01  0:35 UTC (permalink / raw)
  To: Benjamin Tissoires, Rafael J. Wysocki; +Cc: linux-acpi, linux-kernel

Hi, Benjamin

> From: Benjamin Tissoires [mailto:benjamin.tissoires@redhat.com]
> Subject: [PATCH v2] 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>
[Lv Zheng] 
Looks good.
Acked-by: Lv Zheng <lv.zheng@intel.com>

Chhers
Lv

> 
> --
> changes in v2:
> - put the NULL assignments at their correct place
> ---
>  drivers/acpi/button.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
> index 5c3b091..a3873b3 100644
> --- a/drivers/acpi/button.c
> +++ b/drivers/acpi/button.c
> @@ -191,8 +191,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;
>  }
> 
> @@ -209,7 +211,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;
>  }
> --
> 2.5.5


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-08-01  0:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-29 15:08 [PATCH v2] ACPI / button: remove pointer to old lid_sysfs on unbind Benjamin Tissoires
2016-08-01  0:35 ` Zheng, Lv

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.