* [BK PATCH] PCI hotplug changes for 2.5.54
@ 2003-01-08 1:55 Greg KH
2003-01-08 1:55 ` [PATCH] " Greg KH
0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2003-01-08 1:55 UTC (permalink / raw)
To: torvalds; +Cc: linux-kernel, pcihpd-discuss
Here are some minor PCI hotplug changes for 2.5.54.
Please pull from: bk://linuxusb.bkbits.net/pci_hp-2.5
thanks,
greg k-h
drivers/hotplug/ibmphp_core.c | 10 ++++-----
drivers/hotplug/pci_hotplug_core.c | 41 ++++++++++++++++++-------------------
drivers/pci/hotplug.c | 2 -
3 files changed, 26 insertions(+), 27 deletions(-)
-----
ChangeSet@1.896, 2003-01-07 16:41:22-08:00, greg@kroah.com
PCI hotplug: clean up the try_module_get() logic a bit.
drivers/hotplug/pci_hotplug_core.c | 41 ++++++++++++++++++-------------------
1 files changed, 20 insertions(+), 21 deletions(-)
------
ChangeSet@1.895, 2003-01-07 16:29:23-08:00, greg@kroah.com
PCI: properly unregister a PCI device if it is removed.
This is only used by pci hotplug and cardbus systems.
drivers/pci/hotplug.c | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
------
ChangeSet@1.894, 2003-01-07 16:24:14-08:00, greg@kroah.com
IBM PCI Hotplug: fix compile time error due to find_bus() function name.
drivers/hotplug/ibmphp_core.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
------
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] PCI hotplug changes for 2.5.54
2003-01-08 1:55 [BK PATCH] PCI hotplug changes for 2.5.54 Greg KH
@ 2003-01-08 1:55 ` Greg KH
2003-01-08 1:57 ` Greg KH
0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2003-01-08 1:55 UTC (permalink / raw)
To: linux-kernel, pcihpd-discuss
ChangeSet 1.894, 2003/01/07 16:24:14-08:00, greg@kroah.com
IBM PCI Hotplug: fix compile time error due to find_bus() function name.
diff -Nru a/drivers/hotplug/ibmphp_core.c b/drivers/hotplug/ibmphp_core.c
--- a/drivers/hotplug/ibmphp_core.c Tue Jan 7 16:45:11 2003
+++ b/drivers/hotplug/ibmphp_core.c Tue Jan 7 16:45:11 2003
@@ -769,11 +769,11 @@
* Parameters: bus number
* Returns : pci_bus * or NULL if not found
*/
-static struct pci_bus *find_bus (u8 busno)
+static struct pci_bus *ibmphp_find_bus (u8 busno)
{
const struct list_head *tmp;
struct pci_bus *bus;
- debug ("inside find_bus, busno = %x \n", busno);
+ debug ("inside %s, busno = %x \n", __FUNCTION__, busno);
list_for_each (tmp, &pci_root_buses) {
bus = (struct pci_bus *) pci_bus_b (tmp);
@@ -1002,7 +1002,7 @@
struct pci_dev *dev;
u16 l;
- if (find_bus (busno) || !(ibmphp_find_same_bus_num (busno)))
+ if (ibmphp_find_bus (busno) || !(ibmphp_find_same_bus_num (busno)))
return 1;
bus = kmalloc (sizeof (*bus), GFP_KERNEL);
@@ -1056,7 +1056,7 @@
func->dev = pci_find_slot (func->busno, (func->device << 3) | (func->function & 0x7));
if (func->dev == NULL) {
- dev0.bus = find_bus (func->busno);
+ dev0.bus = ibmphp_find_bus (func->busno);
dev0.devfn = ((func->device << 3) + (func->function & 0x7));
dev0.sysdata = dev0.bus->sysdata;
@@ -1636,7 +1636,7 @@
return -ENOMEM;
}
- bus = find_bus (0);
+ bus = ibmphp_find_bus (0);
if (!bus) {
err ("Can't find the root pci bus, can not continue\n");
return -ENODEV;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] PCI hotplug changes for 2.5.54
2003-01-08 1:55 ` [PATCH] " Greg KH
@ 2003-01-08 1:57 ` Greg KH
2003-01-08 1:58 ` Greg KH
0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2003-01-08 1:57 UTC (permalink / raw)
To: linux-kernel, pcihpd-discuss
ChangeSet 1.895, 2003/01/07 16:29:23-08:00, greg@kroah.com
PCI: properly unregister a PCI device if it is removed.
This is only used by pci hotplug and cardbus systems.
diff -Nru a/drivers/pci/hotplug.c b/drivers/pci/hotplug.c
--- a/drivers/pci/hotplug.c Tue Jan 7 16:44:43 2003
+++ b/drivers/pci/hotplug.c Tue Jan 7 16:44:43 2003
@@ -105,7 +105,7 @@
void
pci_remove_device(struct pci_dev *dev)
{
- put_device(&dev->dev);
+ device_unregister(&dev->dev);
list_del(&dev->bus_list);
list_del(&dev->global_list);
pci_free_resources(dev);
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] PCI hotplug changes for 2.5.54
2003-01-08 1:57 ` Greg KH
@ 2003-01-08 1:58 ` Greg KH
0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2003-01-08 1:58 UTC (permalink / raw)
To: linux-kernel, pcihpd-discuss
ChangeSet 1.896, 2003/01/07 16:41:22-08:00, greg@kroah.com
PCI hotplug: clean up the try_module_get() logic a bit.
diff -Nru a/drivers/hotplug/pci_hotplug_core.c b/drivers/hotplug/pci_hotplug_core.c
--- a/drivers/hotplug/pci_hotplug_core.c Tue Jan 7 16:44:10 2003
+++ b/drivers/hotplug/pci_hotplug_core.c Tue Jan 7 16:44:10 2003
@@ -561,7 +561,7 @@
up(&parent->d_inode->i_sem);
}
-/* yuck, WFT is this? */
+/* Weee, fun with macros... */
#define GET_STATUS(name,type) \
static int get_##name (struct hotplug_slot *slot, type *value) \
{ \
@@ -661,29 +661,26 @@
power = (u8)(lpower & 0xff);
dbg ("power = %d\n", power);
+ if (!try_module_get(slot->ops->owner)) {
+ retval = -ENODEV;
+ goto exit;
+ }
switch (power) {
case 0:
- if (!slot->ops->disable_slot)
- break;
- if (try_module_get(slot->ops->owner)) {
+ if (slot->ops->disable_slot)
retval = slot->ops->disable_slot(slot);
- module_put(slot->ops->owner);
- }
break;
case 1:
- if (!slot->ops->enable_slot)
- break;
- if (try_module_get(slot->ops->owner)) {
+ if (slot->ops->enable_slot)
retval = slot->ops->enable_slot(slot);
- module_put(slot->ops->owner);
- }
break;
default:
err ("Illegal value specified for power\n");
retval = -EINVAL;
}
+ module_put(slot->ops->owner);
exit:
kfree (buff);
@@ -770,12 +767,13 @@
attention = (u8)(lattention & 0xff);
dbg (" - attention = %d\n", attention);
- if (slot->ops->set_attention_status) {
- if (try_module_get(slot->ops->owner)) {
- retval = slot->ops->set_attention_status(slot, attention);
- module_put(slot->ops->owner);
- }
+ if (!try_module_get(slot->ops->owner)) {
+ retval = -ENODEV;
+ goto exit;
}
+ if (slot->ops->set_attention_status)
+ retval = slot->ops->set_attention_status(slot, attention);
+ module_put(slot->ops->owner);
exit:
kfree (buff);
@@ -1007,12 +1005,13 @@
test = (u32)(ltest & 0xffffffff);
dbg ("test = %d\n", test);
- if (slot->ops->hardware_test) {
- if (try_module_get(slot->ops->owner)) {
- retval = slot->ops->hardware_test(slot, test);
- module_put(slot->ops->owner);
- }
+ if (!try_module_get(slot->ops->owner)) {
+ retval = -ENODEV;
+ goto exit;
}
+ if (slot->ops->hardware_test)
+ retval = slot->ops->hardware_test(slot, test);
+ module_put(slot->ops->owner);
exit:
kfree (buff);
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-01-08 1:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-08 1:55 [BK PATCH] PCI hotplug changes for 2.5.54 Greg KH
2003-01-08 1:55 ` [PATCH] " Greg KH
2003-01-08 1:57 ` Greg KH
2003-01-08 1:58 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox