mirror of
https://github.com/torvalds/linux.git
synced 2024-12-03 17:41:22 +00:00
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>
This commit is contained in:
parent
e5665a45fa
commit
bd1d9855be
@ -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); \
|
||||
|
Loading…
Reference in New Issue
Block a user