Lines Matching refs:slot

21 	struct pci_slot *slot = to_pci_slot(kobj);
23 return attribute->show ? attribute->show(slot, buf) : -EIO;
29 struct pci_slot *slot = to_pci_slot(kobj);
31 return attribute->store ? attribute->store(slot, buf, len) : -EIO;
39 static ssize_t address_read_file(struct pci_slot *slot, char *buf)
41 if (slot->number == 0xff)
43 pci_domain_nr(slot->bus),
44 slot->bus->number);
47 pci_domain_nr(slot->bus),
48 slot->bus->number,
49 slot->number);
57 static ssize_t max_speed_read_file(struct pci_slot *slot, char *buf)
59 return bus_speed_read(slot->bus->max_bus_speed, buf);
62 static ssize_t cur_speed_read_file(struct pci_slot *slot, char *buf)
64 return bus_speed_read(slot->bus->cur_bus_speed, buf);
70 struct pci_slot *slot = to_pci_slot(kobj);
72 dev_dbg(&slot->bus->dev, "dev %02x, released physical slot %s\n",
73 slot->number, pci_slot_name(slot));
76 list_for_each_entry(dev, &slot->bus->devices, bus_list)
77 if (PCI_SLOT(dev->devfn) == slot->number)
78 dev->slot = NULL;
81 list_del(&slot->list);
83 kfree(slot);
145 static int rename_slot(struct pci_slot *slot, const char *name)
150 if (strcmp(pci_slot_name(slot), name) == 0)
157 result = kobject_rename(&slot->kobj, slot_name);
165 struct pci_slot *slot;
168 list_for_each_entry(slot, &dev->bus->slots, list)
169 if (PCI_SLOT(dev->devfn) == slot->number)
170 dev->slot = slot;
176 struct pci_slot *slot;
179 list_for_each_entry(slot, &parent->slots, list)
180 if (slot->number == slot_nr) {
181 kobject_get(&slot->kobj);
182 return slot;
189 * pci_create_slot - create or increment refcount for physical PCI slot
207 * The first slot is assigned N
208 * The second slot is assigned N-1
209 * The third slot is assigned N-2
214 * a slot. There is one notable exception - pSeries (rpaphp), where the
216 * the slot. In this scenario, the caller may pass -1 for @slot_nr.
224 * the 'placeholder' slot will not be displayed.
231 struct pci_slot *slot;
241 * Hotplug drivers are allowed to rename an existing slot,
244 slot = get_slot(parent, slot_nr);
245 if (slot) {
247 if ((err = slot->hotplug ? -EBUSY : 0)
248 || (err = rename_slot(slot, name))) {
249 kobject_put(&slot->kobj);
250 slot = NULL;
258 slot = kzalloc(sizeof(*slot), GFP_KERNEL);
259 if (!slot) {
264 slot->bus = parent;
265 slot->number = slot_nr;
267 slot->kobj.kset = pci_slots_kset;
272 kfree(slot);
276 INIT_LIST_HEAD(&slot->list);
277 list_add(&slot->list, &parent->slots);
279 err = kobject_init_and_add(&slot->kobj, &pci_slot_ktype, NULL,
282 kobject_put(&slot->kobj);
289 dev->slot = slot;
292 dev_dbg(&parent->dev, "dev %02x, created physical slot %s\n",
293 slot_nr, pci_slot_name(slot));
298 return slot;
300 slot = ERR_PTR(err);
306 * pci_destroy_slot - decrement refcount for physical PCI slot
307 * @slot: struct pci_slot to decrement
313 void pci_destroy_slot(struct pci_slot *slot)
315 dev_dbg(&slot->bus->dev, "dev %02x, dec refcount to %d\n",
316 slot->number, kref_read(&slot->kobj.kref) - 1);
319 kobject_put(&slot->kobj);
335 struct hotplug_slot *slot = pci_slot->hotplug;
339 if (!slot || !slot->ops)
341 kobj = kset_find_obj(module_kset, slot->mod_name);