aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorLinas Vepstas <linas@austin.ibm.com>2007-04-13 18:34:13 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-05-02 22:02:39 -0400
commit427310ff02e80cc80826407c0121cec3694c9e7d (patch)
tree7c7577d89e56f12225a52609ba92e24216244a01 /drivers/pci
parent517d5a0417e19101eaa769039d1921d626ee546c (diff)
PCI: rpaphp: Remve another call that is a wrapper
Remove another stovepipe: a call which wraps another call, and just adds printks. Signed-off-by: Linas Vepstas <linas@austin.ibm.com> Cc: John Rose <johnrose@austin.ibm.com> Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/hotplug/rpaphp.h1
-rw-r--r--drivers/pci/hotplug/rpaphp_core.c6
-rw-r--r--drivers/pci/hotplug/rpaphp_pci.c7
-rw-r--r--drivers/pci/hotplug/rpaphp_slot.c18
4 files changed, 10 insertions, 22 deletions
diff --git a/drivers/pci/hotplug/rpaphp.h b/drivers/pci/hotplug/rpaphp.h
index 2ccbe8d4229d..fdd99b2ebe5f 100644
--- a/drivers/pci/hotplug/rpaphp.h
+++ b/drivers/pci/hotplug/rpaphp.h
@@ -103,7 +103,6 @@ extern void dealloc_slot_struct(struct slot *slot);
103extern struct slot *alloc_slot_struct(struct device_node *dn, int drc_index, char *drc_name, int power_domain); 103extern struct slot *alloc_slot_struct(struct device_node *dn, int drc_index, char *drc_name, int power_domain);
104extern int rpaphp_register_slot(struct slot *slot); 104extern int rpaphp_register_slot(struct slot *slot);
105extern int rpaphp_deregister_slot(struct slot *slot); 105extern int rpaphp_deregister_slot(struct slot *slot);
106extern int rpaphp_get_power_status(struct slot *slot, u8 * value);
107extern int rpaphp_set_attention_status(struct slot *slot, u8 status); 106extern int rpaphp_set_attention_status(struct slot *slot, u8 status);
108 107
109#endif /* _PPC64PHP_H */ 108#endif /* _PPC64PHP_H */
diff --git a/drivers/pci/hotplug/rpaphp_core.c b/drivers/pci/hotplug/rpaphp_core.c
index ca95e1515d6f..2d919fb1931c 100644
--- a/drivers/pci/hotplug/rpaphp_core.c
+++ b/drivers/pci/hotplug/rpaphp_core.c
@@ -100,11 +100,13 @@ static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 value)
100 */ 100 */
101static int get_power_status(struct hotplug_slot *hotplug_slot, u8 * value) 101static int get_power_status(struct hotplug_slot *hotplug_slot, u8 * value)
102{ 102{
103 int retval; 103 int retval, level;
104 struct slot *slot = (struct slot *)hotplug_slot->private; 104 struct slot *slot = (struct slot *)hotplug_slot->private;
105 105
106 down(&rpaphp_sem); 106 down(&rpaphp_sem);
107 retval = rpaphp_get_power_status(slot, value); 107 retval = rtas_get_power_level (slot->power_domain, &level);
108 if (!retval)
109 *value = level;
108 up(&rpaphp_sem); 110 up(&rpaphp_sem);
109 return retval; 111 return retval;
110} 112}
diff --git a/drivers/pci/hotplug/rpaphp_pci.c b/drivers/pci/hotplug/rpaphp_pci.c
index 881e8073c807..ba8c83770abe 100644
--- a/drivers/pci/hotplug/rpaphp_pci.c
+++ b/drivers/pci/hotplug/rpaphp_pci.c
@@ -183,9 +183,14 @@ exit_rc:
183 183
184int rpaphp_register_pci_slot(struct slot *slot) 184int rpaphp_register_pci_slot(struct slot *slot)
185{ 185{
186 int rc, level;
186 struct hotplug_slot_info *info = slot->hotplug_slot->info; 187 struct hotplug_slot_info *info = slot->hotplug_slot->info;
187 188
188 rpaphp_get_power_status(slot, &info->power_status); 189 rc = rtas_get_power_level(slot->power_domain, &level);
190 if (rc)
191 return rc;
192 info->power_status = level;
193
189 rpaphp_get_pci_adapter_status(slot, 1, &info->adapter_status); 194 rpaphp_get_pci_adapter_status(slot, 1, &info->adapter_status);
190 195
191 if (info->adapter_status == NOT_VALID) { 196 if (info->adapter_status == NOT_VALID) {
diff --git a/drivers/pci/hotplug/rpaphp_slot.c b/drivers/pci/hotplug/rpaphp_slot.c
index 9b9400727985..30c9dc98e4ec 100644
--- a/drivers/pci/hotplug/rpaphp_slot.c
+++ b/drivers/pci/hotplug/rpaphp_slot.c
@@ -184,24 +184,6 @@ sysfs_fail:
184 return retval; 184 return retval;
185} 185}
186 186
187int rpaphp_get_power_status(struct slot *slot, u8 * value)
188{
189 int rc = 0, level;
190
191 rc = rtas_get_power_level(slot->power_domain, &level);
192 if (rc < 0) {
193 err("failed to get power-level for slot(%s), rc=0x%x\n",
194 slot->location, rc);
195 return rc;
196 }
197
198 dbg("%s the power level of slot %s(pwd-domain:0x%x) is %d\n",
199 __FUNCTION__, slot->name, slot->power_domain, level);
200 *value = level;
201
202 return rc;
203}
204
205int rpaphp_set_attention_status(struct slot *slot, u8 status) 187int rpaphp_set_attention_status(struct slot *slot, u8 status)
206{ 188{
207 int rc; 189 int rc;