[PATCH 1/5] Remove path attribute from sgi_hotplug

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <gregkh@...>, <kristen.c.accardi@...>, <lenb@...>, <matthew@...>, <rick.jones2@...>, <linux-kernel@...>, <linux-pci@...>, <pcihpd-discuss@...>, <linux-acpi@...>
Date: Monday, November 12, 2007 - 8:12 pm

[Please note, I got Rick Jones' email screwed up in the 0/5
email; it's corrected above.]

From: Alex Chiang <achiang@hp.com>

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 |   27 +--------------------------
 1 files changed, 1 insertions(+), 26 deletions(-)

diff --git a/drivers/pci/hotplug/sgi_hotplug.c b/drivers/pci/hotplug/sgi_hotplug.c
index ef07c36..e1e7c9d 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;
-- 
1.5.3.1.1.g1e61

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

Messages in current thread:
[PATCH 0/5][RFC] Physical PCI slot objects, Alex Chiang, (Mon Nov 12, 8:08 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Kenji Kaneshige, (Wed Nov 14, 7:43 am)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Greg KH, (Tue Nov 13, 1:01 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Andi Kleen, (Tue Nov 13, 9:07 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Matthew Wilcox, (Wed Nov 14, 10:17 am)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Andi Kleen, (Wed Nov 14, 10:35 am)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Matthew Wilcox, (Wed Nov 14, 11:00 am)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Andi Kleen, (Wed Nov 14, 11:08 am)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Alex Chiang, (Wed Nov 14, 11:20 am)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Matthew Wilcox, (Wed Nov 14, 11:12 am)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Linas Vepstas, (Tue Nov 13, 4:24 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Alex Chiang, (Tue Nov 13, 4:59 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Linas Vepstas, (Tue Nov 13, 5:41 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Matthew Wilcox, (Tue Nov 13, 5:58 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Alex Chiang, (Tue Nov 13, 4:21 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Greg KH, (Tue Nov 13, 4:26 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Matthew Garrett, (Wed Nov 14, 1:44 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Greg KH, (Wed Nov 14, 1:51 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Matthew Garrett, (Wed Nov 14, 2:03 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Kristen Carlson Accardi, (Tue Nov 13, 6:59 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Bjorn Helgaas, (Wed Nov 14, 1:37 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Greg KH, (Wed Nov 14, 1:53 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Alex Chiang, (Wed Nov 14, 5:42 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Greg KH, (Wed Nov 14, 6:00 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Alex Chiang, (Thu Nov 15, 4:20 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Alex Chiang, (Wed Nov 14, 5:24 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Alex Chiang, (Wed Nov 14, 3:53 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Rick Jones, (Tue Nov 13, 6:51 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Greg KH, (Tue Nov 13, 6:56 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Matthew Wilcox, (Tue Nov 13, 7:04 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Kristen Carlson Accardi, (Tue Nov 13, 7:33 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Matthew Wilcox, (Tue Nov 13, 8:10 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Kenji Kaneshige, (Wed Nov 14, 5:55 am)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Kristen Carlson Accardi, (Wed Nov 14, 2:38 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Greg KH, (Tue Nov 13, 7:07 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Scott Murray, (Wed Nov 14, 2:00 am)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Matthew Wilcox, (Tue Nov 13, 2:33 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Greg KH, (Tue Nov 13, 2:51 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Matt Domsch, (Tue Nov 13, 5:15 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Greg KH, (Tue Nov 13, 5:32 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Alex Chiang, (Tue Nov 13, 5:31 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Greg KH, (Tue Nov 13, 5:36 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Alex Chiang, (Tue Nov 13, 7:14 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Alex Chiang, (Tue Nov 13, 4:36 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Greg KH, (Tue Nov 13, 5:30 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Bjorn Helgaas, (Tue Nov 13, 6:01 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Greg KH, (Tue Nov 13, 6:16 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Matthew Wilcox, (Tue Nov 13, 4:11 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Gary Hade, (Tue Nov 13, 7:08 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Alex Chiang, (Wed Nov 14, 10:42 am)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Gary Hade, (Wed Nov 14, 2:13 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Alex Chiang, (Wed Nov 14, 2:36 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Alex Chiang, (Tue Nov 13, 9:37 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Gary Hade, (Wed Nov 14, 8:40 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Alex Chiang, (Thu Nov 15, 1:36 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Gary Hade, (Thu Nov 15, 7:38 pm)
Re: [PATCH 0/5][RFC] Physical PCI slot objects, Greg KH, (Tue Nov 13, 4:19 pm)
[PATCH 4/5, RFC] ACPI PCI slot detection driver, Alex Chiang, (Mon Nov 12, 8:17 pm)
[PATCH 5/5] Add pci_slot_add_hotplug() interface, Alex Chiang, (Mon Nov 12, 8:18 pm)
[PATCH 3/5, RFC] Introduce pci_slot, Alex Chiang, (Mon Nov 12, 8:14 pm)
Re: [PATCH 3/5, RFC] Introduce pci_slot, Linas Vepstas, (Tue Nov 13, 3:56 pm)
Re: [PATCH 3/5, RFC] Introduce pci_slot, Matthew Wilcox, (Tue Nov 13, 4:03 pm)
[PATCH 2/5] Construct one fakephp slot per pci slot, Alex Chiang, (Mon Nov 12, 8:13 pm)
Re: [PATCH 2/5] Construct one fakephp slot per pci slot, Linas Vepstas, (Tue Nov 13, 3:48 pm)
Re: [PATCH 2/5] Construct one fakephp slot per pci slot, Matthew Wilcox, (Tue Nov 13, 3:52 pm)
[PATCH 1/5] Remove path attribute from sgi_hotplug, Alex Chiang, (Mon Nov 12, 8:12 pm)