]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/pci/hotplug/pci_hotplug_core.c
PCI: fix hotplug get_##name return value problem
[linux-2.6-omap-h63xx.git] / drivers / pci / hotplug / pci_hotplug_core.c
index 5f85b1b120e3ddc12c350e2b821c18946ec90e27..27d2b6fe5d532e156697290e3c4eaa380787b030 100644 (file)
@@ -102,13 +102,13 @@ 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 (ops->get_##name)                                    \
-                       retval = ops->get_##name(slot, value);          \
-               else                                                    \
-                       *value = slot->info->name;                      \
-               module_put(ops->owner);                                 \
-       }                                                               \
+       if (try_module_get(ops->owner))                                 \
+               return -ENODEV;                                         \
+       if (ops->get_##name)                                            \
+               retval = ops->get_##name(slot, value);                  \
+       else                                                            \
+               *value = slot->info->name;                              \
+       module_put(ops->owner);                                         \
        return retval;                                                  \
 }