Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bd1d98...
Commit: bd1d9855be3ab8a5c2b31053d464b7fe63e6963b
Parent: e5665a45fa28d0114f61b5d534a3b2678592219d
Author: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
AuthorDate: Mon Sep 29 17:37:05 2008 +0900
Committer: Jesse Barnes <jbarnes@virtuousgeek.org>
CommitDate: Mon Oct 20 11:01:50 2008 -0700
PCI hotplug: fix get_##name return value problem
The commit 356a9d6f3dd283f83861adf1ac909879f0e66411 (PCI: fix hotplug
get_##name return value problem) doesn't seem to be merged properly.
Because of this, PCI hotplug no longer works (Read/Write PCI hotplug
files always returns -ENODEV).
This patch fixes wrong check of try_module_get() return value check in
get_##name().
Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
---
drivers/pci/hotplug/pci_hotplug_core.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/pci/hotplug/pci_hotplug_core.c b/drivers/pci/hotplug/pci_hotplug_core.c
index 27d2b6f..2e6c447 100644
--- a/drivers/pci/hotplug/pci_hotplug_core.c
+++ b/drivers/pci/hotplug/pci_hotplug_core.c
@@ -102,7 +102,7 @@ static int get_##name (struct hotplug_slot *slot, type *value) \
{ \
struct hotplug_slot_ops *ops = slot->ops; \
int retval = 0; \
- if (try_module_get(ops->owner)) \
+ if (!try_module_get(ops->owner)) \
return -ENODEV; \
if (ops->get_##name) \
retval = ops->get_##name(slot, value); \
--