Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e370cc86 authored by Benjamin Tissoires's avatar Benjamin Tissoires Committed by Rafael J. Wysocki
Browse files

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: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: default avatarLv Zheng <lv.zheng@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 3540c32a
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -232,8 +232,10 @@ static int acpi_button_add_fs(struct acpi_device *device)
	acpi_device_dir(device) = NULL;
	acpi_device_dir(device) = NULL;
remove_lid_dir:
remove_lid_dir:
	remove_proc_entry(ACPI_BUTTON_SUBCLASS_LID, acpi_button_dir);
	remove_proc_entry(ACPI_BUTTON_SUBCLASS_LID, acpi_button_dir);
	acpi_lid_dir = NULL;
remove_button_dir:
remove_button_dir:
	remove_proc_entry(ACPI_BUTTON_CLASS, acpi_root_dir);
	remove_proc_entry(ACPI_BUTTON_CLASS, acpi_root_dir);
	acpi_button_dir = NULL;
	goto done;
	goto done;
}
}


@@ -250,7 +252,9 @@ static int acpi_button_remove_fs(struct acpi_device *device)
			  acpi_lid_dir);
			  acpi_lid_dir);
	acpi_device_dir(device) = NULL;
	acpi_device_dir(device) = NULL;
	remove_proc_entry(ACPI_BUTTON_SUBCLASS_LID, acpi_button_dir);
	remove_proc_entry(ACPI_BUTTON_SUBCLASS_LID, acpi_button_dir);
	acpi_lid_dir = NULL;
	remove_proc_entry(ACPI_BUTTON_CLASS, acpi_root_dir);
	remove_proc_entry(ACPI_BUTTON_CLASS, acpi_root_dir);
	acpi_button_dir = NULL;


	return 0;
	return 0;
}
}