login
Header Space

 
 

[PATCH 1/4, v3] PCI Hotplug: Remove path attribute from sgi_hotplug

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Gary Hade <garyhade@...>, Matthew Wilcox <matthew@...>, <gregkh@...>, <kristen.c.accardi@...>, <lenb@...>, <rick.jones2@...>, <linux-kernel@...>, <linux-pci@...>, <kaneshige.kenji@...>, <pcihpd-discuss@...>, <linux-acpi@...>
Date: Saturday, November 17, 2007 - 2:35 pm

Rename the slot to be the contents of the 'path' sysfs attribute, and
delete the attribute.  The mapping from pci address to slot name is
supposed to be done through the 'address' file, which will be provided
automatically later in this series of patches.

Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Matthew Wilcox <matthew@wil.cx>
---
 drivers/pci/hotplug/sgi_hotplug.c |   32 +-------------------------------
 1 files changed, 1 insertions(+), 31 deletions(-)

diff --git a/drivers/pci/hotplug/sgi_hotplug.c b/drivers/pci/hotplug/sgi_hotplug.c
index ef07c36..693519e 100644
--- a/drivers/pci/hotplug/sgi_hotplug.c
+++ b/drivers/pci/hotplug/sgi_hotplug.c
@@ -91,21 +91,6 @@ static struct hotplug_slot_ops sn_hotplug_slot_ops = {
 
 static DEFINE_MUTEX(sn_hotplug_mutex);
 
-static ssize_t path_show (struct hotplug_slot *bss_hotplug_slot,
-	       		  char *buf)
-{
-	int retval = -ENOENT;
-	struct slot *slot = bss_hotplug_slot->private;
-
-	if (!slot)
-		return retval;
-
-	retval = sprintf (buf, "%s\n", slot->physical_path);
-	return retval;
-}
-
-static struct hotplug_slot_attribute sn_slot_path_attr = __ATTR_RO(path);
-
 static int sn_pci_slot_valid(struct pci_bus *pci_bus, int device)
 {
 	struct pcibus_info *pcibus_info;
@@ -173,18 +158,10 @@ static int sn_hp_slot_private_alloc(struct hotplug_slot *bss_hotplug_slot,
 		return -ENOMEM;
 	bss_hotplug_slot->private = slot;
 
-	bss_hotplug_slot->name = kmalloc(SN_SLOT_NAME_SIZE, GFP_KERNEL);
-	if (!bss_hotplug_slot->name) {
-		kfree(bss_hotplug_slot->private);
-		return -ENOMEM;
-	}
+	bss_hotplug_slot->name = slot->physical_path;
 
 	slot->device_num = device;
 	slot->pci_bus = pci_bus;
-	sprintf(bss_hotplug_slot->name, "%04x:%02x:%02x",
-		pci_domain_nr(pci_bus),
-		((u16)pcibus_info->pbi_buscommon.bs_persist_busnum),
-		device + 1);
 
 	sn_generate_path(pci_bus, slot->physical_path);
 
@@ -203,8 +180,6 @@ static struct hotplug_slot * sn_hp_destroy(void)
 		bss_hotplug_slot = slot->hotplug_slot;
 		list_del(&((struct slot *)bss_hotplug_slot->private)->
 			 hp_list);
-		sysfs_remove_file(&bss_hotplug_slot->kobj,
-				  &sn_slot_path_attr.attr);
 		break;
 	}
 	return bss_hotplug_slot;
@@ -653,11 +628,6 @@ static int sn_hotplug_slot_register(struct pci_bus *pci_bus)
 		rc = pci_hp_register(bss_hotplug_slot);
 		if (rc)
 			goto register_err;
-
-		rc = sysfs_create_file(&bss_hotplug_slot->kobj,
-				       &sn_slot_path_attr.attr);
-		if (rc)
-			goto register_err;
 	}
 	dev_dbg(&pci_bus->self->dev, "Registered bus with hotplug\n");
 	return rc;
-- 
1.5.3.1.1.g1e61

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

Messages in current thread:
[PATCH 0/4, v3] Physical PCI slot objects, Alex Chiang, (Sat Nov 17, 2:29 pm)
Re: [PATCH 0/4, v3] Physical PCI slot objects, Gary Hade, (Mon Nov 19, 7:32 pm)
Re: [PATCH 0/4, v3] Physical PCI slot objects, Alex Chiang, (Mon Nov 26, 6:22 pm)
Re: [PATCH 0/4, v3] Physical PCI slot objects, Kenji Kaneshige, (Thu Nov 29, 3:47 am)
Re: [PATCH 0/4, v3] Physical PCI slot objects, Kristen Carlson Accardi, (Tue Mar 11, 3:15 pm)
Re: [PATCH 0/4, v3] Physical PCI slot objects, Kenji Kaneshige, (Wed Mar 12, 8:25 am)
Re: [PATCH 0/4, v3] Physical PCI slot objects, Alex Chiang, (Thu Nov 29, 9:51 pm)
Re: [PATCH 0/4, v3] Physical PCI slot objects, Kenji Kaneshige, (Sun Dec 2, 11:30 pm)
Re: [PATCH 0/4, v3] Physical PCI slot objects, Alex Chiang, (Mon Dec 3, 6:43 pm)
Re: [PATCH 0/4, v3] Physical PCI slot objects, Kenji Kaneshige, (Tue Dec 4, 8:57 am)
Re: [PATCH 0/4, v3] Physical PCI slot objects, Alex Chiang, (Mon Dec 10, 7:02 pm)
Re: [PATCH 0/4, v3] Physical PCI slot objects, Gary Hade, (Mon Nov 26, 11:04 pm)
Re: [PATCH 0/4, v3] Physical PCI slot objects, Kristen Carlson Accardi, (Tue Nov 27, 3:11 pm)
Re: [PATCH 0/4, v3] Physical PCI slot objects, Gary Hade, (Wed Nov 28, 5:31 pm)
Re: [PATCH 0/4, v3] Physical PCI slot objects, Alex Chiang, (Thu Nov 29, 9:19 pm)
Re: [PATCH 0/4, v3] Physical PCI slot objects, Gary Hade, (Fri Nov 30, 3:10 pm)
Re: [PATCH 0/4, v3] Physical PCI slot objects, Kristen Carlson Accardi, (Wed Nov 28, 8:02 pm)
Re: [PATCH 0/4, v3] Physical PCI slot objects, Gary Hade, (Wed Nov 28, 9:09 pm)
[PATCH 3/4, v5] PCI, PCI Hotplug: Introduce pci_slot, Alex Chiang, (Mon Nov 26, 6:26 pm)
Re: [PATCH 0/4, v3] Physical PCI slot objects, Matthew Garrett, (Mon Nov 19, 10:04 pm)
Re: [PATCH 0/4, v3] Physical PCI slot objects, Gary Hade, (Tue Nov 20, 3:53 pm)
Re: [PATCH 0/4, v3] Physical PCI slot objects, Kenji Kaneshige, (Mon Nov 19, 9:33 pm)
Re: [PATCH 0/4, v3] Physical PCI slot objects, Kristen Carlson Accardi, (Mon Nov 19, 1:43 pm)
Re: [PATCH 0/4, v3] Physical PCI slot objects, Alex Chiang, (Mon Nov 19, 6:02 pm)
Re: [PATCH 0/4, v3] Physical PCI slot objects, Alex Chiang, (Mon Nov 19, 1:57 pm)
[PATCH 3/4, v3] PCI, PCI Hotplug: Introduce pci_slot, Alex Chiang, (Sat Nov 17, 2:37 pm)
[PATCH 3/4, v4] PCI, PCI Hotplug: Introduce pci_slot, Alex Chiang, (Mon Nov 19, 6:03 pm)
[PATCH 1/4, v3] PCI Hotplug: Remove path attribute from sgi_..., Alex Chiang, (Sat Nov 17, 2:35 pm)
speck-geostationary