diff options
author | Alex Chiang <achiang@hp.com> | 2008-10-20 19:41:28 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2008-10-22 19:42:41 -0400 |
commit | 43caae884b5a5e2eacb4879225341cb49700e129 (patch) | |
tree | d34ef95c875e1e89b3b01ec0dc58849f5750e223 /drivers/pci | |
parent | 0ad772ec464d3fcf9d210836b97e654f393606c4 (diff) |
PCI: fakephp: remove 'name' parameter
Remove 'name' from fakephp's struct dummy_slot, as the PCI core
will now manage our slot name for us.
Cc: jbarnes@virtuousgeek.org
Cc: kristen.c.accardi@intel.com
Acked-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/hotplug/fakephp.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/pci/hotplug/fakephp.c b/drivers/pci/hotplug/fakephp.c index 3069f2153832..24dcbf13e98b 100644 --- a/drivers/pci/hotplug/fakephp.c +++ b/drivers/pci/hotplug/fakephp.c | |||
@@ -66,7 +66,6 @@ struct dummy_slot { | |||
66 | struct pci_dev *dev; | 66 | struct pci_dev *dev; |
67 | struct work_struct remove_work; | 67 | struct work_struct remove_work; |
68 | unsigned long removed; | 68 | unsigned long removed; |
69 | char name[8]; | ||
70 | }; | 69 | }; |
71 | 70 | ||
72 | static int debug; | 71 | static int debug; |
@@ -96,10 +95,13 @@ static void dummy_release(struct hotplug_slot *slot) | |||
96 | kfree(dslot); | 95 | kfree(dslot); |
97 | } | 96 | } |
98 | 97 | ||
98 | #define SLOT_NAME_SIZE 8 | ||
99 | |||
99 | static int add_slot(struct pci_dev *dev) | 100 | static int add_slot(struct pci_dev *dev) |
100 | { | 101 | { |
101 | struct dummy_slot *dslot; | 102 | struct dummy_slot *dslot; |
102 | struct hotplug_slot *slot; | 103 | struct hotplug_slot *slot; |
104 | char name[SLOT_NAME_SIZE]; | ||
103 | int retval = -ENOMEM; | 105 | int retval = -ENOMEM; |
104 | static int count = 1; | 106 | static int count = 1; |
105 | 107 | ||
@@ -119,20 +121,18 @@ static int add_slot(struct pci_dev *dev) | |||
119 | if (!dslot) | 121 | if (!dslot) |
120 | goto error_info; | 122 | goto error_info; |
121 | 123 | ||
122 | slot->name = dslot->name; | 124 | snprintf(name, SLOT_NAME_SIZE, "fake%d", count++); |
123 | snprintf(slot->name, sizeof(dslot->name), "fake%d", count++); | ||
124 | dbg("slot->name = %s\n", slot->name); | ||
125 | slot->ops = &dummy_hotplug_slot_ops; | 125 | slot->ops = &dummy_hotplug_slot_ops; |
126 | slot->release = &dummy_release; | 126 | slot->release = &dummy_release; |
127 | slot->private = dslot; | 127 | slot->private = dslot; |
128 | 128 | ||
129 | retval = pci_hp_register(slot, dev->bus, PCI_SLOT(dev->devfn), | 129 | retval = pci_hp_register(slot, dev->bus, PCI_SLOT(dev->devfn), name); |
130 | slot->name); | ||
131 | if (retval) { | 130 | if (retval) { |
132 | err("pci_hp_register failed with error %d\n", retval); | 131 | err("pci_hp_register failed with error %d\n", retval); |
133 | goto error_dslot; | 132 | goto error_dslot; |
134 | } | 133 | } |
135 | 134 | ||
135 | dbg("slot->name = %s\n", hotplug_slot_name(slot)); | ||
136 | dslot->slot = slot; | 136 | dslot->slot = slot; |
137 | dslot->dev = pci_dev_get(dev); | 137 | dslot->dev = pci_dev_get(dev); |
138 | list_add (&dslot->node, &slot_list); | 138 | list_add (&dslot->node, &slot_list); |
@@ -168,10 +168,11 @@ static void remove_slot(struct dummy_slot *dslot) | |||
168 | { | 168 | { |
169 | int retval; | 169 | int retval; |
170 | 170 | ||
171 | dbg("removing slot %s\n", dslot->slot->name); | 171 | dbg("removing slot %s\n", hotplug_slot_name(dslot->slot)); |
172 | retval = pci_hp_deregister(dslot->slot); | 172 | retval = pci_hp_deregister(dslot->slot); |
173 | if (retval) | 173 | if (retval) |
174 | err("Problem unregistering a slot %s\n", dslot->slot->name); | 174 | err("Problem unregistering a slot %s\n", |
175 | hotplug_slot_name(dslot->slot)); | ||
175 | } | 176 | } |
176 | 177 | ||
177 | /* called from the single-threaded workqueue handler to remove a slot */ | 178 | /* called from the single-threaded workqueue handler to remove a slot */ |
@@ -309,7 +310,7 @@ static int disable_slot(struct hotplug_slot *slot) | |||
309 | return -ENODEV; | 310 | return -ENODEV; |
310 | dslot = slot->private; | 311 | dslot = slot->private; |
311 | 312 | ||
312 | dbg("%s - physical_slot = %s\n", __func__, slot->name); | 313 | dbg("%s - physical_slot = %s\n", __func__, hotplug_slot_name(slot)); |
313 | 314 | ||
314 | for (func = 7; func >= 0; func--) { | 315 | for (func = 7; func >= 0; func--) { |
315 | dev = pci_get_slot(dslot->dev->bus, dslot->dev->devfn + func); | 316 | dev = pci_get_slot(dslot->dev->bus, dslot->dev->devfn + func); |