lkml.org 
[lkml]   [2013]   [Jul]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC][PATCH 13/30] ACPI / hotplug / PCI: Use common slot count variable in register_slot()
Date
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

It is not necessary to use per-bridge slot count fields just in
order to label slots for devices without _SUN, so use a common
static slot_count variable for this purpose and drop the nr_slots
field from struct acpiphp_bridge.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
drivers/pci/hotplug/acpiphp.h | 2 --
drivers/pci/hotplug/acpiphp_glue.c | 7 ++++---
2 files changed, 4 insertions(+), 5 deletions(-)

Index: linux-pm/drivers/pci/hotplug/acpiphp.h
===================================================================
--- linux-pm.orig/drivers/pci/hotplug/acpiphp.h
+++ linux-pm/drivers/pci/hotplug/acpiphp.h
@@ -80,8 +80,6 @@ struct acpiphp_bridge {

struct acpiphp_context *context;

- int nr_slots;
-
u32 flags;

/* This bus (host bridge) or Secondary bus (PCI-to-PCI bridge) */
Index: linux-pm/drivers/pci/hotplug/acpiphp_glue.c
===================================================================
--- linux-pm.orig/drivers/pci/hotplug/acpiphp_glue.c
+++ linux-pm/drivers/pci/hotplug/acpiphp_glue.c
@@ -346,20 +346,21 @@ static acpi_status register_slot(acpi_ha

/* Register slots for ejectable funtions only. */
if (acpi_pci_check_ejectable(pbus, handle) || is_dock_device(handle)) {
+ static unsigned int slot_count;
unsigned long long sun;
int retval;

- bridge->nr_slots++;
+ slot_count++;
status = acpi_evaluate_integer(handle, "_SUN", NULL, &sun);
if (ACPI_FAILURE(status))
- sun = bridge->nr_slots;
+ sun = slot_count;

dbg("found ACPI PCI Hotplug slot %llu at PCI %04x:%02x:%02x\n",
sun, pci_domain_nr(pbus), pbus->number, device);

retval = acpiphp_register_hotplug_slot(slot, sun);
if (retval) {
- bridge->nr_slots--;
+ slot_count--;
if (retval == -EBUSY)
warn("Slot %llu already registered by another "
"hotplug driver\n", sun);


\
 
 \ /
  Last update: 2013-07-12 02:41    [W:0.376 / U:0.716 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site