diff options
author | Yinghai Lu <yinghai@kernel.org> | 2012-04-02 21:31:53 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2012-04-30 16:52:43 -0400 |
commit | fe05725ff97530e26109a0c3d52cef7fff326e15 (patch) | |
tree | 7be6854dbfb4912cbd58aaa6e18a9af63c100f74 /arch/x86/pci | |
parent | fd3b0c1ea482e863d6a2556b6686e35bec7a4f1c (diff) |
x86/PCI: embed name into pci_root_info struct
We now keep the pci_root_info struct for the entire lifetime of the
host bridge, so just embed the name in the struct rather than
allocating it separately.
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'arch/x86/pci')
-rw-r--r-- | arch/x86/pci/acpi.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c index 2b74a161d215..23e7361b1747 100644 --- a/arch/x86/pci/acpi.c +++ b/arch/x86/pci/acpi.c | |||
@@ -9,7 +9,7 @@ | |||
9 | 9 | ||
10 | struct pci_root_info { | 10 | struct pci_root_info { |
11 | struct acpi_device *bridge; | 11 | struct acpi_device *bridge; |
12 | char *name; | 12 | char name[16]; |
13 | unsigned int res_num; | 13 | unsigned int res_num; |
14 | struct resource *res; | 14 | struct resource *res; |
15 | int busnum; | 15 | int busnum; |
@@ -317,7 +317,6 @@ static void add_resources(struct pci_root_info *info, | |||
317 | 317 | ||
318 | static void free_pci_root_info_res(struct pci_root_info *info) | 318 | static void free_pci_root_info_res(struct pci_root_info *info) |
319 | { | 319 | { |
320 | kfree(info->name); | ||
321 | kfree(info->res); | 320 | kfree(info->res); |
322 | info->res = NULL; | 321 | info->res = NULL; |
323 | info->res_num = 0; | 322 | info->res_num = 0; |
@@ -370,9 +369,7 @@ probe_pci_root_info(struct pci_root_info *info, struct acpi_device *device, | |||
370 | if (!info->res) | 369 | if (!info->res) |
371 | return; | 370 | return; |
372 | 371 | ||
373 | info->name = kasprintf(GFP_KERNEL, "PCI Bus %04x:%02x", domain, busnum); | 372 | sprintf(info->name, "PCI Bus %04x:%02x", domain, busnum); |
374 | if (!info->name) | ||
375 | return; | ||
376 | 373 | ||
377 | acpi_walk_resources(device->handle, METHOD_NAME__CRS, setup_resource, | 374 | acpi_walk_resources(device->handle, METHOD_NAME__CRS, setup_resource, |
378 | info); | 375 | info); |