Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PCI: SGI Hotplug: stop managing bss_hotplug_slot->name

We no longer need to manage our version of hotplug_slot->name
since the PCI and hotplug core manage it on our behalf.

Update the sn_hp_slot_private_alloc() interface to fill in
the correct name for us, as that function already has all
the parameters needed to determine the name.

Cc: kristen.c.accardi@intel.com
Cc: jpk@sgi.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>

authored by

Alex Chiang and committed by
Jesse Barnes
85234ce8 b2132fec

+6 -13
+6 -13
drivers/pci/hotplug/sgi_hotplug.c
··· 161 161 } 162 162 163 163 static int sn_hp_slot_private_alloc(struct hotplug_slot *bss_hotplug_slot, 164 - struct pci_bus *pci_bus, int device) 164 + struct pci_bus *pci_bus, int device, 165 + char *name) 165 166 { 166 167 struct pcibus_info *pcibus_info; 167 168 struct slot *slot; ··· 174 173 return -ENOMEM; 175 174 bss_hotplug_slot->private = slot; 176 175 177 - bss_hotplug_slot->name = kmalloc(SN_SLOT_NAME_SIZE, GFP_KERNEL); 178 - if (!bss_hotplug_slot->name) { 179 - kfree(bss_hotplug_slot->private); 180 - return -ENOMEM; 181 - } 182 - 183 176 slot->device_num = device; 184 177 slot->pci_bus = pci_bus; 185 - sprintf(bss_hotplug_slot->name, "%04x:%02x:%02x", 178 + sprintf(name, "%04x:%02x:%02x", 186 179 pci_domain_nr(pci_bus), 187 180 ((u16)pcibus_info->pbi_buscommon.bs_persist_busnum), 188 181 device + 1); ··· 603 608 static void sn_release_slot(struct hotplug_slot *bss_hotplug_slot) 604 609 { 605 610 kfree(bss_hotplug_slot->info); 606 - kfree(bss_hotplug_slot->name); 607 611 kfree(bss_hotplug_slot->private); 608 612 kfree(bss_hotplug_slot); 609 613 } ··· 612 618 int device; 613 619 struct pci_slot *pci_slot; 614 620 struct hotplug_slot *bss_hotplug_slot; 621 + char name[SN_SLOT_NAME_SIZE]; 615 622 int rc = 0; 616 623 617 624 /* ··· 640 645 } 641 646 642 647 if (sn_hp_slot_private_alloc(bss_hotplug_slot, 643 - pci_bus, device)) { 648 + pci_bus, device, name)) { 644 649 rc = -ENOMEM; 645 650 goto alloc_err; 646 651 } 647 - 648 652 bss_hotplug_slot->ops = &sn_hotplug_slot_ops; 649 653 bss_hotplug_slot->release = &sn_release_slot; 650 654 651 - rc = pci_hp_register(bss_hotplug_slot, pci_bus, device, 652 - bss_hotplug_slot->name); 655 + rc = pci_hp_register(bss_hotplug_slot, pci_bus, device, name); 653 656 if (rc) 654 657 goto register_err; 655 658