[PATCH v3 13/14] PCI: Hotplug core: remove 'name'

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Alex Chiang
Date: Tuesday, September 23, 2008 - 9:46 am

Now that the PCI core manages the 'name' for each individual
hotplug driver, and all drivers have been converted to use
hotplug_slot_name(), there is no need for the PCI hotplug
core to drag around its own copy of name either.

Cc: jbarnes@virtuousgeek.org
Cc: kristen.c.accardi@intel.com
Cc: matthew@wil.cx
Cc: kaneshige.kenji@jp.fujitsu.com
Signed-off-by: Alex Chiang <achiang@hp.com>
---

 drivers/pci/hotplug/pci_hotplug_core.c |    6 +++---
 include/linux/pci_hotplug.h            |    3 ---
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/pci/hotplug/pci_hotplug_core.c b/drivers/pci/hotplug/pci_hotplug_core.c
index 46802dc..2a29ad0 100644
--- a/drivers/pci/hotplug/pci_hotplug_core.c
+++ b/drivers/pci/hotplug/pci_hotplug_core.c
@@ -533,7 +533,7 @@ static struct hotplug_slot *get_slot_from_name (const char *name)
 	spin_lock(&pci_hotplug_slot_list_lock);
 	list_for_each (tmp, &pci_hotplug_slot_list) {
 		slot = list_entry (tmp, struct hotplug_slot, slot_list);
-		if (strcmp(slot->name, name) == 0)
+		if (strcmp(hotplug_slot_name(slot), name) == 0)
 			goto out;
 	}
 	slot = NULL;
@@ -628,7 +628,7 @@ int pci_hp_deregister(struct hotplug_slot *hotplug)
 	if (!hotplug)
 		return -ENODEV;
 
-	temp = get_slot_from_name(hotplug->name);
+	temp = get_slot_from_name(hotplug_slot_name(hotplug));
 	if (temp != hotplug)
 		return -ENODEV;
 
@@ -638,7 +638,7 @@ int pci_hp_deregister(struct hotplug_slot *hotplug)
 
 	slot = hotplug->pci_slot;
 	fs_remove_slot(slot);
-	dbg("Removed slot %s from the list\n", hotplug->name);
+	dbg("Removed slot %s from the list\n", hotplug_slot_name(hotplug));
 
 	hotplug->release(hotplug);
 	slot->hotplug = NULL;
diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h
index 7184bee..9899ea3 100644
--- a/include/linux/pci_hotplug.h
+++ b/include/linux/pci_hotplug.h
@@ -142,8 +142,6 @@ struct hotplug_slot_info {
 
 /**
  * struct hotplug_slot - used to register a physical slot with the hotplug pci core
- * @name: the name of the slot being registered.  This string must
- * be unique amoung slots registered on this system.
  * @ops: pointer to the &struct hotplug_slot_ops to be used for this slot
  * @info: pointer to the &struct hotplug_slot_info for the initial values for
  * this slot.
@@ -153,7 +151,6 @@ struct hotplug_slot_info {
  * needs.
  */
 struct hotplug_slot {
-	char				*name;
 	struct hotplug_slot_ops		*ops;
 	struct hotplug_slot_info	*info;
 	void (*release) (struct hotplug_slot *slot);

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH v3 00/14] PCI: let the core manage slot names, Alex Chiang, (Tue Sep 23, 9:45 am)
[PATCH v3 02/14] PCI: prevent duplicate slot names, Alex Chiang, (Tue Sep 23, 9:45 am)
[PATCH v3 04/14] PCI: acpiphp: remove 'name' parameter, Alex Chiang, (Tue Sep 23, 9:45 am)
[PATCH v3 07/14] PCI: fakephp: remove 'name' parameter, Alex Chiang, (Tue Sep 23, 9:45 am)
[PATCH v3 09/14] PCI: pciehp: remove 'name' parameter, Alex Chiang, (Tue Sep 23, 9:45 am)
[PATCH v3 12/14] PCI: shcphp: remove 'name' parameter, Alex Chiang, (Tue Sep 23, 9:46 am)
[PATCH v3 13/14] PCI: Hotplug core: remove 'name', Alex Chiang, (Tue Sep 23, 9:46 am)
Re: [PATCH v3 00/14] PCI: let the core manage slot names, Kenji Kaneshige, (Wed Sep 24, 1:47 am)