acpiphp - adds spin_lock/_unlock
PATCH 7/7 acpiphp - adds spin_lock/_unlock
This patch adds spin_lock/_unlock to protect slot list_add and list_del.
Signed-off-by MUNEDA Takahiro <[email protected]>
drivers/pci/hotplug/acpiphp_core.c | 5 +++++ 1 files changed, 5 insertions(+)
drivers/pci/hotplug/acpiphp_core.c +5 -0
@@ -45,6 +45,7 @@#include "acpiphp.h" static LIST_HEAD (slot_list); +static DEFINE_SPINLOCK (list_lock);#define MY_NAME "acpiphp"
@@ -387,7 +388,9 @@ int acpiphp_register_hotplug_slot(struct }/* add slot to our internal list */ +spin_lock (&list_lock);list_add (&slot->slot_list, &slot_list); +spin_unlock (&list_lock);info ("Slot [%s] registered\n" , slot->hotplug_slot->name);return 0 ;
@@ -416,7 +419,9 @@ void acpiphp_unregister_hotplug_slot(strif (slot->acpi_slot->sun != acpiphp_slot->sun)continue ; +spin_lock (&list_lock);list_del (&slot->slot_list); +spin_unlock (&list_lock);info ("Slot [%s] unregistered\n" , slot->hotplug_slot->name); retval =pci_hp_deregister (slot->hotplug_slot);