]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
PCI hotplug: fix get_##name return value problem
authorKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Mon, 29 Sep 2008 08:37:05 +0000 (17:37 +0900)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Mon, 20 Oct 2008 18:01:50 +0000 (11:01 -0700)
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

index 27d2b6fe5d532e156697290e3c4eaa380787b030..2e6c4474644eb9e27f3f61773280838a5e351580 100644 (file)
@@ -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);                  \