summaryrefslogtreecommitdiff
path: root/drivers/pci/hotplug/rpaphp_slot.c
diff options
context:
space:
mode:
authorJohn Rose <johnrose@austin.ibm.com>2005-07-25 10:17:03 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2005-09-08 14:57:23 -0700
commit56d8456b06ad1316bff3c75caed5e06e786f20d8 (patch)
treef7a17c2e66c548b5172bebd07a01437ff78a9447 /drivers/pci/hotplug/rpaphp_slot.c
parent940903c5a5a906c622a79b3101586deb1a1b3480 (diff)
[PATCH] PCI Hotplug: rpaphp: Purify hotplug
Currently rpaphp registers the following bus types as hotplug slots: 1) Actual PCI Hotplug slots 2) Embedded/Internal PCI slots 3) PCI Host Bridges The second and third bus types are not actually direct parents of removable adapters. As such, the rpaphp has special case code to fake results for attributes like power, adapter status, etc. This patch removes types 2 and 3 from the rpaphp module. This patch also changes the DLPAR module so that slots can be DLPAR-added/removed without having been designated as hotplug-capable. Signed-off-by: John Rose <johnrose@austin.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/hotplug/rpaphp_slot.c')
-rw-r--r--drivers/pci/hotplug/rpaphp_slot.c57
1 files changed, 9 insertions, 48 deletions
diff --git a/drivers/pci/hotplug/rpaphp_slot.c b/drivers/pci/hotplug/rpaphp_slot.c
index 80402027c015..0e8815495083 100644
--- a/drivers/pci/hotplug/rpaphp_slot.c
+++ b/drivers/pci/hotplug/rpaphp_slot.c
@@ -30,35 +30,6 @@
#include <asm/rtas.h>
#include "rpaphp.h"
-static ssize_t removable_read_file (struct hotplug_slot *php_slot, char *buf)
-{
- u8 value;
- int retval = -ENOENT;
- struct slot *slot = (struct slot *)php_slot->private;
-
- if (!slot)
- return retval;
-
- value = slot->removable;
- retval = sprintf (buf, "%d\n", value);
- return retval;
-}
-
-static struct hotplug_slot_attribute hotplug_slot_attr_removable = {
- .attr = {.name = "phy_removable", .mode = S_IFREG | S_IRUGO},
- .show = removable_read_file,
-};
-
-static void rpaphp_sysfs_add_attr_removable (struct hotplug_slot *slot)
-{
- sysfs_create_file(&slot->kobj, &hotplug_slot_attr_removable.attr);
-}
-
-static void rpaphp_sysfs_remove_attr_removable (struct hotplug_slot *slot)
-{
- sysfs_remove_file(&slot->kobj, &hotplug_slot_attr_removable.attr);
-}
-
static ssize_t location_read_file (struct hotplug_slot *php_slot, char *buf)
{
char *value;
@@ -176,9 +147,6 @@ int deregister_slot(struct slot *slot)
/* remove "phy_location" file */
rpaphp_sysfs_remove_attr_location(php_slot);
- /* remove "phy_removable" file */
- rpaphp_sysfs_remove_attr_removable(php_slot);
-
retval = pci_hp_deregister(php_slot);
if (retval)
err("Problem unregistering a slot %s\n", slot->name);
@@ -212,9 +180,6 @@ int register_slot(struct slot *slot)
/* create "phy_locatoin" file */
rpaphp_sysfs_add_attr_location(slot->hotplug_slot);
- /* create "phy_removable" file */
- rpaphp_sysfs_add_attr_removable(slot->hotplug_slot);
-
/* add slot to our internal list */
dbg("%s adding slot[%s] to rpaphp_slot_list\n",
__FUNCTION__, slot->name);
@@ -230,21 +195,17 @@ int rpaphp_get_power_status(struct slot *slot, u8 * value)
{
int rc = 0, level;
- if (slot->type == HOTPLUG) {
- rc = rtas_get_power_level(slot->power_domain, &level);
- if (!rc) {
- dbg("%s the power level of slot %s(pwd-domain:0x%x) is %d\n",
- __FUNCTION__, slot->name, slot->power_domain, level);
- *value = level;
- } else
- err("failed to get power-level for slot(%s), rc=0x%x\n",
- slot->location, rc);
- } else {
- dbg("%s report POWER_ON for EMBEDDED or PHB slot %s\n",
- __FUNCTION__, slot->location);
- *value = (u8) POWER_ON;
+ rc = rtas_get_power_level(slot->power_domain, &level);
+ if (rc < 0) {
+ err("failed to get power-level for slot(%s), rc=0x%x\n",
+ slot->location, rc);
+ return rc;
}
+ dbg("%s the power level of slot %s(pwd-domain:0x%x) is %d\n",
+ __FUNCTION__, slot->name, slot->power_domain, level);
+ *value = level;
+
return rc;
}