git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
VServer 1.9.2 (patch-2.6.8.1-vs1.9.2.diff)
[linux-2.6.git]
/
drivers
/
pci
/
hotplug
/
rpaphp_vio.c
diff --git
a/drivers/pci/hotplug/rpaphp_vio.c
b/drivers/pci/hotplug/rpaphp_vio.c
index
29d7ca6
..
d82b664
100644
(file)
--- a/
drivers/pci/hotplug/rpaphp_vio.c
+++ b/
drivers/pci/hotplug/rpaphp_vio.c
@@
-74,20
+74,27
@@
int register_vio_slot(struct device_node *dn)
int rc = 1;
struct slot *slot = NULL;
int rc = 1;
struct slot *slot = NULL;
+ name = rpaphp_get_drc_name(dn);
+ if (!name)
+ goto exit_rc;
index = (u32 *) get_property(dn, "ibm,my-drc-index", NULL);
if (!index)
goto exit_rc;
index = (u32 *) get_property(dn, "ibm,my-drc-index", NULL);
if (!index)
goto exit_rc;
- name = get_property(dn, "ibm,loc-code", NULL);
- if (!name)
- goto exit_rc;
if (!(slot = alloc_slot_struct(dn, *index, name, 0))) {
rc = -ENOMEM;
goto exit_rc;
}
slot->dev_type = VIO_DEV;
slot->dev.vio_dev = vio_find_node(dn);
if (!(slot = alloc_slot_struct(dn, *index, name, 0))) {
rc = -ENOMEM;
goto exit_rc;
}
slot->dev_type = VIO_DEV;
slot->dev.vio_dev = vio_find_node(dn);
- if (!slot->dev.vio_dev)
- slot->dev.vio_dev = vio_register_device(dn);
+ if (slot->dev.vio_dev) {
+ /*
+ * rpaphp is the only owner of vio devices and
+ * does not need extra reference taken by
+ * vio_find_node
+ */
+ put_device(&slot->dev.vio_dev->dev);
+ } else
+ slot->dev.vio_dev = vio_register_device_node(dn);
if (slot->dev.vio_dev)
slot->state = CONFIGURED;
else
if (slot->dev.vio_dev)
slot->state = CONFIGURED;
else
@@
-108,7
+115,7
@@
int rpaphp_enable_vio_slot(struct slot *slot)
{
int retval = 0;
{
int retval = 0;
- if ((slot->dev.vio_dev = vio_register_device(slot->dn))) {
+ if ((slot->dev.vio_dev = vio_register_device
_node
(slot->dn))) {
info("%s: VIO adapter %s in slot[%s] has been configured\n",
__FUNCTION__, slot->dn->name, slot->name);
slot->state = CONFIGURED;
info("%s: VIO adapter %s in slot[%s] has been configured\n",
__FUNCTION__, slot->dn->name, slot->name);
slot->state = CONFIGURED;